* Updates the Remove button because of Ctrl state change * @param w window the button belongs to * @return true iff the remove button was changed */
| 327 | * @return true iff the remove button was changed |
| 328 | */ |
| 329 | static bool RoadToolbar_CtrlChanged(Window *w) |
| 330 | { |
| 331 | if (w->IsWidgetDisabled(WID_ROT_REMOVE)) return false; |
| 332 | |
| 333 | /* allow ctrl to switch remove mode only for these widgets */ |
| 334 | for (WidgetID i = WID_ROT_ROAD_X; i <= WID_ROT_AUTOROAD; i++) { |
| 335 | if (w->IsWidgetLowered(i)) { |
| 336 | ToggleRoadButton_Remove(w); |
| 337 | return true; |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | return false; |
| 342 | } |
| 343 | |
| 344 | /** Road toolbar window handler. */ |
| 345 | struct BuildRoadToolbarWindow : Window { |
no test coverage detected