Warning, file /include/root/TGTableLayout.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGTableLayout
0013 #define ROOT_TGTableLayout
0014
0015 #include "TGLayout.h"
0016
0017
0018 enum ETableLayoutHints {
0019 kLHintsShrinkX = BIT(8),
0020 kLHintsShrinkY = BIT(9),
0021 kLHintsFillX = BIT(10),
0022 kLHintsFillY = BIT(11)
0023 };
0024
0025
0026 class TGTableLayoutHints : public TGLayoutHints {
0027
0028 private:
0029 TGTableLayoutHints(const TGTableLayoutHints&) = delete;
0030 TGTableLayoutHints& operator=(const TGTableLayoutHints&) = delete;
0031
0032 protected:
0033 UInt_t fAttachLeft;
0034 UInt_t fAttachRight;
0035 UInt_t fAttachTop;
0036 UInt_t fAttachBottom;
0037
0038 public:
0039 TGTableLayoutHints(UInt_t attach_left, UInt_t attach_right,
0040 UInt_t attach_top, UInt_t attach_bottom,
0041 ULong_t hints = kLHintsNormal,
0042 UInt_t padleft = 0, UInt_t padright = 0,
0043 UInt_t padtop = 0, UInt_t padbottom = 0)
0044 : TGLayoutHints(hints,padleft,padright,padtop,padbottom),
0045 fAttachLeft(attach_left),
0046 fAttachRight(attach_right),
0047 fAttachTop(attach_top),
0048 fAttachBottom(attach_bottom) { }
0049 ~TGTableLayoutHints() override { }
0050
0051 UInt_t GetAttachLeft() const { return fAttachLeft; }
0052 UInt_t GetAttachRight() const { return fAttachRight; }
0053 UInt_t GetAttachTop() const { return fAttachTop; }
0054 UInt_t GetAttachBottom() const { return fAttachBottom; }
0055 void SavePrimitive(std::ostream &out, Option_t * = "") override;
0056
0057 ClassDefOverride(TGTableLayoutHints,0)
0058 };
0059
0060
0061 class TGTableLayout : public TGLayoutManager {
0062
0063 private:
0064 TGTableLayout(const TGTableLayout&) = delete;
0065 TGTableLayout& operator=(const TGTableLayout&) = delete;
0066
0067 protected:
0068 struct TableData_t {
0069 UInt_t fDefSize;
0070 UInt_t fRealSize;
0071 Bool_t fNeedExpand;
0072 Bool_t fNeedShrink;
0073 Bool_t fExpand;
0074 Bool_t fShrink;
0075 Bool_t fEmpty;
0076 };
0077 TableData_t *fRow;
0078 TableData_t *fCol;
0079 TGCompositeFrame *fMain;
0080 TList *fList;
0081 Bool_t fHomogeneous;
0082
0083 void FindRowColSizes();
0084 void FindRowColSizesInit();
0085 void FindRowColSizesHomogeneous();
0086 void FindRowColSizesSinglyAttached();
0087 void FindRowColSizesMultiplyAttached();
0088
0089 void SetRowColSizes();
0090 void SetRowColSizesInit();
0091
0092 void CheckSanity();
0093
0094 static void SetRowColResize(UInt_t real_size, UInt_t nthings,
0095 TableData_t *thing, Bool_t homogeneous);
0096
0097 public:
0098
0099 Int_t fSep;
0100 Int_t fHints;
0101 UInt_t fNrows;
0102 UInt_t fNcols;
0103
0104 TGTableLayout(TGCompositeFrame *main, UInt_t nrows, UInt_t ncols,
0105 Bool_t homogeneous = kFALSE, Int_t sep = 0, Int_t hints = 0);
0106 ~TGTableLayout() override;
0107
0108 void Layout() override;
0109 TGDimension GetDefaultSize() const override;
0110 void SavePrimitive(std::ostream &out, Option_t * = "") override;
0111
0112 ClassDefOverride(TGTableLayout,0)
0113 };
0114
0115 #endif