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

Method updateScroll

MyGUIEngine/src/MyGUI_ListBox.cpp:261–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259 }
260
261 void ListBox::updateScroll()
262 {
263 mRangeIndex = (mHeightLine * (int)mItemsInfo.size()) - _getClientWidget()->getHeight();
264
265 if (mWidgetScroll == nullptr)
266 return;
267
268 if ((!mNeedVisibleScroll) || (mRangeIndex < 1) || (mWidgetScroll->getLeft() <= _getClientWidget()->getLeft()))
269 {
270 if (mWidgetScroll->getVisible())
271 {
272 mWidgetScroll->setVisible(false);
273 // увеличиваем клиентскую зону на ширину скрола
274 if (getClientWidget() != nullptr)
275 getClientWidget()->setSize(
276 getClientWidget()->getWidth() + mWidgetScroll->getWidth(),
277 getClientWidget()->getHeight());
278 }
279 }
280 else if (!mWidgetScroll->getVisible())
281 {
282 if (getClientWidget() != nullptr)
283 getClientWidget()->setSize(
284 getClientWidget()->getWidth() - mWidgetScroll->getWidth(),
285 getClientWidget()->getHeight());
286 mWidgetScroll->setVisible(true);
287 }
288
289 mWidgetScroll->setScrollRange(mRangeIndex + 1);
290 mWidgetScroll->setScrollViewPage(_getClientWidget()->getHeight());
291 if (!mItemsInfo.empty())
292 mWidgetScroll->setTrackSize(
293 mWidgetScroll->getLineSize() * _getClientWidget()->getHeight() / mHeightLine / (int)mItemsInfo.size());
294 }
295
296 void ListBox::updateLine(bool _reset)
297 {

Callers

nothing calls this directly

Calls 12

getLeftMethod · 0.80
setScrollRangeMethod · 0.80
setScrollViewPageMethod · 0.80
setTrackSizeMethod · 0.80
getLineSizeMethod · 0.80
sizeMethod · 0.45
getHeightMethod · 0.45
getVisibleMethod · 0.45
setVisibleMethod · 0.45
setSizeMethod · 0.45
getWidthMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected