* Handles the mouse-wheels on the arrow-buttons. * @param action Pointer to an action. */
| 523 | * @param action Pointer to an action. |
| 524 | */ |
| 525 | void SellState::lstItemsMousePress(Action *action) |
| 526 | { |
| 527 | _sel = _lstItems->getSelectedRow(); |
| 528 | if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP) |
| 529 | { |
| 530 | _timerInc->stop(); |
| 531 | _timerDec->stop(); |
| 532 | if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() && |
| 533 | action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge()) |
| 534 | { |
| 535 | changeByValue(Options::changeValueByMouseWheel, 1); |
| 536 | } |
| 537 | } |
| 538 | else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN) |
| 539 | { |
| 540 | _timerInc->stop(); |
| 541 | _timerDec->stop(); |
| 542 | if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() && |
| 543 | action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge()) |
| 544 | { |
| 545 | changeByValue(Options::changeValueByMouseWheel, -1); |
| 546 | } |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | /** |
| 551 | * Gets the price of the currently selected item. |
nothing calls this directly
no test coverage detected