00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#ifndef _utable_hh
00026
#define _utable_hh
00027
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
00093
00094
00098 class UTableView:
public UView {
00099
public:
00100
static UViewStyle style;
00101 virtual UViewStyle*
getViewStyle() {
return &style;}
00102
00103
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
00124
00125