00001 #ifndef _SCREEN_H_
00002 #define _SCREEN_H_
00003
00004 #include <nds.h>
00005 #include "gadget.h"
00006
00007 #define SCREEN_TITLE_HEIGHT 13
00008 #define SCREEN_FLIP_BUTTON_WIDTH 16
00009 #define SCREEN_DEPTH_BUTTON_WIDTH 16
00010
00011 namespace WoopsiUI {
00012
00018 class Screen : public Gadget {
00019
00020 public:
00027 Screen(const char* title, u32 flags, FontBase* font = NULL);
00028
00035 virtual void getClientRect(Rect& rect) const;
00036
00042 virtual inline const u8 getTitleHeight() const { return _titleHeight; };
00043
00048 virtual inline const char* getTitle() const { return _title; };
00049
00056 virtual void draw(Rect clipRect);
00057
00069 virtual bool swapGadgetDepth(Gadget* gadget);
00070
00077 virtual bool click(s16 x, s16 y);
00078
00085 virtual bool release(s16 x, s16 y);
00086
00102 virtual bool drag(s16 x, s16 y, s16 vX, s16 vY);
00103
00107 virtual void flipToTopScreen();
00108
00112 virtual void flipToBottomScreen();
00113
00117 virtual bool flipScreens();
00118
00123 virtual bool focus();
00124
00129 void setTitle(const char* title);
00130
00131 protected:
00132 u8 _titleHeight;
00133 char* _title;
00138 virtual inline ~Screen() {
00139 if (_title != NULL) {
00140 delete [] _title;
00141 }
00142 };
00143
00147 inline Screen(const Screen& screen) : Gadget(screen) { };
00148 };
00149 }
00150
00151 #endif