00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGTableLayout
00013 #define ROOT_TGTableLayout
00014
00015 #ifndef ROOT_TGLayout
00016 #include "TGLayout.h"
00017 #endif
00018
00019
00020
00021 enum ETableLayoutHints {
00022 kLHintsShrinkX = BIT(8),
00023 kLHintsShrinkY = BIT(9),
00024 kLHintsFillX = BIT(10),
00025 kLHintsFillY = BIT(11)
00026 };
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class TGTableLayoutHints : public TGLayoutHints {
00038
00039 private:
00040 TGTableLayoutHints(const TGTableLayoutHints&);
00041 TGTableLayoutHints& operator=(const TGTableLayoutHints&);
00042
00043 protected:
00044 UInt_t fAttachLeft;
00045 UInt_t fAttachRight;
00046 UInt_t fAttachTop;
00047 UInt_t fAttachBottom;
00048
00049 public:
00050 TGTableLayoutHints(UInt_t attach_left, UInt_t attach_right,
00051 UInt_t attach_top, UInt_t attach_bottom,
00052 ULong_t hints = kLHintsNormal,
00053 UInt_t padleft = 0, UInt_t padright = 0,
00054 UInt_t padtop = 0, UInt_t padbottom = 0)
00055 : TGLayoutHints(hints,padleft,padright,padtop,padbottom),
00056 fAttachLeft(attach_left),
00057 fAttachRight(attach_right),
00058 fAttachTop(attach_top),
00059 fAttachBottom(attach_bottom) { }
00060 virtual ~TGTableLayoutHints() { }
00061
00062 UInt_t GetAttachLeft() const { return fAttachLeft; }
00063 UInt_t GetAttachRight() const { return fAttachRight; }
00064 UInt_t GetAttachTop() const { return fAttachTop; }
00065 UInt_t GetAttachBottom() const { return fAttachBottom; }
00066 virtual void SavePrimitive(ostream &out, Option_t * = "");
00067
00068 ClassDef(TGTableLayoutHints,0)
00069 };
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 class TGTableLayout : public TGLayoutManager {
00088
00089 private:
00090 TGTableLayout(const TGTableLayout&);
00091 TGTableLayout& operator=(const TGTableLayout&);
00092
00093 protected:
00094 struct TableData_t {
00095 UInt_t fDefSize;
00096 UInt_t fRealSize;
00097 Bool_t fNeedExpand;
00098 Bool_t fNeedShrink;
00099 Bool_t fExpand;
00100 Bool_t fShrink;
00101 Bool_t fEmpty;
00102 };
00103 TableData_t *fRow;
00104 TableData_t *fCol;
00105 TGCompositeFrame *fMain;
00106 TList *fList;
00107 Bool_t fHomogeneous;
00108
00109 void FindRowColSizes();
00110 void FindRowColSizesInit();
00111 void FindRowColSizesHomogeneous();
00112 void FindRowColSizesSinglyAttached();
00113 void FindRowColSizesMultiplyAttached();
00114
00115 void SetRowColSizes();
00116 void SetRowColSizesInit();
00117
00118 void CheckSanity();
00119
00120 static void SetRowColResize(UInt_t real_size, UInt_t nthings,
00121 TableData_t *thing, Bool_t homogeneous);
00122
00123 public:
00124
00125 Int_t fSep;
00126 Int_t fHints;
00127 UInt_t fNrows;
00128 UInt_t fNcols;
00129
00130 TGTableLayout(TGCompositeFrame *main, UInt_t nrows, UInt_t ncols,
00131 Bool_t homogeneous = kFALSE, Int_t sep = 0, Int_t hints = 0);
00132 virtual ~TGTableLayout();
00133
00134 virtual void Layout();
00135 virtual TGDimension GetDefaultSize() const;
00136 virtual void SavePrimitive(ostream &out, Option_t * = "");
00137
00138 ClassDef(TGTableLayout,0)
00139 };
00140
00141 #endif