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

Method mouseClick

src/Interface/TextList.cpp:1026–1044  ·  view source on GitHub ↗

* Ignores any mouse clicks that aren't on a row. * @param action Pointer to an action. * @param state State that the action handlers belong to. */

Source from the content-addressed store, hash-verified

1024 * @param state State that the action handlers belong to.
1025 */
1026void TextList::mouseClick(Action *action, State *state)
1027{
1028 if (_selectable)
1029 {
1030 if (_selRow < _rows.size())
1031 {
1032 InteractiveSurface::mouseClick(action, state);
1033 if (_comboBox && action->getDetails()->button.button == SDL_BUTTON_LEFT)
1034 {
1035 _comboBox->setSelected(_selRow);
1036 _comboBox->toggle();
1037 }
1038 }
1039 }
1040 else
1041 {
1042 InteractiveSurface::mouseClick(action, state);
1043 }
1044}
1045
1046/**
1047 * Selects the row the mouse is over.

Callers

nothing calls this directly

Calls 3

getDetailsMethod · 0.80
setSelectedMethod · 0.80
toggleMethod · 0.45

Tested by

no test coverage detected