59 ClassImp(TGLayoutHints);
60 ClassImp(TGLayoutManager);
61 ClassImp(TGVerticalLayout);
62 ClassImp(TGHorizontalLayout);
63 ClassImp(TGRowLayout);
64 ClassImp(TGColumnLayout);
65 ClassImp(TGMatrixLayout);
66 ClassImp(TGTileLayout);
67 ClassImp(TGListLayout);
68 ClassImp(TGListDetailsLayout);
74 TGFrameElement::TGFrameElement(TGFrame *f, TGLayoutHints *l)
78 if (f) f->SetFrameElement(
this);
92 TGFrameElement::~TGFrameElement()
99 void TGFrameElement::Print(Option_t *option)
const
101 TObject::Print(option);
105 std::cout << fFrame->ClassName() <<
"::" << fFrame->GetName();
108 fLayout->Print(option);
110 std::cout << std::endl;
116 TGLayoutHints::TGLayoutHints(
const TGLayoutHints &lh) : TObject(lh), TRefCnt(lh)
118 fPadleft = lh.fPadleft; fPadright = lh.fPadright;
119 fPadtop = lh.fPadtop; fPadbottom = lh.fPadbottom;
120 fLayoutHints = lh.fLayoutHints;
122 fFE = lh.fFE; fPrev = lh.fPrev;
128 TGLayoutHints::~TGLayoutHints()
135 void TGLayoutHints::UpdateFrameElements(TGLayoutHints *l)
137 if (fFE) fFE->fLayout = l;
140 TGFrameElement *p = fPrev;
142 while (p && p->fLayout) {
144 p = p->fLayout->fPrev;
151 void TGLayoutHints::Print(Option_t *)
const
155 if (fLayoutHints & kLHintsLeft) {
156 std::cout <<
"kLHintsLeft";
159 if (fLayoutHints & kLHintsCenterX) {
160 if (bor) std::cout <<
" | ";
161 std::cout <<
"kLHintsCenterX";
164 if (fLayoutHints & kLHintsRight) {
165 if (bor) std::cout <<
" | ";
166 std::cout <<
"kLHintsRight";
169 if (fLayoutHints & kLHintsTop) {
170 if (bor) std::cout <<
" | ";
171 std::cout <<
"kLHintsTop";
174 if (fLayoutHints & kLHintsCenterY) {
175 if (bor) std::cout <<
" | ";
176 std::cout <<
"kLHintsCenterY";
179 if (fLayoutHints & kLHintsBottom) {
180 if (bor) std::cout <<
" | ";
181 std::cout <<
"kLHintsBottom";
184 if (fLayoutHints & kLHintsExpandX) {
185 if (bor) std::cout <<
" | ";
186 std::cout <<
"kLHintsExpandX";
189 if (fLayoutHints & kLHintsExpandY) {
190 if (bor) std::cout <<
" | ";
191 std::cout <<
"kLHintsExpandY";
194 if (fLayoutHints == kLHintsNoHints) {
195 if (bor) std::cout <<
" | ";
196 std::cout <<
"kLHintsNoHints";
198 std::cout <<
", fPadtop=" << fPadtop;
199 std::cout <<
", fPadbottom=" << fPadbottom;
200 std::cout <<
", fPadleft=" << fPadleft;
201 std::cout <<
", fPadright=" << fPadright;
202 std::cout << std::endl;
208 TGVerticalLayout::TGVerticalLayout(TGCompositeFrame *main)
211 fList = fMain->GetList();
217 void TGVerticalLayout::Layout()
220 TGLayoutHints *layout;
224 UInt_t extra_space = 0;
229 Int_t bw = fMain->GetBorderWidth();
230 TGDimension size(0,0), csize(0,0);
231 TGDimension msize = fMain->GetSize();
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);
243 while ((ptr = (TGFrameElement *) next())) {
244 if (ptr->fState & kIsVisible) {
245 layout = ptr->fLayout;
246 size = ptr->fFrame->GetDefaultSize();
247 size.fHeight += layout->GetPadTop() + layout->GetPadBottom();
248 hints = layout->GetLayoutHints();
249 if ((hints & kLHintsExpandY) || (hints & kLHintsCenterY)) {
252 if (hints & kLHintsExpandY) exp_max = 0;
253 else exp_max = TMath::Max(exp_max, (Int_t)size.fHeight);
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;
271 while ((ptr = (TGFrameElement *) next())) {
272 if (ptr->fState & kIsVisible) {
273 hints = (layout = ptr->fLayout)->GetLayoutHints();
274 csize = ptr->fFrame->GetDefaultSize();
275 pad_left = layout->GetPadLeft();
276 pad_top = layout->GetPadTop();
277 pad_right = layout->GetPadRight();
278 pad_bottom = layout->GetPadBottom();
280 if (hints & kLHintsRight) {
281 x = msize.fWidth - bw - csize.fWidth - pad_right;
282 }
else if (hints & kLHintsCenterX) {
283 x = (msize.fWidth - (bw << 1) - csize.fWidth) >> 1;
288 if (hints & kLHintsExpandX) {
289 size.fWidth = msize.fWidth - (bw << 1) - pad_left - pad_right;
292 size.fWidth = csize.fWidth;
295 if (hints & kLHintsExpandY) {
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;
307 size.fHeight = csize.fHeight;
308 if (hints & kLHintsCenterY) {
309 if (size_expand >= exp_max) {
310 extra_space = (size_expand - pad_top - pad_bottom - size.fHeight) >> 1;
312 extra_space = esize_expand >> 1;
319 if (hints & kLHintsBottom) {
320 y = bottom - size.fHeight - pad_bottom;
321 bottom -= size.fHeight + pad_top + pad_bottom;
324 top += size.fHeight + pad_top + pad_bottom;
327 if (hints & kLHintsCenterY)
330 if (x > 32768) x = bw + 1;
332 if (size.fWidth > 32768)
334 if (size.fHeight > 32768)
336 ptr->fFrame->MoveResize(x, y, size.fWidth, size.fHeight);
338 fModified = fModified || (ptr->fFrame->GetX() != x) ||
339 (ptr->fFrame->GetY() != y) ||
340 (ptr->fFrame->GetWidth() != size.fWidth) ||
341 (ptr->fFrame->GetHeight() != size.fHeight);
349 TGDimension TGVerticalLayout::GetDefaultSize()
const
352 TGDimension size(0,0), msize = fMain->GetSize(), csize;
353 UInt_t options = fMain->GetOptions();
355 if ((options & kFixedWidth) && (options & kFixedHeight))
359 while ((ptr = (TGFrameElement *) next())) {
360 if (ptr->fState & kIsVisible) {
361 csize = ptr->fFrame->GetDefaultSize();
362 size.fWidth = TMath::Max(size.fWidth, csize.fWidth + ptr->fLayout->GetPadLeft() +
363 ptr->fLayout->GetPadRight());
364 size.fHeight += csize.fHeight + ptr->fLayout->GetPadTop() +
365 ptr->fLayout->GetPadBottom();
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;
381 void TGHorizontalLayout::Layout()
384 TGLayoutHints *layout;
388 UInt_t extra_space = 0;
393 Int_t bw = fMain->GetBorderWidth();
394 TGDimension size, csize;
395 TGDimension msize = fMain->GetSize();
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);
406 while ((ptr = (TGFrameElement *) next())) {
407 if (ptr->fState & kIsVisible) {
408 layout = ptr->fLayout;
409 size = ptr->fFrame->GetDefaultSize();
410 size.fWidth += layout->GetPadLeft() + layout->GetPadRight();
411 hints = layout->GetLayoutHints();
412 if ((hints & kLHintsExpandX) || (hints & kLHintsCenterX)) {
415 if (hints & kLHintsExpandX) exp_max = 0;
416 else exp_max = TMath::Max(exp_max, (Int_t)size.fWidth);
418 remain -= size.fWidth;
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;
434 while ((ptr = (TGFrameElement *) next())) {
435 if (ptr->fState & kIsVisible) {
436 hints = (layout = ptr->fLayout)->GetLayoutHints();
437 csize = ptr->fFrame->GetDefaultSize();
438 pad_left = layout->GetPadLeft();
439 pad_top = layout->GetPadTop();
440 pad_right = layout->GetPadRight();
441 pad_bottom = layout->GetPadBottom();
443 if (hints & kLHintsBottom) {
444 y = msize.fHeight - bw - csize.fHeight - pad_bottom;
445 }
else if (hints & kLHintsCenterY) {
446 y = (msize.fHeight - (bw << 1) - csize.fHeight) >> 1;
451 if (hints & kLHintsExpandY) {
452 size.fHeight = msize.fHeight - (bw << 1) - pad_top - pad_bottom;
455 size.fHeight = csize.fHeight;
458 if (hints & kLHintsExpandX) {
459 if (size_expand >= exp_max)
460 size.fWidth = size_expand - pad_left - pad_right;
462 size.fWidth = csize.fWidth + esize_expand;
464 tmp_expand += rem_expand;
466 if (tmp_expand >= nb_expand) {
468 tmp_expand -= nb_expand;
471 size.fWidth = csize.fWidth;
472 if (hints & kLHintsCenterX) {
473 if (size_expand >= exp_max) {
474 extra_space = (size_expand - pad_left - pad_right - size.fWidth)>> 1;
476 extra_space = esize_expand >> 1;
483 if (hints & kLHintsRight) {
484 x = right - size.fWidth - pad_right;
485 right -= size.fWidth + pad_left + pad_right;
488 left += size.fWidth + pad_left + pad_right;
491 if (hints & kLHintsCenterX)
494 ptr->fFrame->MoveResize(x, y, size.fWidth, size.fHeight);
496 fModified = fModified || (ptr->fFrame->GetX() != x) ||
497 (ptr->fFrame->GetY() != y) ||
498 (ptr->fFrame->GetWidth() != size.fWidth) ||
499 (ptr->fFrame->GetHeight() != size.fHeight);
507 TGDimension TGHorizontalLayout::GetDefaultSize()
const
510 TGDimension size(0,0), msize = fMain->GetSize(), csize;
511 UInt_t options = fMain->GetOptions();
513 if ((options & kFixedWidth) && (options & kFixedHeight))
517 while ((ptr = (TGFrameElement *) next())) {
518 if (ptr->fState & kIsVisible) {
519 csize = ptr->fFrame->GetDefaultSize();
520 size.fWidth += csize.fWidth + ptr->fLayout->GetPadLeft() +
521 ptr->fLayout->GetPadRight();
523 size.fHeight = TMath::Max(size.fHeight, csize.fHeight + ptr->fLayout->GetPadTop() +
524 ptr->fLayout->GetPadBottom());
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;
539 void TGRowLayout::Layout()
543 Int_t bw = fMain->GetBorderWidth();
544 Int_t x = bw, y = bw;
548 while ((ptr = (TGFrameElement *) next())) {
549 if (ptr->fState & kIsVisible) {
550 size = ptr->fFrame->GetDefaultSize();
551 ptr->fFrame->Move(x, y);
553 fModified = fModified || (ptr->fFrame->GetX() != x) ||
554 (ptr->fFrame->GetY() != y);
556 ptr->fFrame->Layout();
557 x += size.fWidth + fSep;
565 TGDimension TGRowLayout::GetDefaultSize()
const
568 TGDimension size(0,0), dsize, msize = fMain->GetSize();
569 UInt_t options = fMain->GetOptions();
571 if ((options & kFixedHeight) && (options & kFixedWidth))
575 while ((ptr = (TGFrameElement *) next())) {
576 if (ptr->fState & kIsVisible) {
577 dsize = ptr->fFrame->GetDefaultSize();
578 size.fHeight = TMath::Max(size.fHeight, dsize.fHeight);
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;
596 void TGColumnLayout::Layout()
600 Int_t bw = fMain->GetBorderWidth();
601 Int_t x = bw, y = bw;
605 while ((ptr = (TGFrameElement *) next())) {
606 if (ptr->fState & kIsVisible) {
607 size = ptr->fFrame->GetDefaultSize();
608 ptr->fFrame->Move(x, y);
609 fModified = fModified || (ptr->fFrame->GetX() != x) ||
610 (ptr->fFrame->GetY() != y);
611 ptr->fFrame->Layout();
612 y += size.fHeight + fSep;
620 TGDimension TGColumnLayout::GetDefaultSize()
const
623 TGDimension size(0,0), dsize, msize = fMain->GetSize();
624 UInt_t options = fMain->GetOptions();
626 if (options & kFixedHeight && options & kFixedWidth)
630 while ((ptr = (TGFrameElement *) next())) {
631 if (ptr->fState & kIsVisible) {
632 dsize = ptr->fFrame->GetDefaultSize();
633 size.fHeight += dsize.fHeight + fSep;
634 size.fWidth = TMath::Max(size.fWidth, dsize.fWidth);
638 size.fHeight += fMain->GetBorderWidth() << 1;
639 size.fHeight -= fSep;
640 size.fWidth += fMain->GetBorderWidth() << 1;
642 if (options & kFixedHeight) size.fHeight = msize.fHeight;
643 if (options & kFixedWidth) size.fWidth = msize.fWidth;
651 TGMatrixLayout::TGMatrixLayout(TGCompositeFrame *main, UInt_t r, UInt_t c,
655 fList = fMain->GetList();
665 void TGMatrixLayout::Layout()
668 TGDimension csize, maxsize(0,0);
669 Int_t bw = fMain->GetBorderWidth();
670 Int_t x = fSep, y = fSep + bw;
671 UInt_t rowcount = fRows, colcount = fColumns;
675 while ((ptr = (TGFrameElement *) next())) {
676 csize = ptr->fFrame->GetDefaultSize();
677 maxsize.fWidth = TMath::Max(maxsize.fWidth, csize.fWidth);
678 maxsize.fHeight = TMath::Max(maxsize.fHeight, csize.fHeight);
682 while ((ptr = (TGFrameElement *) next())) {
683 ptr->fFrame->Move(x, y);
684 fModified = fModified || (ptr->fFrame->GetX() != x) ||
685 (ptr->fFrame->GetY() != y);
687 ptr->fFrame->Layout();
690 y += maxsize.fHeight + fSep;
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;
721 TGDimension TGMatrixLayout::GetDefaultSize()
const
724 TGDimension size, csize, maxsize(0,0);
726 Int_t bw = fMain->GetBorderWidth();
729 while ((ptr = (TGFrameElement *) next())) {
731 csize = ptr->fFrame->GetDefaultSize();
732 maxsize.fWidth = TMath::Max(maxsize.fWidth, csize.fWidth);
733 maxsize.fHeight = TMath::Max(maxsize.fHeight, csize.fHeight);
737 Int_t rows = (count % fColumns) ? (count / fColumns + 1) : (count / fColumns);
738 size.fWidth = fColumns * (maxsize.fWidth + fSep) + fSep;
739 size.fHeight = rows * (maxsize.fHeight + fSep) + fSep + bw;
740 }
else if (fColumns == 0) {
741 Int_t cols = (count % fRows) ? (count / fRows + 1) : (count / fRows);
742 size.fWidth = cols * (maxsize.fWidth + fSep) + fSep;
743 size.fHeight = fRows * (maxsize.fHeight + fSep) + fSep + bw;
745 size.fWidth = fColumns * (maxsize.fWidth + fSep) + fSep;
746 size.fHeight = fRows * (maxsize.fHeight + fSep) + fSep + bw;
754 TGTileLayout::TGTileLayout(TGCompositeFrame *main, Int_t sep)
758 fList = fMain->GetList();
765 void TGTileLayout::Layout()
771 TGDimension csize, max_osize(0,0), msize = fMain->GetSize();
775 while ((ptr = (TGFrameElement *) next())) {
776 csize = ptr->fFrame->GetDefaultSize();
777 max_osize.fWidth = TMath::Max(max_osize.fWidth, csize.fWidth);
778 max_osize.fHeight = TMath::Max(max_osize.fHeight, csize.fHeight);
781 max_width = TMath::Max(msize.fWidth, max_osize.fWidth + (fSep << 1));
782 x = fSep; y = fSep << 1;
785 while ((ptr = (TGFrameElement *) next())) {
786 hints = ptr->fLayout->GetLayoutHints();
787 csize = ptr->fFrame->GetDefaultSize();
789 if (hints & kLHintsCenterX)
790 xw = x + (Int_t)((max_osize.fWidth - csize.fWidth) >> 1);
791 else if (hints & kLHintsRight)
792 xw = x + (Int_t)max_osize.fWidth - (Int_t)csize.fWidth;
796 if (hints & kLHintsCenterY)
797 yw = y + (Int_t)((max_osize.fHeight - csize.fHeight) >> 1);
798 else if (hints & kLHintsBottom)
799 yw = y + (Int_t)max_osize.fHeight - (Int_t)csize.fHeight;
803 fModified = fModified || (ptr->fFrame->GetX() != xw) ||
804 (ptr->fFrame->GetY() != yw);
805 ptr->fFrame->Move(xw, yw);
806 if (hints & kLHintsExpandX)
807 ptr->fFrame->Resize(max_osize.fWidth, ptr->fFrame->GetDefaultHeight());
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);
820 TGDimension TGTileLayout::GetDefaultSize()
const
824 TGDimension max_size, max_osize(0,0), msize = fMain->GetSize();
827 while ((ptr = (TGFrameElement *) next())) {
828 max_size = ptr->fFrame->GetDefaultSize();
829 max_osize.fWidth = TMath::Max(max_osize.fWidth, max_size.fWidth);
830 max_osize.fHeight = TMath::Max(max_osize.fHeight, max_size.fHeight);
833 max_size.fWidth = TMath::Max(msize.fWidth, max_osize.fWidth + (fSep << 1));
835 x = fSep; y = fSep << 1;
839 while ((ptr = (TGFrameElement *) next())) {
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;
847 max_size.fHeight = TMath::Max(y, (Int_t)msize.fHeight);
855 void TGListLayout::Layout()
861 TGDimension csize, max_osize(0,0), msize = fMain->GetSize();
866 while ((ptr = (TGFrameElement *) next())) {
867 csize = ptr->fFrame->GetDefaultSize();
868 max_osize.fWidth = TMath::Max(max_osize.fWidth, csize.fWidth);
869 max_osize.fHeight = TMath::Max(max_osize.fHeight, csize.fHeight);
872 max_height = TMath::Max(msize.fHeight, max_osize.fHeight + (fSep << 1));
874 x = fSep; y = fSep << 1;
877 while ((ptr = (TGFrameElement *) next())) {
879 hints = ptr->fLayout->GetLayoutHints();
880 csize = ptr->fFrame->GetDefaultSize();
882 if (hints & kLHintsCenterX)
883 xw = x + (Int_t)((max_osize.fWidth - csize.fWidth) >> 1);
884 else if (hints & kLHintsRight)
885 xw = x + (Int_t)max_osize.fWidth - (Int_t)csize.fWidth;
889 if (hints & kLHintsCenterY)
890 yw = y + (Int_t)((max_osize.fHeight - csize.fHeight) >> 1);
891 else if (hints & kLHintsBottom)
892 yw = y + (Int_t)max_osize.fHeight - (Int_t)csize.fHeight;
896 fModified = fModified || (ptr->fFrame->GetX() != xw) ||
897 (ptr->fFrame->GetY() != yw);
898 ptr->fFrame->Move(xw, yw);
899 if (hints & kLHintsExpandX)
900 ptr->fFrame->Resize(max_osize.fWidth, ptr->fFrame->GetDefaultHeight());
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;
913 TGDimension TGListLayout::GetDefaultSize()
const
917 TGDimension max_size, max_osize(0,0), msize = fMain->GetSize();
920 while ((ptr = (TGFrameElement *) next())) {
921 max_size = ptr->fFrame->GetDefaultSize();
922 max_osize.fWidth = TMath::Max(max_osize.fWidth, max_size.fWidth);
923 max_osize.fHeight = TMath::Max(max_osize.fHeight, max_size.fHeight);
926 max_size.fHeight = TMath::Max(msize.fHeight, max_osize.fHeight + (fSep << 1));
928 x = fSep; y = fSep << 1;
931 while ((ptr = (TGFrameElement *) next())) {
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;
939 max_size.fWidth = TMath::Max(x, (Int_t)msize.fWidth);
947 void TGListDetailsLayout::Layout()
950 TGDimension csize, msize = fMain->GetSize();
951 Int_t max_oh = 0, x = fSep, y = fSep << 1;
955 while ((ptr = (TGFrameElement *) next())) {
956 csize = ptr->fFrame->GetDefaultSize();
957 max_oh = TMath::Max(max_oh, (Int_t)csize.fHeight);
962 while ((ptr = (TGFrameElement *) next())) {
963 if (ptr->fState & kIsVisible) {
964 csize = ptr->fFrame->GetDefaultSize();
966 fModified = fModified || (ptr->fFrame->GetX() != x) ||
967 (ptr->fFrame->GetY() != y);
969 ptr->fFrame->MoveResize(x, y, msize.fWidth, csize.fHeight);
970 ptr->fFrame->Layout();
971 y += max_oh + fSep + (fSep >> 1);
979 TGDimension TGListDetailsLayout::GetDefaultSize()
const
982 TGDimension csize, max_osize(0,0);
986 while ((ptr = (TGFrameElement *) next())) {
987 csize = ptr->fFrame->GetDefaultSize();
988 max_osize.fWidth = TMath::Max(max_osize.fWidth, csize.fWidth);
989 max_osize.fHeight = TMath::Max(max_osize.fHeight, csize.fHeight);
993 while ((ptr = (TGFrameElement *) next())) {
994 if (ptr->fState & kIsVisible) {
995 y += max_osize.fHeight + fSep + (fSep >> 1);
999 return TGDimension( fWidth ? fWidth : max_osize.fWidth, y);
1003 void TGLayoutHints::SavePrimitive(std::ostream &out, Option_t * option)
1009 UInt_t pad = GetPadLeft()+GetPadRight()+GetPadTop()+GetPadBottom();
1011 if (!GetLayoutHints())
return;
1013 if ((option == 0) || strcmp(option,
"nocoma"))
1016 if ((fLayoutHints == kLHintsNormal) && (pad == 0)) {
1017 out <<
"new TGLayoutHints(kLHintsNormal)";
1020 if (fLayoutHints & kLHintsLeft) {
1021 if (hints.Length() == 0) hints =
"kLHintsLeft";
1022 else hints +=
" | kLHintsLeft";
1024 if (fLayoutHints & kLHintsCenterX) {
1025 if (hints.Length() == 0) hints =
"kLHintsCenterX";
1026 else hints +=
" | kLHintsCenterX";
1028 if (fLayoutHints & kLHintsRight) {
1029 if (hints.Length() == 0) hints =
"kLHintsRight";
1030 else hints +=
" | kLHintsRight";
1032 if (fLayoutHints & kLHintsTop) {
1033 if (hints.Length() == 0) hints =
"kLHintsTop";
1034 else hints +=
" | kLHintsTop";
1036 if (fLayoutHints & kLHintsCenterY) {
1037 if (hints.Length() == 0) hints =
"kLHintsCenterY";
1038 else hints +=
" | kLHintsCenterY";
1040 if (fLayoutHints & kLHintsBottom) {
1041 if (hints.Length() == 0) hints =
"kLHintsBottom";
1042 else hints +=
" | kLHintsBottom";
1044 if (fLayoutHints & kLHintsExpandX) {
1045 if (hints.Length() == 0) hints =
"kLHintsExpandX";
1046 else hints +=
" | kLHintsExpandX";
1048 if (fLayoutHints & kLHintsExpandY) {
1049 if (hints.Length() == 0) hints =
"kLHintsExpandY";
1050 else hints +=
" | kLHintsExpandY";
1053 out <<
"new TGLayoutHints(" << hints;
1056 out <<
"," << GetPadLeft() <<
"," << GetPadRight()
1057 <<
"," << GetPadTop() <<
"," << GetPadBottom();
1063 void TGVerticalLayout::SavePrimitive(std::ostream &out, Option_t * )
1068 out <<
"new TGVerticalLayout(" << fMain->GetName() <<
")";
1073 void TGHorizontalLayout::SavePrimitive(std::ostream &out, Option_t * )
1078 out <<
"new TGHorizontalLayout(" << fMain->GetName() <<
")";
1082 void TGRowLayout::SavePrimitive(std::ostream &out, Option_t * )
1087 out <<
"new TGRowLayout(" << fMain->GetName() <<
","
1092 void TGColumnLayout::SavePrimitive(std::ostream &out, Option_t * )
1097 out <<
"new TGColumnLayout(" << fMain->GetName() <<
","
1103 void TGMatrixLayout::SavePrimitive(std::ostream &out, Option_t * )
1108 out <<
"new TGMatrixLayout(" << fMain->GetName() <<
","
1117 void TGTileLayout::SavePrimitive(std::ostream &out, Option_t * )
1122 out <<
"new TGTileLayout(" << fMain->GetName() <<
","
1128 void TGListLayout::SavePrimitive(std::ostream &out, Option_t * )
1133 out <<
"new TGListLayout(" << fMain->GetName() <<
","
1139 void TGListDetailsLayout::SavePrimitive(std::ostream &out, Option_t * )
1144 out <<
"new TGListDetailsLayout(" << fMain->GetName() <<
","
1145 << fSep <<
"," << fWidth <<
")";