00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _uscrollpane_hpp_
00021 #define _uscrollpane_hpp_
00022
00023 #include <ubit/uborder.hpp>
00024 #include <ubit/uview.hpp>
00025 namespace ubit {
00026
00041 class UScrollpane: public UBox {
00042 public:
00043 UBIT_ELEMENT_CLASS(UScrollpane, UBox)
00044
00045 UScrollpane(const UArgs& = UArgs::none);
00047
00048 UScrollpane(int vert_scrollbar, int horiz_scrollbar, const UArgs& = UArgs::none);
00054 friend UScrollpane& uscrollpane(const UArgs& args = UArgs::none);
00056
00057 friend UScrollpane& uscrollpane(int vert_scrollbar, int horiz_scrollbar,
00058 const UArgs& args = UArgs::none);
00060
00061 virtual ~UScrollpane();
00062
00063
00064
00065 virtual void setXScroll(float xscroll);
00066 virtual void setYScroll(float yscroll);
00067 virtual void setScroll(float xscroll, float yscroll);
00068 virtual void scroll(float _xscroll, float _yscroll) {setScroll(_xscroll, _yscroll);}
00073 virtual void makeVisible(UBox& child);
00078 float getXScroll() const {return xscroll;}
00079 float getYScroll() const {return yscroll;}
00081
00082 UScrollbar* getHScrollbar() {return hscrollbar;}
00083 UScrollbar* getVScrollbar() {return vscrollbar;}
00085
00086 UBox* getScrolledBox();
00088
00089 UView* getScrolledView(UView* pane_view);
00096 virtual void setTracking(bool);
00098
00099
00100
00101 static UStyle* createStyle();
00102
00103 #ifndef NO_DOC
00104 virtual void setScrollImpl(float xscroll, float yscroll);
00105 virtual void setScrollImpl(float xscroll, float yscroll,
00106 bool upd_x, bool upd_y, bool update_pane);
00107 protected:
00108 friend class UScrollbar;
00109 UScrollbar *hscrollbar, *vscrollbar;
00110 float xscroll, yscroll;
00111
00112 virtual void constructs(int vs_mode, int hs_mode, const UArgs&);
00113 virtual void unsetHScrollbar();
00114 virtual void unsetVScrollbar();
00115 virtual void resizeCB(UEvent&);
00116 virtual void wheelCB(UWheelEvent&);
00117 #endif
00118 };
00119
00120
00121
00126 class UPaneView: public UView {
00127 public:
00128 static UViewStyle style;
00129 virtual UViewStyle* getViewStyle() {return &style;}
00130
00131 UPaneView(UChild*, UView* parview, UHardWinImpl*);
00132 virtual ~UPaneView() {}
00133
00134 static UView* createView(UChild*, UView* parview, UHardWinImpl*);
00135 virtual UPaneView* paneCast() {return this;}
00136
00137 int getXScroll() {return xscroll;}
00138 int getYScroll() {return yscroll;}
00139
00140 virtual void setXScroll(int scr) {xscroll = scr;}
00141 virtual void setYScroll(int scr) {yscroll = scr;}
00143
00144
00145
00146 #ifndef NO_DOC
00147 friend class UScrollpane;
00148 UMargins margins;
00149 int xscroll, yscroll;
00150 #endif
00151 };
00152 }
00153 #endif
00154
00155
00156