Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Brett Viren 04/15/2001
5 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT_TGTableLayout
13#define ROOT_TGTableLayout
15#include "TGLayout.h"
17// extension of ELayoutHints
22 kLHintsFillY = BIT(11)
33 UInt_t fAttachLeft; ///< Column/row division number on which
34 UInt_t fAttachRight; ///< to attach the frame. Starts at 0
35 UInt_t fAttachTop; ///< and goes to # columns / # rows
36 UInt_t fAttachBottom; ///< respectively
39 TGTableLayoutHints(UInt_t attach_left, UInt_t attach_right,
40 UInt_t attach_top, UInt_t attach_bottom,
41 ULong_t hints = kLHintsNormal,
42 UInt_t padleft = 0, UInt_t padright = 0,
43 UInt_t padtop = 0, UInt_t padbottom = 0)
44 : TGLayoutHints(hints,padleft,padright,padtop,padbottom),
45 fAttachLeft(attach_left),
46 fAttachRight(attach_right),
47 fAttachTop(attach_top),
48 fAttachBottom(attach_bottom) { }
49 virtual ~TGTableLayoutHints() { }
51 UInt_t GetAttachLeft() const { return fAttachLeft; }
53 UInt_t GetAttachTop() const { return fAttachTop; }
55 void SavePrimitive(std::ostream &out, Option_t * = "") override;
57 ClassDefOverride(TGTableLayoutHints,0) // Class describing GUI table layout hints
64 TGTableLayout(const TGTableLayout&) = delete;
68 struct TableData_t {
69 UInt_t fDefSize; ///< Default size of col/rows
70 UInt_t fRealSize; ///< Real size of col/rows (eg, if table resize)
76 };
77 TableData_t *fRow; ///< info about each row
78 TableData_t *fCol; ///< info about each column
79 TGCompositeFrame *fMain; ///< container frame
80 TList *fList; ///< list of frames to arrange
81 Bool_t fHomogeneous; ///< all cols/rows same size
83 void FindRowColSizes();
89 void SetRowColSizes();
90 void SetRowColSizesInit();
92 void CheckSanity();
94 static void SetRowColResize(UInt_t real_size, UInt_t nthings,
95 TableData_t *thing, Bool_t homogeneous);
98 // these are public in TGMatrixLayout ??? Perpetuate it.
99 Int_t fSep; ///< interval between frames
100 Int_t fHints; ///< layout hints (currently not used)
101 UInt_t fNrows; ///< number of rows
102 UInt_t fNcols; ///< number of columns
105 Bool_t homogeneous = kFALSE, Int_t sep = 0, Int_t hints = 0);
106 virtual ~TGTableLayout();
108 void Layout() override;
109 TGDimension GetDefaultSize() const override; // return sum of all child sizes
110 void SavePrimitive(std::ostream &out, Option_t * = "") override;
112 ClassDefOverride(TGTableLayout,0) // Table layout manager
const Bool_t kFALSE
Definition: RtypesCore.h:101
unsigned long ULong_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:66
#define BIT(n)
Definition: Rtypes.h:85
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
@ kLHintsNormal
Definition: TGLayout.h:32
Definition: TGTableLayout.h:18
@ kLHintsFillX
Definition: TGTableLayout.h:21
@ kLHintsShrinkX
Definition: TGTableLayout.h:19
@ kLHintsShrinkY
Definition: TGTableLayout.h:20
@ kLHintsFillY
Definition: TGTableLayout.h:22
int main(int argc, char *argv[])
Definition: cef_main.cxx:54
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
Frame layout manager.
Definition: TGLayout.h:135
This class describes layout hints used by the TGTableLayout class.
Definition: TGTableLayout.h:26
TGTableLayoutHints(const TGTableLayoutHints &)=delete
TGTableLayoutHints & operator=(const TGTableLayoutHints &)=delete
UInt_t fAttachBottom
Definition: TGTableLayout.h:36
virtual ~TGTableLayoutHints()
Definition: TGTableLayout.h:49
UInt_t fAttachLeft
Column/row division number on which.
Definition: TGTableLayout.h:33
void SavePrimitive(std::ostream &out, Option_t *="") override
Save layout hints as a C++ statement(s) on output stream out.
UInt_t GetAttachLeft() const
Definition: TGTableLayout.h:51
UInt_t GetAttachTop() const
Definition: TGTableLayout.h:53
UInt_t GetAttachBottom() const
Definition: TGTableLayout.h:54
UInt_t GetAttachRight() const
Definition: TGTableLayout.h:52
TGTableLayoutHints(UInt_t attach_left, UInt_t attach_right, UInt_t attach_top, UInt_t attach_bottom, ULong_t hints=kLHintsNormal, UInt_t padleft=0, UInt_t padright=0, UInt_t padtop=0, UInt_t padbottom=0)
Definition: TGTableLayout.h:39
UInt_t fAttachRight
to attach the frame. Starts at 0
Definition: TGTableLayout.h:34
UInt_t fAttachTop
and goes to # columns / # rows
Definition: TGTableLayout.h:35
A layout manager, which places child frames in a table arranged in rows and columns,...
Definition: TGTableLayout.h:61
Bool_t fHomogeneous
all cols/rows same size
Definition: TGTableLayout.h:81
void FindRowColSizesMultiplyAttached()
Checks any children which span multiple col/rows.
void FindRowColSizesHomogeneous()
If the table is homogeneous make sure all col/rows are same size as biggest col/row.
void SetRowColSizes()
This gets the new sizes needed to fit the table to the parent frame.
TableData_t * fRow
info about each row
Definition: TGTableLayout.h:77
void Layout() override
Make a table layout of all frames in the list.
Int_t fHints
layout hints (currently not used)
static void SetRowColResize(UInt_t real_size, UInt_t nthings, TableData_t *thing, Bool_t homogeneous)
If main frame is bigger or smaller than all children, expand/shrink to fill.
void FindRowColSizesSinglyAttached()
Determine the size of rows/cols needed for singly attached children.
UInt_t fNcols
number of columns
void FindRowColSizesInit()
Initialize values needed to determine the size of rows and columns.
Int_t fSep
interval between frames
Definition: TGTableLayout.h:99
void CheckSanity()
Sanity check various values.
UInt_t fNrows
number of rows
TGTableLayout & operator=(const TGTableLayout &)=delete
TableData_t * fCol
info about each column
Definition: TGTableLayout.h:78
TList * fList
list of frames to arrange
Definition: TGTableLayout.h:80
void SavePrimitive(std::ostream &out, Option_t *="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGCompositeFrame * fMain
container frame
Definition: TGTableLayout.h:79
TGTableLayout(const TGTableLayout &)=delete
TGDimension GetDefaultSize() const override
Return default dimension of the table layout.
void FindRowColSizes()
Find the sizes of rows and columns needed to satisfy children's layout policies.
void SetRowColSizesInit()
Initialize rows/cols.
virtual ~TGTableLayout()
TGTableLayout constructor.
A doubly linked list.
Definition: TList.h:38
UInt_t fDefSize
Default size of col/rows.
Definition: TGTableLayout.h:69
UInt_t fRealSize
Real size of col/rows (eg, if table resize)
Definition: TGTableLayout.h:70