78 if (f) f->SetFrameElement(
this);
110 std::cout << std::endl;
156 std::cout <<
"kLHintsLeft";
160 if (bor) std::cout <<
" | ";
161 std::cout <<
"kLHintsCenterX";
165 if (bor) std::cout <<
" | ";
166 std::cout <<
"kLHintsRight";
170 if (bor) std::cout <<
" | ";
171 std::cout <<
"kLHintsTop";
175 if (bor) std::cout <<
" | ";
176 std::cout <<
"kLHintsCenterY";
180 if (bor) std::cout <<
" | ";
181 std::cout <<
"kLHintsBottom";
185 if (bor) std::cout <<
" | ";
186 std::cout <<
"kLHintsExpandX";
190 if (bor) std::cout <<
" | ";
191 std::cout <<
"kLHintsExpandY";
195 if (bor) std::cout <<
" | ";
196 std::cout <<
"kLHintsNoHints";
198 std::cout <<
", fPadtop=" <<
fPadtop;
200 std::cout <<
", fPadleft=" <<
fPadleft;
201 std::cout <<
", fPadright=" <<
fPadright;
202 std::cout << std::endl;
211 fList = fMain->GetList();
229 Int_t bw = fMain->GetBorderWidth();
232 UInt_t pad_left, pad_top, pad_right, pad_bottom;
233 Int_t size_expand=0, esize_expand=0, rem_expand=0, tmp_expand = 0;
239 bottom = msize.
fHeight - (top = bw);
240 remain = msize.
fHeight - (bw << 1);
252 if (hints & kLHintsExpandY) exp_max = 0;
255 remain -= size.fHeight;
263 size_expand = remain/nb_expand;
265 if (size_expand < exp_max)
266 esize_expand = (remain -
exp)/nb_expand;
267 rem_expand = remain % nb_expand;
289 size.fWidth = msize.
fWidth - (bw << 1) - pad_left - pad_right;
292 size.fWidth = csize.
fWidth;
296 if (size_expand >= exp_max)
297 size.fHeight = size_expand - pad_top - pad_bottom;
299 size.fHeight = csize.
fHeight + esize_expand;
301 tmp_expand += rem_expand;
302 if (tmp_expand >= nb_expand) {
304 tmp_expand -= nb_expand;
309 if (size_expand >= exp_max) {
310 extra_space = (size_expand - pad_top - pad_bottom - size.fHeight) >> 1;
312 extra_space = esize_expand >> 1;
320 y = bottom - size.fHeight - pad_bottom;
321 bottom -= size.fHeight + pad_top + pad_bottom;
324 top += size.fHeight + pad_top + pad_bottom;
330 if (x > 32768) x = bw + 1;
332 if (size.fWidth > 32768)
334 if (size.fHeight > 32768)
338 fModified = fModified || (ptr->
fFrame->
GetX() !=
x) ||
352 TGDimension size(0,0), msize = fMain->GetSize(), csize;
353 UInt_t options = fMain->GetOptions();
369 size.fWidth += fMain->GetBorderWidth() << 1;
370 size.fHeight += fMain->GetBorderWidth() << 1;
372 if (options & kFixedWidth) size.fWidth = msize.
fWidth;
373 if (options & kFixedHeight) size.fHeight = msize.
fHeight;
393 Int_t bw = fMain->GetBorderWidth();
396 UInt_t pad_left, pad_top, pad_right, pad_bottom;
397 Int_t size_expand=0, esize_expand=0, rem_expand=0, tmp_expand = 0;
402 right = msize.
fWidth - (left = bw);
403 remain = msize.
fWidth - (bw << 1);
415 if (hints & kLHintsExpandX) exp_max = 0;
425 size_expand = remain/nb_expand;
427 if (size_expand < exp_max) {
428 esize_expand = (remain -
exp)/nb_expand;
430 rem_expand = remain % nb_expand;
459 if (size_expand >= exp_max)
460 size.
fWidth = size_expand - pad_left - pad_right;
464 tmp_expand += rem_expand;
466 if (tmp_expand >= nb_expand) {
468 tmp_expand -= nb_expand;
473 if (size_expand >= exp_max) {
474 extra_space = (size_expand - pad_left - pad_right - size.
fWidth)>> 1;
476 extra_space = esize_expand >> 1;
484 x = right - size.
fWidth - pad_right;
485 right -= size.
fWidth + pad_left + pad_right;
488 left += size.
fWidth + pad_left + pad_right;
496 fModified = fModified || (ptr->
fFrame->
GetX() !=
x) ||
510 TGDimension size(0,0), msize = fMain->GetSize(), csize;
511 UInt_t options = fMain->GetOptions();
527 size.fWidth += fMain->GetBorderWidth() << 1;
528 size.fHeight += fMain->GetBorderWidth() << 1;
530 if (options & kFixedWidth) size.fWidth = msize.
fWidth;
531 if (options & kFixedHeight) size.fHeight = msize.
fHeight;
543 Int_t bw = fMain->GetBorderWidth();
553 fModified = fModified || (ptr->
fFrame->
GetX() !=
x) ||
568 TGDimension size(0,0), dsize, msize = fMain->GetSize();
569 UInt_t options = fMain->GetOptions();
579 size.fWidth += dsize.
fWidth + fSep;
583 size.fHeight += fMain->GetBorderWidth() << 1;
584 size.fWidth += fMain->GetBorderWidth() << 1;
587 if (options & kFixedHeight) size.fHeight = msize.
fHeight;
588 if (options & kFixedWidth) size.fWidth = msize.
fWidth;
600 Int_t bw = fMain->GetBorderWidth();
609 fModified = fModified || (ptr->
fFrame->
GetX() !=
x) ||
623 TGDimension size(0,0), dsize, msize = fMain->GetSize();
624 UInt_t options = fMain->GetOptions();
638 size.fHeight += fMain->GetBorderWidth() << 1;
639 size.fHeight -= fSep;
640 size.fWidth += fMain->GetBorderWidth() << 1;
643 if (options & kFixedWidth) size.fWidth = msize.
fWidth;
655 fList = fMain->GetList();
669 Int_t bw = fMain->GetBorderWidth();
671 UInt_t rowcount = fRows, colcount = fColumns;
684 fModified = fModified || (ptr->
fFrame->
GetX() !=
x) ||
694 y = fSep + bw; x += maxsize.
fWidth + fSep;
696 }
else if (fRows == 0) {
697 x += maxsize.
fWidth + fSep;
701 x = fSep; y += maxsize.
fHeight + fSep;
704 x += maxsize.
fWidth + fSep;
708 if (rowcount <= 0)
return;
711 x = fSep; y += maxsize.
fHeight + fSep;
726 Int_t bw = fMain->GetBorderWidth();
737 Int_t rows = (count % fColumns) ? (count / fColumns + 1) : (count / fColumns);
738 size.
fWidth = fColumns * (maxsize.
fWidth + fSep) + fSep;
740 }
else if (fColumns == 0) {
741 Int_t cols = (count % fRows) ? (count / fRows + 1) : (count / fRows);
745 size.
fWidth = fColumns * (maxsize.
fWidth + fSep) + fSep;
758 fList = fMain->GetList();
771 TGDimension csize, max_osize(0,0), msize = fMain->GetSize();
782 x = fSep; y = fSep << 1;
790 xw = x + (
Int_t)((max_osize.fWidth - csize.
fWidth) >> 1);
797 yw = y + (
Int_t)((max_osize.fHeight - csize.
fHeight) >> 1);
803 fModified = fModified || (ptr->
fFrame->
GetX() != xw) ||
808 x += (
Int_t)max_osize.fWidth + fSep;
810 if (x + max_osize.fWidth > max_width) {
812 y += (
Int_t)max_osize.fHeight + fSep + (fSep >> 1);
824 TGDimension max_size, max_osize(0,0), msize = fMain->GetSize();
835 x = fSep; y = fSep << 1;
840 x += max_osize.fWidth + fSep;
841 if (x + max_osize.fWidth > max_size.
fWidth) {
843 y += (
Int_t)max_osize.fHeight + fSep + (fSep >> 1);
846 if (x != fSep) y += max_osize.fHeight + fSep;
861 TGDimension csize, max_osize(0,0), msize = fMain->GetSize();
874 x = fSep; y = fSep << 1;
883 xw = x + (
Int_t)((max_osize.fWidth - csize.
fWidth) >> 1);
890 yw = y + (
Int_t)((max_osize.fHeight - csize.
fHeight) >> 1);
896 fModified = fModified || (ptr->
fFrame->
GetX() != xw) ||
901 y += (
Int_t)max_osize.fHeight + fSep + (fSep >> 1);
903 if (y + max_osize.fHeight > max_height) {
905 x += (
Int_t)max_osize.fWidth + fSep;
917 TGDimension max_size, max_osize(0,0), msize = fMain->GetSize();
928 x = fSep; y = fSep << 1;
932 y += (
Int_t)max_osize.fHeight + fSep + (fSep >> 1);
933 if (y + max_osize.fHeight > max_size.
fHeight) {
935 x += (
Int_t)max_osize.fWidth + fSep;
938 if (y != (fSep << 1)) x += (
Int_t)max_osize.fWidth + fSep;
951 Int_t max_oh = 0,
x = fSep,
y = fSep << 1;
966 fModified = fModified || (ptr->
fFrame->
GetX() !=
x) ||
971 y += max_oh + fSep + (fSep >> 1);
995 y += max_osize.
fHeight + fSep + (fSep >> 1);
1013 if ((option == 0) || strcmp(option,
"nocoma"))
1017 out <<
"new TGLayoutHints(kLHintsNormal)";
1021 if (hints.
Length() == 0) hints =
"kLHintsLeft";
1022 else hints +=
" | kLHintsLeft";
1025 if (hints.
Length() == 0) hints =
"kLHintsCenterX";
1026 else hints +=
" | kLHintsCenterX";
1029 if (hints.
Length() == 0) hints =
"kLHintsRight";
1030 else hints +=
" | kLHintsRight";
1033 if (hints.
Length() == 0) hints =
"kLHintsTop";
1034 else hints +=
" | kLHintsTop";
1037 if (hints.
Length() == 0) hints =
"kLHintsCenterY";
1038 else hints +=
" | kLHintsCenterY";
1041 if (hints.
Length() == 0) hints =
"kLHintsBottom";
1042 else hints +=
" | kLHintsBottom";
1045 if (hints.
Length() == 0) hints =
"kLHintsExpandX";
1046 else hints +=
" | kLHintsExpandX";
1049 if (hints.
Length() == 0) hints =
"kLHintsExpandY";
1050 else hints +=
" | kLHintsExpandY";
1053 out <<
"new TGLayoutHints(" << hints;
1068 out <<
"new TGVerticalLayout(" << fMain->GetName() <<
")";
1078 out <<
"new TGHorizontalLayout(" << fMain->GetName() <<
")";
1087 out <<
"new TGRowLayout(" << fMain->GetName() <<
"," 1097 out <<
"new TGColumnLayout(" << fMain->GetName() <<
"," 1108 out <<
"new TGMatrixLayout(" << fMain->GetName() <<
"," 1122 out <<
"new TGTileLayout(" << fMain->GetName() <<
"," 1133 out <<
"new TGListLayout(" << fMain->GetName() <<
"," 1144 out <<
"new TGListDetailsLayout(" << fMain->GetName() <<
"," 1145 << fSep <<
"," << fWidth <<
")";
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual TGDimension GetDefaultSize() const
Return default dimension of the list layout.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
ULong_t GetLayoutHints() const
Definitions for TRefCnt, base class for reference counted objects.
TGMatrixLayout(const TGMatrixLayout &)
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TGDimension GetDefaultSize() const
Return default dimension of the tile layout.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
virtual TGDimension GetDefaultSize() const
Return default dimension of the row layout.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void Layout()
Make a vertical layout of all frames in the list.
TGVerticalLayout(const TGVerticalLayout &gvl)
virtual void Layout()
Make a horizontal layout of all frames in the list.
virtual void Layout()
Make a row layout of all frames in the list.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TGDimension GetDefaultSize() const
Return default dimension of the vertical layout.
virtual void Layout()
Make a column layout of all frames in the list.
virtual void Layout()
Make a tile layout of all frames in the list.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
void SetRefCount(UInt_t r)
void Print(Option_t *option="") const
Printing.
TGLayoutHints(ULong_t hints=kLHintsNormal, Int_t padleft=0, Int_t padright=0, Int_t padtop=0, Int_t padbottom=0)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
void UpdateFrameElements(TGLayoutHints *l)
Update layout hints of frame elements.
virtual TGDimension GetDefaultSize() const
Return default dimension of the horizontal layout.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TGDimension GetDefaultSize() const
Return default dimension of the list details layout.
virtual void Move(Int_t x, Int_t y)
Move frame.
virtual UInt_t GetDefaultHeight() const
virtual TGDimension GetDefaultSize() const
Return default dimension of the matrix layout.
virtual void Layout()
Make a tile layout of all frames in the list.
Int_t GetPadRight() const
virtual ~TGLayoutHints()
Destructor.
TGTileLayout(const TGTileLayout &)
Mother of all ROOT objects.
~TGFrameElement()
Destructor. Decrease ref. count of fLayout.
void Print(Option_t *option="") const
Print this frame element.
virtual void Layout()
Make a matrix layout of all frames in the list.
virtual TGDimension GetDefaultSize() const
Return default dimension of the column layout.
Short_t Max(Short_t a, Short_t b)
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a primitive as a C++ statement(s) on output stream "out".
int main(int argc, char **argv)
if(line.BeginsWith("/*"))
Int_t GetPadBottom() const
virtual void Layout()
Make a list details layout of all frames in the list.