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 void draw(Rect clipRect); 00037 00042 virtual Animation* const getNormalAnimation(); 00043 00048 virtual Animation* const getClickedAnimation(); 00049 00056 bool click(s16 x, s16 y); 00057 00064 bool release(s16 x, s16 y); 00065 00066 protected: 00067 Animation* _animNormal; 00068 Animation* _animClicked; 00069 u16 _animX; 00070 u16 _animY; 00071 bool _initialised; 00072 WoopsiTimer* _timer; 00077 virtual ~AnimButton(); 00078 00082 inline AnimButton(const AnimButton& animButton) : Gadget(animButton) { }; 00083 00088 void handleActionEvent(const GadgetEventArgs& e); 00089 }; 00090 } 00091 00092 #endif