Woopsi 1.0 GUI Framework for Nintendo DS Homebrew

- Main Page
- Classes
- Files

- File List

# animbutton.h

    00001 #ifndef _ANIM_BUTTON_H_
    00002 #define _ANIM_BUTTON_H_
    00003
    00004 #include <nds.h>
    00005 #include "gadget.h"
    00006 #include "animation.h"
    00007 #include "gadgeteventhandler.h"
    00008
    00009 namespace WoopsiUI {
    00010
    00011         class WoopsiTimer;
    00012
    00017         class AnimButton : public Gadget, public GadgetEventHandler {
    00018
    00019         public:
    00020
    00032                 AnimButton(s16 x, s16 y, u16 width, u16 height, u16 animX, u16 animY);
    00033
    00039                 virtual Animation* const getNormalAnimation();
    00040
    00045                 virtual Animation* const getClickedAnimation();
    00046
    00053                 virtual void getPreferredDimensions(Rect& rect) const;
    00054
    00055         protected:
    00056                 Animation* _animNormal;
    00057                 Animation* _animClicked;
    00058                 u16 _animX;
    00059                 u16 _animY;
    00060                 bool _initialised;
    00061                 WoopsiTimer* _timer;
    00063                 static const int ANIM_BUTTON_DEFAULT_WIDTH;
    00064                 static const int ANIM_BUTTON_DEFAULT_HEIGHT;
    00072                 virtual void drawContents(GraphicsPort* port);
    00073
    00080                 virtual void drawBorder(GraphicsPort* port);
    00081
    00086                 virtual void drawOutline(GraphicsPort* port);
    00087
    00093                 virtual void onClick(s16 x, s16 y);
    00094
    00100                 virtual void onRelease(s16 x, s16 y);
    00101
    00107                 virtual void onReleaseOutside(s16 x, s16 y);
    00108
    00112                 virtual void onDisable();
    00113
    00117                 virtual void onEnable();
    00118
    00122                 virtual ~AnimButton();
    00123
    00127                 inline AnimButton(const AnimButton& animButton) : Gadget(animButton) { };
    00128
    00133                 void handleActionEvent(const GadgetEventArgs& e);
    00134         };
    00135 }
    00136
    00137 #endif