* Handles the mouse-wheels on the arrow-buttons. * @param action Pointer to an action. */
| 396 | * @param action Pointer to an action. |
| 397 | */ |
| 398 | void PurchaseState::lstItemsMousePress(Action *action) |
| 399 | { |
| 400 | _sel = _lstItems->getSelectedRow(); |
| 401 | if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP) |
| 402 | { |
| 403 | _timerInc->stop(); |
| 404 | _timerDec->stop(); |
| 405 | if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() && |
| 406 | action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge()) |
| 407 | { |
| 408 | increaseByValue(Options::changeValueByMouseWheel); |
| 409 | } |
| 410 | } |
| 411 | else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN) |
| 412 | { |
| 413 | _timerInc->stop(); |
| 414 | _timerDec->stop(); |
| 415 | if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() && |
| 416 | action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge()) |
| 417 | { |
| 418 | decreaseByValue(Options::changeValueByMouseWheel); |
| 419 | } |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | /** |
| 424 | * Gets the price of the currently selected item. |
nothing calls this directly
no test coverage detected