00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _utable_hpp_
00021 #define _utable_hpp_
00022
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
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;
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
00116
00117