| 948 | } |
| 949 | |
| 950 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 951 | { |
| 952 | switch (widget) { |
| 953 | case WID_QS_DEFAULT: |
| 954 | this->editbox.text.DeleteAll(); |
| 955 | [[fallthrough]]; |
| 956 | |
| 957 | case WID_QS_OK: |
| 958 | this->OnOk(); |
| 959 | [[fallthrough]]; |
| 960 | |
| 961 | case WID_QS_CANCEL: |
| 962 | this->Close(); |
| 963 | break; |
| 964 | |
| 965 | case WID_QS_MOVE: |
| 966 | this->last_user_action = widget; |
| 967 | |
| 968 | if (Station::IsExpected(Station::Get(this->parent->window_number))) { |
| 969 | /* this is a station */ |
| 970 | SetViewportStationRect(Station::Get(this->parent->window_number), !this->IsWidgetLowered(WID_QS_MOVE)); |
| 971 | } else { |
| 972 | /* this is a waypoint */ |
| 973 | SetViewportWaypointRect(Waypoint::Get(this->parent->window_number), !this->IsWidgetLowered(WID_QS_MOVE)); |
| 974 | } |
| 975 | |
| 976 | HandlePlacePushButton(this, WID_QS_MOVE, SPR_CURSOR_SIGN, HT_RECT); |
| 977 | break; |
| 978 | } |
| 979 | } |
| 980 | |
| 981 | void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override |
| 982 | { |
nothing calls this directly
no test coverage detected