Woopsi 1.3
Nintendo DS Gui Framework
libwoopsi/include/amigawindow.h
00001 #ifndef _AMIGA_WINDOW_H_
00002 #define _AMIGA_WINDOW_H_
00003 
00004 #include <nds.h>
00005 #include "window.h"
00006 #include "gadgeteventhandler.h"
00007 #include "gadgetstyle.h"
00008 #include "woopsistring.h"
00009 
00010 const s32 WINDOW_TITLE_HEIGHT = 13;
00011 const s32 WINDOW_BORDER_SIZE = 4;
00012 const s32 WINDOW_CLOSE_BUTTON_WIDTH = 14;
00013 const s32 WINDOW_DEPTH_BUTTON_WIDTH = 14;
00014 
00015 namespace WoopsiUI {
00016 
00017     class WindowBorderButton;
00018 
00024     class AmigaWindow : public Window, public GadgetEventHandler {
00025 
00026     public:
00027 
00031         typedef struct {
00032             u8 showCloseButton : 1;                     
00033             u8 showDepthButton : 1;                     
00034         } AmigaWindowFlags;
00035 
00050         AmigaWindow(s16 x, s16 y, u16 width, u16 height, const WoopsiString& title, bool showCloseButton, bool showDepthButton, GadgetStyle* style = NULL);
00051 
00056         virtual void setBorderless(bool isBorderless);
00057 
00062         virtual void handleReleaseEvent(const GadgetEventArgs& e);
00063 
00068         virtual void showCloseButton();
00069 
00074         virtual void showDepthButton();
00075 
00080         virtual void hideCloseButton();
00081 
00086         virtual void hideDepthButton();
00087 
00092         virtual inline const bool hasCloseButton() const { return _windowFlags.showCloseButton; };
00093 
00098         virtual inline const bool hasDepthButton() const { return _windowFlags.showDepthButton; };
00099 
00100     protected:
00101         AmigaWindowFlags _windowFlags;                  
00103         WindowBorderButton* _closeButton;               
00104         WindowBorderButton* _depthButton;               
00112         virtual void drawBorder(GraphicsPort* port);
00113 
00119         virtual void onResize(u16 width, u16 height);
00120         
00124         virtual void onFocus();
00125         
00129         virtual void onBlur();
00130 
00138         virtual void onClick(s16 x, s16 y);
00139 
00143         virtual void createBorder();
00144         
00148         virtual void markBorderDirty();
00149         
00153         virtual inline ~AmigaWindow() { }
00154 
00158         inline AmigaWindow(const AmigaWindow& amigaWindow) : Window(amigaWindow) { };
00159     };
00160 }
00161 
00162 #endif
 All Classes Functions Variables Enumerations Enumerator