uscrollpane.hpp

00001 /* ==================================================== ======== ======= *
00002 *
00003 *  uscrollpane.hpp
00004 *  Ubit Project
00005 *  Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs
00006 *  (C) 1999-2006 Eric Lecolinet / ENST Paris / http://www.enst.fr/~elc/ubit
00007 *
00008 * ***********************************************************************
00009 * COPYRIGHT NOTICE :
00010 * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE
00011 * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
00012 * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU
00013 * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
00014 * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00015 * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00016 * ***********************************************************************
00017 * ==================================================== [(c)Elc] ======= *
00018 * ==================================================== ======== ======= */
00019 
00020 #ifndef _uscrollpane_hpp_
00021 #define _uscrollpane_hpp_
00022 //pragma ident "@(#)uscrollpane.hpp             ubit:05.05.00"
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   // - - - Impl.  - - - - - - - - - - - - - - - - - - - - - - - - - - -    
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 /* ==================================================== [(c)Elc] ======= */
00121 /* ==================================================== ======== ======= */
00126 class UPaneView: public UView {
00127 public:
00128   static  UViewStyle style;  // renderer
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   // implementation
00146 #ifndef NO_DOC
00147   friend class UScrollpane;
00148   UMargins margins;
00149   int xscroll, yscroll;
00150 #endif
00151 };
00152 }
00153 #endif
00154 /* ==================================================== [TheEnd] ======= */
00155 /* ==================================================== [(c)Elc] ======= */
00156 

Generated on Mon Jan 29 00:20:40 2007 for Ubit by  doxygen 1.4.7