00001 #ifndef _SCROLLBAR_HORIZONTAL_H_ 00002 #define _SCROLLBAR_HORIZONTAL_H_ 00003 00004 #include <nds.h> 00005 #include "gadget.h" 00006 #include "gadgeteventhandler.h" 00007 00008 namespace WoopsiUI { 00009 00010 class SliderHorizontal; 00011 class Button; 00012 class WoopsiTimer; 00013 00022 class ScrollbarHorizontal : public Gadget, public GadgetEventHandler { 00023 00024 public: 00025 00034 ScrollbarHorizontal(s16 x, s16 y, u16 width, u16 height, FontBase* font = NULL); 00035 00040 const s16 getMinimumValue() const; 00041 00046 const s16 getMaximumValue() const; 00047 00052 const s16 getValue() const; 00053 00061 const s16 getPageSize() const; 00062 00067 void setMinimumValue(const s16 value); 00068 00073 void setMaximumValue(const s16 value); 00074 00080 void setValue(const s16 value); 00081 00087 void setPageSize(const s16 pageSize); 00088 00093 void setButtonScrollAmount(const u16 buttonScrollAmount); 00094 00099 void jumpGrip(u8 direction); 00100 00106 virtual void draw(Rect clipRect); 00107 00112 virtual void handleActionEvent(const GadgetEventArgs& e); 00113 00118 virtual void handleClickEvent(const GadgetEventArgs& e); 00119 00124 virtual void handleReleaseEvent(const GadgetEventArgs& e); 00125 00130 virtual void handleReleaseOutsideEvent(const GadgetEventArgs& e); 00131 00136 virtual void handleValueChangeEvent(const GadgetEventArgs& e); 00137 00144 virtual bool resize(u16 width, u16 height); 00145 00146 protected: 00147 SliderHorizontal* _slider; 00148 Button* _leftButton; 00149 Button* _rightButton; 00150 u8 _buttonWidth; 00151 u16 _buttonScrollAmount; 00152 u8 _scrollTimeout; 00153 WoopsiTimer* _timer; 00159 virtual inline ~ScrollbarHorizontal() { }; 00160 00164 inline ScrollbarHorizontal(const ScrollbarHorizontal& scrollbarHorizontal) : Gadget(scrollbarHorizontal) { }; 00165 }; 00166 } 00167 00168 #endif