MCPcopy Create free account
hub / github.com/MyGUI/mygui / updateView

Method updateView

Common/PanelView/BasePanelView.h:135–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 void updateView()
136 {
137 // вычисляем максимальную высоту всего добра
138 int height = 0;
139 for (const auto& item : mItems)
140 {
141 MyGUI::Widget* widget = item->getPanelCell()->getMainWidget();
142 if (widget->getVisible())
143 {
144 height += widget->getHeight();
145 }
146 }
147 // ставим высоту холста, и спрашиваем получившуюся ширину клиента
148 mScrollView->setCanvasSize(0, height);
149 // ширина клиента могла поменятся
150 const MyGUI::IntSize& size = mScrollView->getViewCoord().size();
151 mScrollView->setCanvasSize(size.width, height);
152
153 bool change = mFirstInitialise;
154 if (mOldClientWidth != size.width)
155 {
156 mOldClientWidth = size.width;
157 change = true;
158 }
159
160 // выравниваем все панели
161 int pos = 0;
162 for (auto& item : mItems)
163 {
164 MyGUI::Widget* widget = item->getPanelCell()->getMainWidget();
165 if (widget->getVisible() || mFirstInitialise)
166 {
167 height = widget->getHeight();
168 widget->setCoord(MyGUI::IntCoord(0, pos, size.width, height));
169
170 // оповещаем, что мы обновили ширину
171 if (change)
172 item->notifyChangeWidth(size.width);
173
174 pos += height;
175 }
176 }
177
178 mNeedUpdate = false;
179 mFirstInitialise = false;
180 MyGUI::Gui::getInstance().eventFrameStart -= MyGUI::newDelegate(this, &BasePanelView::frameEntered);
181 }
182
183 // изменились размеры
184 // необходимо обновить все панели

Callers

nothing calls this directly

Calls 11

newDelegateFunction · 0.85
getPanelCellMethod · 0.80
setCanvasSizeMethod · 0.80
getViewCoordMethod · 0.80
IntCoordFunction · 0.50
getMainWidgetMethod · 0.45
getVisibleMethod · 0.45
getHeightMethod · 0.45
sizeMethod · 0.45
setCoordMethod · 0.45
notifyChangeWidthMethod · 0.45

Tested by

no test coverage detected