- 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
    00030                 AnimButton(s16 x, s16 y, u16 width, u16 height, u16 animX, u16 animY);
    00031
    00036                 virtual Animation* const getNormalAnimation();
    00037
    00042                 virtual Animation* const getClickedAnimation();
    00043
    00050                 virtual void getPreferredDimensions(Rect& rect) const;
    00051
    00052         protected:
    00053                 Animation* _animNormal;
    00054                 Animation* _animClicked;
    00055                 u16 _animX;
    00056                 u16 _animY;
    00057                 bool _initialised;
    00058                 WoopsiTimer* _timer;
    00060                 static const int ANIM_BUTTON_DEFAULT_WIDTH;
    00061                 static const int ANIM_BUTTON_DEFAULT_HEIGHT;
    00069                 virtual void drawContents(GraphicsPort* port);
    00070
    00077                 virtual void drawBorder(GraphicsPort* port);
    00078
    00083                 virtual void drawOutline(GraphicsPort* port);
    00084
    00090                 virtual void onClick(s16 x, s16 y);
    00091
    00097                 virtual void onRelease(s16 x, s16 y);
    00098
    00104                 virtual void onReleaseOutside(s16 x, s16 y);
    00105
    00109                 virtual void onDisable();
    00110
    00114                 virtual void onEnable();
    00115
    00119                 virtual ~AnimButton();
    00120
    00124                 inline AnimButton(const AnimButton& animButton) : Gadget(animButton) { };
    00125
    00130                 void handleActionEvent(const GadgetEventArgs& e);
    00131         };
    00132 }
    00133
    00134 #endif