77 Int_t bw = fMain->GetBorderWidth();
78 TGDimension
size(0,0), csize(0,0);
79 TGDimension msize = fMain->GetSize();
80 UInt_t pad_left, pad_top, pad_right, pad_bottom;
81 Int_t size_expand=0, esize_expand=0, rem_expand=0, tmp_expand = 0;
87 bottom = msize.fHeight - (top = bw);
88 remain = msize.fHeight - (bw << 1);
90 std::vector<int> expandSizes;
91 expandSizes.reserve(fList->GetSize());
93 while ((ptr = (TGFrameElement *) next())) {
95 layout = ptr->fLayout;
96 size = ptr->fFrame->GetDefaultSize();
97 size.fHeight += layout->GetPadTop() + layout->GetPadBottom();
98 hints = layout->GetLayoutHints();
99 if ((hints & kLHintsExpandY) || (hints & kLHintsCenterY)) {
102 if (hints & kLHintsExpandY) {
104 expandSizes.push_back(
size.fHeight);
108 remain -=
size.fHeight;
116 size_expand = remain/nb_expand;
118 if (size_expand < exp_max)
119 esize_expand = (remain -
exp)/nb_expand;
120 rem_expand = remain % nb_expand;
123 std::sort(expandSizes.begin(), expandSizes.end(),std::less<int>());
125 for(std::vector<int>::iterator it = expandSizes.begin(), itEnd = expandSizes.end();
128 if(*it > size_expand) {
133 if(remain<0) {remain=0;}
135 size_expand = remain/nb_expand;
137 size_expand=msize.fHeight - (bw << 1);
142 while ((ptr = (TGFrameElement *) next())) {
144 hints = (layout = ptr->fLayout)->GetLayoutHints();
145 csize = ptr->fFrame->GetDefaultSize();
146 pad_left = layout->GetPadLeft();
147 pad_top = layout->GetPadTop();
148 pad_right = layout->GetPadRight();
149 pad_bottom = layout->GetPadBottom();
151 if (hints & kLHintsRight) {
152 x = msize.fWidth - bw - csize.fWidth - pad_right;
153 }
else if (hints & kLHintsCenterX) {
154 x = (msize.fWidth - (bw << 1) - csize.fWidth) >> 1;
159 if (hints & kLHintsExpandX) {
160 size.fWidth = msize.fWidth - (bw << 1) - pad_left - pad_right;
163 size.fWidth = csize.fWidth;
166 if (hints & kLHintsExpandY) {
167 if (size_expand >= exp_max)
168 if(static_cast<int>(csize.fHeight) > size_expand) {
169 size.fHeight = size_expand - pad_top - pad_bottom;
171 size.fHeight = csize.fHeight;
174 size.fHeight = csize.fHeight + esize_expand;
176 tmp_expand += rem_expand;
177 if (tmp_expand >= nb_expand) {
179 tmp_expand -= nb_expand;
182 size.fHeight = csize.fHeight;
183 if (hints & kLHintsCenterY) {
184 if (size_expand >= exp_max) {
185 extra_space = (size_expand - pad_top - pad_bottom -
size.fHeight) >> 1;
187 extra_space = esize_expand >> 1;
193 if (hints & kLHintsBottom) {
194 y = bottom -
size.fHeight - pad_bottom;
195 bottom -=
size.fHeight + pad_top + pad_bottom;
198 top +=
size.fHeight + pad_top + pad_bottom;
201 if (hints & kLHintsCenterY)
204 if (
size.fWidth > 32768)
206 if (
size.fHeight > 32768)
208 ptr->fFrame->MoveResize(x,
y,
size.fWidth,
size.fHeight);
210 fModified = fModified || (ptr->fFrame->GetX() !=
x) ||
211 (ptr->fFrame->GetY() !=
y) ||
212 (ptr->fFrame->GetWidth() !=
size.fWidth) ||
213 (ptr->fFrame->GetHeight() !=
size.fHeight);
static const std::string kIsVisible("isVisible")
tuple size
Write out results.