00001 #ifndef _SCROLLBAR_HORIZONTAL_H_ 00002 #define _SCROLLBAR_HORIZONTAL_H_ 00003 00004 #include <nds.h> 00005 #include "gadget.h" 00006 #include "gadgeteventhandler.h" 00007 #include "gadgetstyle.h" 00008 #include "sliderbase.h" 00009 00010 namespace WoopsiUI { 00011 00012 class SliderHorizontal; 00013 class Button; 00014 class WoopsiTimer; 00015 00024 class ScrollbarHorizontal : public SliderBase, public Gadget, public GadgetEventHandler { 00025 00026 public: 00027 00039 ScrollbarHorizontal(s16 x, s16 y, u16 width, u16 height, GadgetStyle* style = NULL); 00040 00045 const s16 getMinimumValue() const; 00046 00051 const s16 getMaximumValue() const; 00052 00057 const s16 getValue() const; 00058 00066 const s16 getPageSize() const; 00067 00072 void setMinimumValue(const s16 value); 00073 00078 void setMaximumValue(const s16 value); 00079 00085 void setValue(const s16 value); 00086 00094 void setValueWithBitshift(const s32 value); 00095 00101 void setPageSize(const s16 pageSize); 00102 00107 virtual void handleActionEvent(const GadgetEventArgs& e); 00108 00113 virtual void handleClickEvent(const GadgetEventArgs& e); 00114 00119 virtual void handleReleaseEvent(const GadgetEventArgs& e); 00120 00125 virtual void handleReleaseOutsideEvent(const GadgetEventArgs& e); 00126 00131 virtual void handleValueChangeEvent(const GadgetEventArgs& e); 00132 00133 protected: 00134 SliderHorizontal* _slider; 00135 Button* _leftButton; 00136 Button* _rightButton; 00137 u8 _buttonWidth; 00138 u8 _scrollTimeout; 00139 WoopsiTimer* _timer; 00146 virtual void onResize(u16 width, u16 height); 00147 00151 virtual inline ~ScrollbarHorizontal() { }; 00152 00156 inline ScrollbarHorizontal(const ScrollbarHorizontal& scrollbarHorizontal) : Gadget(scrollbarHorizontal) { }; 00157 }; 00158 } 00159 00160 #endif