40 if (
f)
f->SetFrameElement(
this);
67 std::cout <<
fFrame->ClassName() <<
"::" <<
fFrame->GetName();
72 std::cout << std::endl;
118 std::cout <<
"kLHintsLeft";
122 if (bor) std::cout <<
" | ";
123 std::cout <<
"kLHintsCenterX";
127 if (bor) std::cout <<
" | ";
128 std::cout <<
"kLHintsRight";
132 if (bor) std::cout <<
" | ";
133 std::cout <<
"kLHintsTop";
137 if (bor) std::cout <<
" | ";
138 std::cout <<
"kLHintsCenterY";
142 if (bor) std::cout <<
" | ";
143 std::cout <<
"kLHintsBottom";
147 if (bor) std::cout <<
" | ";
148 std::cout <<
"kLHintsExpandX";
152 if (bor) std::cout <<
" | ";
153 std::cout <<
"kLHintsExpandY";
157 if (bor) std::cout <<
" | ";
158 std::cout <<
"kLHintsNoHints";
160 std::cout <<
", fPadtop=" <<
fPadtop;
162 std::cout <<
", fPadleft=" <<
fPadleft;
163 std::cout <<
", fPadright=" <<
fPadright;
164 std::cout << std::endl;
194 UInt_t pad_left, pad_top, pad_right, pad_bottom;
195 Int_t size_expand=0, esize_expand=0, rem_expand=0, tmp_expand = 0;
201 bottom = msize.
fHeight - (top = bw);
202 remain = msize.
fHeight - (bw << 1);
215 else exp_max = std::max(exp_max, (
Int_t)
size.fHeight);
217 remain -=
size.fHeight;
225 size_expand = remain/nb_expand;
227 if (size_expand < exp_max)
228 esize_expand = (remain - exp)/nb_expand;
229 rem_expand = remain % nb_expand;
235 hints = (layout = ptr->
fLayout)->GetLayoutHints();
251 size.fWidth = msize.
fWidth - (bw << 1) - pad_left - pad_right;
258 if (size_expand >= exp_max)
259 size.fHeight = size_expand - pad_top - pad_bottom;
263 tmp_expand += rem_expand;
264 if (tmp_expand >= nb_expand) {
266 tmp_expand -= nb_expand;
271 if (size_expand >= exp_max) {
272 extra_space = (size_expand - pad_top - pad_bottom -
size.fHeight) >> 1;
274 extra_space = esize_expand >> 1;
281 y = bottom -
size.fHeight - pad_bottom;
282 bottom -=
size.fHeight + pad_top + pad_bottom;
285 top +=
size.fHeight + pad_top + pad_bottom;
291 if (
x > 32768)
x = bw + 1;
293 if (
size.fWidth > 32768)
295 if (
size.fHeight > 32768)
330 size.fWidth +=
fMain->GetBorderWidth() << 1;
331 size.fHeight +=
fMain->GetBorderWidth() << 1;
357 UInt_t pad_left, pad_top, pad_right, pad_bottom;
358 Int_t size_expand=0, esize_expand=0, rem_expand=0, tmp_expand = 0;
363 right = msize.
fWidth - (left = bw);
364 remain = msize.
fWidth - (bw << 1);
377 else exp_max = std::max(exp_max, (
Int_t)
size.fWidth);
379 remain -=
size.fWidth;
386 size_expand = remain/nb_expand;
388 if (size_expand < exp_max) {
389 esize_expand = (remain - exp)/nb_expand;
391 rem_expand = remain % nb_expand;
397 hints = (layout = ptr->
fLayout)->GetLayoutHints();
413 size.fHeight = msize.
fHeight - (bw << 1) - pad_top - pad_bottom;
420 if (size_expand >= exp_max)
421 size.fWidth = size_expand - pad_left - pad_right;
425 tmp_expand += rem_expand;
427 if (tmp_expand >= nb_expand) {
429 tmp_expand -= nb_expand;
434 if (size_expand >= exp_max) {
435 extra_space = (size_expand - pad_left - pad_right -
size.fWidth)>> 1;
437 extra_space = esize_expand >> 1;
444 x = right -
size.fWidth - pad_right;
445 right -=
size.fWidth + pad_left + pad_right;
448 left +=
size.fWidth + pad_left + pad_right;
487 size.fWidth +=
fMain->GetBorderWidth() << 1;
488 size.fHeight +=
fMain->GetBorderWidth() << 1;
543 size.fHeight +=
fMain->GetBorderWidth() << 1;
544 size.fWidth +=
fMain->GetBorderWidth() << 1;
598 size.fHeight +=
fMain->GetBorderWidth() << 1;
600 size.fWidth +=
fMain->GetBorderWidth() << 1;
656 }
else if (
fRows == 0) {
668 if (rowcount <= 0)
return;
737 max_osize.
fWidth = std::max(max_osize.fWidth, csize.
fWidth);
738 max_osize.fHeight = std::max(max_osize.fHeight, csize.
fHeight);
741 max_width = std::max(msize.
fWidth, max_osize.fWidth + (
fSep << 1));
750 xw =
x + (
Int_t)((max_osize.fWidth - csize.
fWidth) >> 1);
770 if (
x + max_osize.fWidth > max_width) {
789 max_osize.
fWidth = std::max(max_osize.fWidth, max_size.
fWidth);
790 max_osize.fHeight = std::max(max_osize.fHeight, max_size.
fHeight);
800 x += max_osize.fWidth +
fSep;
801 if (
x + max_osize.fWidth > max_size.
fWidth) {
828 max_osize.
fWidth = std::max(max_osize.fWidth, csize.
fWidth);
829 max_osize.fHeight = std::max(max_osize.fHeight, csize.
fHeight);
832 max_height = std::max(msize.
fHeight, max_osize.fHeight + (
fSep << 1));
843 xw =
x + (
Int_t)((max_osize.fWidth - csize.
fWidth) >> 1);
863 if (
y + max_osize.fHeight > max_height) {
882 max_osize.
fWidth = std::max(max_osize.fWidth, max_size.
fWidth);
883 max_osize.fHeight = std::max(max_osize.fHeight, max_size.
fHeight);
893 if (
y + max_osize.fHeight > max_size.
fHeight) {
972 if ((option == 0) || strcmp(option,
"nocoma"))
976 out <<
"new TGLayoutHints(kLHintsNormal)";
981 auto add = [
this, &hints](
UInt_t mask,
const char *
name) {
997 out <<
"new TGLayoutHints(" << hints;
1009 out <<
"new TGVerticalLayout(" <<
fMain->GetName() <<
")";
1017 out <<
"new TGHorizontalLayout(" <<
fMain->GetName() <<
")";
1026 out <<
"new TGRowLayout(" <<
fMain->GetName() <<
"," <<
fSep <<
")";
1035 out <<
"new TGColumnLayout(" <<
fMain->GetName() <<
"," <<
fSep <<
")";
1054 out <<
"new TGTileLayout(" <<
fMain->GetName() <<
"," <<
fSep <<
")";
1063 out <<
"new TGListLayout(" <<
fMain->GetName() <<
"," <<
fSep <<
")";
1072 out <<
"new TGListDetailsLayout(" <<
fMain->GetName() <<
"," <<
fSep <<
"," <<
fWidth <<
")";
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
const char Option_t
Option string (const char).
void Layout() override
Make a column layout of all frames in the list.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save column layout manager as a C++ statement(s) on output stream.
TGDimension GetDefaultSize() const override
Return default dimension of the column layout.
The base class for composite widgets (menu bars, list boxes, etc.).
~TGFrameElement() override
Destructor. Decrease ref. count of fLayout.
void Print(Option_t *option="") const override
Print this frame element.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
virtual UInt_t GetDefaultHeight() const
void Move(Int_t x, Int_t y) override
Move frame.
TGDimension GetDefaultSize() const override
Return default dimension of the horizontal layout.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save horizontal layout manager as a C++ statement(s) on output stream.
void Layout() override
Make a horizontal layout of all frames in the list.
This class describes layout hints used by the layout classes.
~TGLayoutHints() override
Destructor.
Int_t GetPadRight() const
void Print(Option_t *option="") const override
Printing.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save layout hints as a C++ statement(s) on output stream out.
friend class TGFrameElement
Int_t GetPadBottom() const
TGLayoutHints(ULong_t hints=kLHintsNormal, Int_t padleft=0, Int_t padright=0, Int_t padtop=0, Int_t padbottom=0)
ULong_t GetLayoutHints() const
void UpdateFrameElements(TGLayoutHints *l)
Update layout hints of frame elements.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save list details layout manager as a C++ statement(s) on out stream.
void Layout() override
Make a list details layout of all frames in the list.
TGDimension GetDefaultSize() const override
Return default dimension of the list details layout.
void Layout() override
Make a tile layout of all frames in the list.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save list layout manager as a C++ statement(s) on output stream.
TGDimension GetDefaultSize() const override
Return default dimension of the list layout.
UInt_t fRows
number of rows
void SavePrimitive(std::ostream &out, Option_t *="") override
Save matrix layout manager as a C++ statement(s) on output stream.
Int_t fHints
layout hints (currently not used)
TGMatrixLayout(const TGMatrixLayout &)=delete
TGCompositeFrame * fMain
container frame
Int_t fSep
interval between frames
UInt_t fColumns
number of columns
void Layout() override
Make a matrix layout of all frames in the list.
TList * fList
list of frames to arrange
TGDimension GetDefaultSize() const override
Return default dimension of the matrix layout.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save row layout manager as a C++ statement(s) on output stream.
TGDimension GetDefaultSize() const override
Return default dimension of the row layout.
void Layout() override
Make a row layout of all frames in the list.
TGDimension GetDefaultSize() const override
Return default dimension of the tile layout.
TList * fList
list of frames to arrange
Int_t fSep
separation between tiles
TGCompositeFrame * fMain
container frame
void Layout() override
Make a tile layout of all frames in the list.
Bool_t fModified
layout changed
void SavePrimitive(std::ostream &out, Option_t *="") override
Save tile layout manager as a C++ statement(s) on output stream.
TGTileLayout(const TGTileLayout &)=delete
void Layout() override
Make a vertical layout of all frames in the list.
TGVerticalLayout(const TGVerticalLayout &gvl)
void SavePrimitive(std::ostream &out, Option_t *="") override
Save vertical layout manager as a C++ statement(s) on output stream.
TGDimension GetDefaultSize() const override
Return default dimension of the vertical layout.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
TObject()
TObject constructor.
void SetRefCount(UInt_t r)
TString & Append(const char *cs)
int main(int argc, char **argv)