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

utable.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  utable.hh
00004  *  Ubit Project [Elc::003]
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 _utable_hh
00026 #define _utable_hh
00027 //pragma ident  "@(#)utable.hh  ubit:03.06.00"
00028 #include <ubit/ubox.hpp>
00029 
00030 
00035 class UTable: public UBox {
00036 public:
00037   static UStyle *style;
00038 
00039   UTable(const UArgs& a = UArgs::none);
00040   friend UTable& utable(const UArgs& a = UArgs::none);
00041 
00042   virtual const UStyle& getStyle(UContext*) const {return makeStyle();}
00043   static  const UStyle& makeStyle();
00044 };
00045 
00046 
00051 class UTrow: public UGroup {
00052 public:
00053   static UStyle *style;
00054 
00055   UTrow(const UArgs& a = UArgs::none);
00056   friend UTrow& utrow(const UArgs& a = UArgs::none);
00057 
00058   virtual const UStyle& getStyle(UContext*) const {return makeStyle();}
00059   static  const UStyle& makeStyle();
00060 };
00061 
00062 
00067 class UTcell: public UFlowbox {
00068   short colspan, rowspan;
00069 public:
00070   static UStyle *style;
00071 
00072   UTcell(const UArgs& a = UArgs::none);
00073   UTcell(short colspan, const UArgs& a = UArgs::none);
00074   UTcell(short colspan, short rowspan, const UArgs& a = UArgs::none);
00075 
00076   friend UTcell& utcell(const UArgs& a = UArgs::none);
00077   friend UTcell& utcell(short colspan, const UArgs& a = UArgs::none);
00078   friend UTcell& utcell(short colspan, short rowspan, const UArgs& a = UArgs::none);
00079 
00080   virtual const UStyle& getStyle(UContext*) const {return makeStyle();}
00081   static  const UStyle& makeStyle();
00082 
00083   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00084 
00085   void  setColspan(short);
00086   void  setRowspan(short);
00087 
00088   short getColspan() {return colspan;}
00089   short getRowspan() {return rowspan;}
00090 };
00091 
00092 /* ==================================================== [Elc:02] ======= */
00093 /* ==================================================== ======== ======= */
00094 
00098 class UTableView: public UView {
00099 public:
00100   static  UViewStyle style;  // renderer
00101   virtual UViewStyle* getViewStyle() {return &style;}
00102 
00103   // "static" constructor used by UViewStyle to make a new view
00104   static UView* makeView(UBoxLink*, UView* parview, UWinGraph*);
00105 
00106   UTableView(UBoxLink*, UView* parview, UWinGraph*);
00107   virtual ~UTableView();
00108 
00109 #ifndef NO_DOC
00110   class UViewCell *cols, *lines;
00111   int lcur, ccur, ccount, cmax, lcount, lmax; 
00112   virtual bool doLayout(UContext&, class UViewLayout &vl);
00113 #endif
00114 };
00115 
00116 struct UViewCell {
00117   u_dim min_dim, max_dim, spec_dim;
00118   int rowspan, colspan;
00119   static UViewCell* augment(UViewCell *tab, int *count, int span);
00120 };
00121 
00122 #endif
00123 /* ==================================================== [TheEnd] ======= */
00124 /* ==================================================== [Elc:02] ======= */
00125 

Generated on Thu May 19 12:40:17 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.2