34 TGVerticalLayout(iMain)
68 TGLayoutHints *layout;
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;
194 if (hints & kLHintsBottom) {
195 y = bottom -
size.fHeight - pad_bottom;
196 bottom -=
size.fHeight + pad_top + pad_bottom;
199 top +=
size.fHeight + pad_top + pad_bottom;
202 if (hints & kLHintsCenterY)
205 if (
size.fWidth > 32768)
207 if (
size.fHeight > 32768)
209 ptr->fFrame->MoveResize(x,
y,
size.fWidth,
size.fHeight);
211 fModified = fModified || (ptr->fFrame->GetX() !=
x) ||
212 (ptr->fFrame->GetY() !=
y) ||
213 (ptr->fFrame->GetWidth() !=
size.fWidth) ||
214 (ptr->fFrame->GetHeight() !=
size.fHeight);
226 TGDimension
size(0,0), msize = fMain->GetSize(), csize;
229 if ((options & kFixedWidth) && (options & kFixedHeight))
233 while ((ptr = (TGFrameElement *) next())) {
235 csize = ptr->fFrame->GetDefaultSize();
237 ptr->fLayout->GetPadRight());
238 size.fHeight += csize.fHeight + ptr->fLayout->GetPadTop() +
239 ptr->fLayout->GetPadBottom();
243 size.fWidth += fMain->GetBorderWidth() << 1;
244 size.fHeight += fMain->GetBorderWidth() << 1;
246 if (options & kFixedWidth)
size.fWidth = msize.fWidth;
247 if (options & kFixedHeight)
size.fHeight = msize.fHeight;
Exp< T >::type exp(const T &t)
virtual ~FWCompactVerticalLayout()
virtual TGDimension GetDefaultSize() const
static const std::string kIsVisible("isVisible")
FWCompactVerticalLayout(TGCompositeFrame *iMain)
tuple size
Write out results.