* Sets the button as the pressed button if it's part of a group. * @param action Pointer to an action. * @param state State that the action handlers belong to. */
| 266 | * @param state State that the action handlers belong to. |
| 267 | */ |
| 268 | void TextButton::mousePress(Action *action, State *state) |
| 269 | { |
| 270 | if (action->getDetails()->button.button == SDL_BUTTON_LEFT && _group != 0) |
| 271 | { |
| 272 | TextButton *old = *_group; |
| 273 | *_group = this; |
| 274 | if (old != 0) |
| 275 | old->draw(); |
| 276 | draw(); |
| 277 | } |
| 278 | |
| 279 | if (isButtonHandled(action->getDetails()->button.button)) |
| 280 | { |
| 281 | if (soundPress != 0 && _group == 0 && |
| 282 | action->getDetails()->button.button != SDL_BUTTON_WHEELUP && action->getDetails()->button.button != SDL_BUTTON_WHEELDOWN) |
| 283 | { |
| 284 | soundPress->play(Mix_GroupAvailable(0)); |
| 285 | } |
| 286 | |
| 287 | if (_comboBox) |
| 288 | { |
| 289 | _comboBox->toggle(); |
| 290 | } |
| 291 | |
| 292 | draw(); |
| 293 | //_redraw = true; |
| 294 | } |
| 295 | InteractiveSurface::mousePress(action, state); |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * Sets the button as the released button. |
nothing calls this directly
no test coverage detected