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

Method notifyMouseWheel

UnitTests/UnitTest_TreeControl/TreeControl.cpp:430–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428 }
429
430 void TreeControl::notifyMouseWheel(Widget* pSender, int nValue)
431 {
432 if (mnScrollRange <= 0)
433 return;
434
435 int nPosition = (int)mpWidgetScroll->getScrollPosition();
436 if (nValue < 0)
437 nPosition += mnItemHeight;
438 else
439 nPosition -= mnItemHeight;
440
441 if (nPosition >= mnScrollRange)
442 nPosition = mnScrollRange;
443 else if (nPosition < 0)
444 nPosition = 0;
445
446 if ((int)mpWidgetScroll->getScrollPosition() == nPosition)
447 return;
448
449 mpWidgetScroll->setScrollPosition(nPosition);
450
451 scrollTo(nPosition);
452 sendScrollingEvents(nPosition);
453 }
454
455 void TreeControl::notifyMouseDoubleClick(Widget* pSender)
456 {

Callers

nothing calls this directly

Calls 2

getScrollPositionMethod · 0.80
setScrollPositionMethod · 0.45

Tested by

no test coverage detected