Woopsi 1.3
Nintendo DS Gui Framework
libwoopsi/include/scrollbarpanel.h
00001 #ifndef _SCROLLBAR_PANEL_H_
00002 #define _SCROLLBAR_PANEL_H_
00003 
00004 #include "gadget.h"
00005 #include "scrollingpanel.h"
00006 #include "gadgetstyle.h"
00007 #include "scrollbarvertical.h"
00008 #include "scrollbarhorizontal.h"
00009 #include "gadgeteventhandler.h"
00010 #include "scrollablebase.h"
00011 #include "graphicsport.h"
00012 
00013 namespace WoopsiUI {
00014 
00018     class ScrollbarPanel : public Gadget, public ScrollableBase, public GadgetEventHandler {
00019     public:
00020 
00032         ScrollbarPanel(s16 x, s16 y, u16 width, u16 height, GadgetStyle* style = NULL);
00033 
00039         virtual void scroll(s32 dx, s32 dy);
00040         
00046         virtual void jump(s32 x, s32 y);
00047 
00052         virtual void setAllowsVerticalScroll(bool allow);
00053 
00058         virtual void setAllowsHorizontalScroll(bool allow);
00059 
00064         virtual void setCanvasWidth(const s32 width);
00065         
00070         virtual void setCanvasHeight(const s32 height);
00071 
00076         virtual bool allowsVerticalScroll() const;
00077 
00082         virtual bool allowsHorizontalScroll() const;
00083 
00088         virtual const s32 getCanvasX() const;
00089         
00094         virtual const s32 getCanvasY() const;
00095 
00100         virtual const s32 getCanvasWidth() const;
00101         
00106         virtual const s32 getCanvasHeight() const;
00107 
00112         void handleScrollEvent(const GadgetEventArgs& e);
00113 
00118         void handleValueChangeEvent(const GadgetEventArgs& e);
00119 
00125         inline ScrollingPanel* getPanel() { return _panel; };
00126 
00127     protected:
00128         ScrollingPanel* _panel;                         
00129         ScrollbarHorizontal* _scrollbarHorizontal;      
00130         ScrollbarVertical* _scrollbarVertical;          
00131         u8 _scrollbarWidth;                             
00132         u8 _scrollbarHeight;                            
00133         bool _hasVerticalScrollbar;                     
00134         bool _hasHorizontalScrollbar;                   
00139         void buildUI();
00140 
00147         virtual void drawContents(GraphicsPort* port);
00148 
00152         virtual ~ScrollbarPanel() { };
00153 
00157         inline ScrollbarPanel(const ScrollbarPanel& scrollbarPanel) : Gadget(scrollbarPanel) { };
00158     };
00159 }
00160 
00161 #endif
 All Classes Functions Variables Enumerations Enumerator