Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

upane.hpp

00001 /* ==================================================== ======== ======= * 00002 * 00003 * upane.hpp 00004 * Ubit Project [Elc][2003] 00005 * Author: Eric Lecolinet 00006 * 00007 * Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs 00008 * 00009 * (C) 1999-2003 Eric Lecolinet @ ENST Paris 00010 * WWW: http://www.enst.fr/~elc/ubit Email: elc@enst.fr (subject: ubit) 00011 * 00012 * *********************************************************************** 00013 * COPYRIGHT NOTICE : 00014 * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 00015 * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 00016 * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 00017 * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 00018 * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION. 00019 * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS. 00020 * *********************************************************************** 00021 * 00022 * ==================================================== [Elc:03] ======= * 00023 * ==================================================== ======== ======= */ 00024 00025 #ifndef _upane_hpp_ 00026 #define _upane_hpp_ 00027 //pragma ident "@(#)upane.hpp ubit:03.06.03" 00028 #include <ubit/uborder.hpp> 00029 #include <ubit/uview.hpp> 00030 00031 /* ==================================================== [Elc:03] ======= */ 00032 /* ==================================================== ======== ======= */ 00056 class UPane: public UBox { 00057 public: 00058 static UStyle *style; 00059 00060 UPane(const UArgs& a = UArgs::none); 00062 00063 friend UPane& upane(const UArgs& a = UArgs::none); 00065 00066 virtual ~UPane(); 00067 00068 virtual const UStyle& getStyle(UContext*) const {return makeStyle();} 00069 static const UStyle& makeStyle(); 00070 00071 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00072 00073 float getXScroll(); 00074 float getYScroll(); 00076 00077 void setXScroll(float _xscroll); 00078 void setYScroll(float _yscroll); 00079 void setScroll(float xscroll, float yscroll); 00081 00082 void scrollImpl(float new_xscroll, float new_yscroll, 00083 bool upd_x, bool upd_y, bool update_pane); 00085 00086 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00087 00088 UBox *getViewport(); 00093 UView *getViewportView(UView *pane_view); 00099 class UScrollbar* getVScrollbar(); 00100 class UScrollbar* getHScrollbar(); 00102 00103 //void setVScrollbar(UScrollbar*, bool add_to_pane = true); 00104 //void setHScrollbar(UScrollbar*, bool add_to_pane = true); 00114 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00115 // implementation 00116 00117 #ifndef NO_DOC 00118 friend class UPaneView; 00119 00120 UBoxLink* getViewportLink(); 00121 void setVScrollbarImpl(class UScrollbar* vs) {vscrollbar = vs;} 00122 void setHScrollbarImpl(class UScrollbar* hs) {hscrollbar = hs;} 00123 00124 protected: 00125 class UScrollbar *hscrollbar, *vscrollbar; 00126 float xscroll, yscroll; 00127 00128 virtual void viewResized(UEvent&); 00129 #endif 00130 }; 00131 00132 /* ==================================================== [Elc:03] ======= */ 00133 /* ==================================================== ======== ======= */ 00134 00138 class UScrollpane: public UPane { 00139 public: 00140 UScrollpane(const UArgs& a = UArgs::none); 00144 UScrollpane(int v_scrollbar_mode, int h_scrollbar_mode, 00145 const UArgs& a = UArgs::none); 00151 friend UScrollpane& uscrollpane(const UArgs& a = UArgs::none); 00153 00154 friend UScrollpane& uscrollpane(int Vscrollbar_policy, int Hscrollbar_policy, 00155 const UArgs& a = UArgs::none); 00157 00158 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00159 // implementation 00160 00161 protected: 00162 void constructs(int vs_mode, int hs_mode, const UArgs&); 00163 }; 00164 00165 /* ==================================================== [Elc:03] ======= */ 00166 /* ==================================================== ======== ======= */ 00171 class UPaneView: public UView { 00172 public: 00173 static UViewStyle style; // renderer 00174 virtual UViewStyle* getViewStyle() {return &style;} 00175 00176 UPaneView(UBoxLink*, UView* parview, UWinGraph*); 00177 virtual ~UPaneView() {} 00178 00179 static UView* makeView(UBoxLink*, UView* parview, UWinGraph*); 00181 00182 UPane *getPane(); 00184 00185 u_dim getXScroll() {return xscroll;} 00186 u_dim getYScroll() {return yscroll;} 00187 00188 virtual void setXScroll(u_dim scr) {xscroll = scr;} 00189 virtual void setYScroll(u_dim scr) {yscroll = scr;} 00191 00192 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00193 // implementation 00194 00195 #ifndef NO_DOC 00196 friend class UPane; 00197 UMargins margins; 00198 u_dim xscroll, yscroll; 00199 #endif 00200 }; 00201 00202 #endif 00203 /* ==================================================== [TheEnd] ======= */ 00204 /* ==================================================== [Elc:03] ======= */ 00205

Generated on Wed Aug 18 07:38:55 2004 for Ubit[Eric.Lecolinet@enst.fr] by doxygen 1.3.7