- Main Page
- Classes
- Files

- File List

# 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 namespace WoopsiUI {
    00011
    00012         class WindowBorderButton;
    00013
    00019         class AmigaWindow : public Window, public GadgetEventHandler {
    00020
    00021         public:
    00022
    00026                 enum AmigaWindowFlagType {
    00027                         AMIGA_WINDOW_SHOW_CLOSE = 0x0001,
    00028                         AMIGA_WINDOW_SHOW_DEPTH = 0x0002
    00029                 };
    00030
    00034                 typedef struct {
    00035                         u8 showCloseButton : 1;
    00036                         u8 showDepthButton : 1;
    00037                 } AmigaWindowFlags;
    00038
    00053                 AmigaWindow(s16 x, s16 y, u16 width, u16 height, const WoopsiString& title, u32 flags, u32 windowFlags, GadgetStyle* style = NULL);
    00054
    00059                 virtual void setBorderless(bool isBorderless);
    00060
    00065                 virtual void handleReleaseEvent(const GadgetEventArgs& e);
    00066
    00071                 virtual void showCloseButton();
    00072
    00077                 virtual void showDepthButton();
    00078
    00083                 virtual void hideCloseButton();
    00084
    00089                 virtual void hideDepthButton();
    00090
    00095                 virtual inline const bool hasCloseButton() const { return _windowFlags.showCloseButton; };
    00096
    00101                 virtual inline const bool hasDepthButton() const { return _windowFlags.showDepthButton; };
    00102
    00103         protected:
    00104                 AmigaWindowFlags _windowFlags;
    00106                 WindowBorderButton* _closeButton;
    00107                 WindowBorderButton* _depthButton;
    00115                 virtual void drawBorder(GraphicsPort* port);
    00116
    00122                 virtual void onResize(u16 width, u16 height);
    00123
    00127                 virtual void onFocus();
    00128
    00132                 virtual void onBlur();
    00133
    00141                 virtual void onClick(s16 x, s16 y);
    00142
    00146                 virtual void createBorder();
    00147
    00151                 virtual void redrawBorder();
    00152
    00156                 virtual inline ~AmigaWindow() { }
    00157
    00161                 inline AmigaWindow(const AmigaWindow& amigaWindow) : Window(amigaWindow) { };
    00162         };
    00163 }
    00164
    00165 #endif