|
@@ -264,13 +264,13 @@ typedef void OnButtonClick(Window *w);
|
|
|
/** Toogles state of the Remove button of Build road toolbar
|
|
|
* @param w window the button belongs to
|
|
|
*/
|
|
|
static void ToggleRoadButton_Remove(Window *w)
|
|
|
{
|
|
|
w->ToggleWidgetLoweredState(RTW_REMOVE);
|
|
|
w->InvalidateWidget(RTW_REMOVE);
|
|
|
w->SetWidgetDirty(RTW_REMOVE);
|
|
|
_remove_button_clicked = w->IsWidgetLowered(RTW_REMOVE);
|
|
|
SetSelectionRed(_remove_button_clicked);
|
|
|
}
|
|
|
|
|
|
/** Updates the Remove button because of Ctrl state change
|
|
|
* @param w window the button belongs to
|
|
@@ -444,18 +444,18 @@ struct BuildRoadToolbarWindow : Window {
|
|
|
/* The remove and the one way button state is driven
|
|
|
* by the other buttons so they don't act on themselfs.
|
|
|
* Both are only valid if they are able to apply as options. */
|
|
|
switch (clicked_widget) {
|
|
|
case RTW_REMOVE:
|
|
|
this->RaiseWidget(RTW_ONE_WAY);
|
|
|
this->InvalidateWidget(RTW_ONE_WAY);
|
|
|
this->SetWidgetDirty(RTW_ONE_WAY);
|
|
|
break;
|
|
|
|
|
|
case RTW_ONE_WAY:
|
|
|
this->RaiseWidget(RTW_REMOVE);
|
|
|
this->InvalidateWidget(RTW_REMOVE);
|
|
|
this->SetWidgetDirty(RTW_REMOVE);
|
|
|
break;
|
|
|
|
|
|
case RTW_BUS_STATION:
|
|
|
case RTW_TRUCK_STATION:
|
|
|
this->DisableWidget(RTW_ONE_WAY);
|
|
|
this->SetWidgetDisabledState(RTW_REMOVE, !this->IsWidgetLowered(clicked_widget));
|
|
@@ -530,14 +530,14 @@ struct BuildRoadToolbarWindow : Window {
|
|
|
{
|
|
|
this->RaiseButtons();
|
|
|
this->SetWidgetsDisabledState(true,
|
|
|
RTW_REMOVE,
|
|
|
RTW_ONE_WAY,
|
|
|
WIDGET_LIST_END);
|
|
|
this->InvalidateWidget(RTW_REMOVE);
|
|
|
this->InvalidateWidget(RTW_ONE_WAY);
|
|
|
this->SetWidgetDirty(RTW_REMOVE);
|
|
|
this->SetWidgetDirty(RTW_ONE_WAY);
|
|
|
|
|
|
DeleteWindowById(WC_BUS_STATION, TRANSPORT_ROAD);
|
|
|
DeleteWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD);
|
|
|
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD);
|
|
|
DeleteWindowById(WC_SELECT_STATION, 0);
|
|
|
DeleteWindowByClass(WC_BUILD_BRIDGE);
|