MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / mousePress

Method mousePress

src/Interface/ArrowButton.cpp:333–345  ·  view source on GitHub ↗

* Starts scrolling the associated list. * @param action Pointer to an action. * @param state State that the action handlers belong to. */

Source from the content-addressed store, hash-verified

331 * @param state State that the action handlers belong to.
332 */
333void ArrowButton::mousePress(Action *action, State *state)
334{
335 ImageButton::mousePress(action, state);
336 if (_list != 0)
337 {
338 if (action->getDetails()->button.button == SDL_BUTTON_LEFT)
339 {
340 _timer->start();
341 }
342 else if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP) _list->scrollUp(false, true);
343 else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN) _list->scrollDown(false, true);
344 }
345}
346
347/*
348 * Stops scrolling the associated list.

Callers

nothing calls this directly

Calls 4

getDetailsMethod · 0.80
scrollUpMethod · 0.80
scrollDownMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected