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

Method notifyMouseWheel

MyGUIEngine/src/MyGUI_ListBox.cpp:183–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181 }
182
183 void ListBox::notifyMouseWheel(Widget* _sender, int _rel)
184 {
185 if (mRangeIndex <= 0)
186 return;
187
188 if (mWidgetScroll == nullptr)
189 return;
190
191 int offset = (int)mWidgetScroll->getScrollPosition();
192 if (_rel < 0)
193 offset += mHeightLine;
194 else
195 offset -= mHeightLine;
196
197 if (offset >= mRangeIndex)
198 offset = mRangeIndex;
199 else if (offset < 0)
200 offset = 0;
201
202 if ((int)mWidgetScroll->getScrollPosition() == offset)
203 return;
204
205 mWidgetScroll->setScrollPosition(offset);
206 _setScrollView(offset);
207 _sendEventChangeScroll(offset);
208
209 _resetContainer(true);
210 }
211
212 void ListBox::notifyScrollChangePosition(ScrollBar* _sender, size_t _position)
213 {

Callers

nothing calls this directly

Calls 2

getScrollPositionMethod · 0.80
setScrollPositionMethod · 0.45

Tested by

no test coverage detected