Woopsi 1.0
GUI Framework for Nintendo DS Homebrew

scrollbarhorizontal.h

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 s32 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 s32 value);
00086 
00092                 void setPageSize(const s16 pageSize);
00093 
00098                 virtual void handleActionEvent(const GadgetEventArgs& e);
00099 
00104                 virtual void handleClickEvent(const GadgetEventArgs& e);
00105 
00110                 virtual void handleReleaseEvent(const GadgetEventArgs& e);
00111 
00116                 virtual void handleReleaseOutsideEvent(const GadgetEventArgs& e);
00117 
00122                 virtual void handleValueChangeEvent(const GadgetEventArgs& e);
00123 
00124         protected:
00125                 SliderHorizontal* _slider;                                      
00126                 Button* _leftButton;                                            
00127                 Button* _rightButton;                                           
00128                 u8 _buttonWidth;                                                        
00129                 u8 _scrollTimeout;                                                      
00130                 WoopsiTimer* _timer;                                            
00137                 virtual void onResize(u16 width, u16 height);
00138                 
00142                 virtual inline ~ScrollbarHorizontal() { };
00143 
00147                 inline ScrollbarHorizontal(const ScrollbarHorizontal& scrollbarHorizontal) : Gadget(scrollbarHorizontal) { };
00148         };
00149 }
00150 
00151 #endif