utable.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  utable.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 _utable_hpp_
00021 #define _utable_hpp_
00022 //pragma ident  "@(#)utable.hpp ubit:05.05.00"
00023 #include <ubit/ubox.hpp>
00024 #include <ubit/uboxes.hpp>
00025 namespace ubit {
00026 
00027 /* ==================================================== ===== ======= */
00031 class UTable: public UBox {
00032 public:
00033   UBIT_ELEMENT_CLASS(UTable, UBox)
00034 
00035   UTable(const UArgs& a = UArgs::none);
00036   friend UTable& utable(const UArgs& a = UArgs::none);
00037 
00038   static UStyle* createStyle();
00039 };
00040 
00041 /* ==================================================== ===== ======= */
00046 class UTrow: public UGroup {
00047 public:
00048   UBIT_ELEMENT_CLASS(UTrow, UGroup)
00049 
00050   UTrow(const UArgs& a = UArgs::none);
00051   friend UTrow& utrow(const UArgs& a = UArgs::none);
00052 
00053   static  UStyle* createStyle();
00054 };
00055 
00056 /* ==================================================== [Elc] ======= */
00057 /* ==================================================== ===== ======= */
00062 class UTcell: public UFlowbox {
00063 public:
00064   UBIT_ELEMENT_CLASS(UTcell, UFlowbox)
00065 
00066   UTcell(const UArgs& a = UArgs::none);
00067   UTcell(short colspan, const UArgs& a = UArgs::none);
00068   UTcell(short colspan, short rowspan, const UArgs& a = UArgs::none);
00069 
00070   friend UTcell& utcell(const UArgs& a = UArgs::none);
00071   friend UTcell& utcell(short colspan, const UArgs& a = UArgs::none);
00072   friend UTcell& utcell(short colspan, short rowspan, const UArgs& a = UArgs::none);
00073   
00074   static UStyle* createStyle();
00075 
00076   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00077   
00078   void  setColspan(short);
00079   void  setRowspan(short);
00080   short getColspan() {return colspan;}
00081   short getRowspan() {return rowspan;}
00082   
00083 private:
00084   short colspan, rowspan;
00085 };
00086 
00087 /* ==================================================== ===== ======= */
00091 class UTableView: public UView {
00092 public:
00093   static UViewStyle style;  // renderer
00094   virtual UViewStyle* getViewStyle() {return &style;}
00095 
00096   UTableView(UChild*, UView* parview, UHardWinImpl*);
00097   virtual ~UTableView();
00098 
00099   static UView* createView(UChild*, UView* parview, UHardWinImpl*);
00100   virtual class UTableView* tableCast() {return this;}
00101     
00102 #ifndef NO_DOC
00103   struct UViewCell *cols, *lines;
00104   int lcur, ccur, ccount, cmax, lcount, lmax; 
00105   virtual bool doLayout(UContext&, class UViewLayout &vl);
00106 #endif
00107 };
00108 
00109 struct UViewCell {
00110   int d, min_d, max_d, spec_d;
00111   int rowspan, colspan;
00112 };
00113 }
00114 #endif
00115 /* ==================================================== [TheEnd] ======= */
00116 /* ==================================================== [(c)Elc] ======= */
00117 

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