# HG changeset patch # User glx # Date 1163702517 0 # Node ID d058c60c98d73bfae7ab8666d9601054616aac6a # Parent 5ba3f928fe3c2a24e9d18c3dd544c78d86a16a79 (svn r7176) -Fix: remove button was not always disabled when it should have been (rail/road build toolbar) diff --git a/rail_gui.c b/rail_gui.c --- a/rail_gui.c +++ b/rail_gui.c @@ -493,6 +493,8 @@ case WE_ABORT_PLACE_OBJ: RaiseWindowButtons(w); + DisableWindowWidget(w, 16); + InvalidateWidget(w, 16); w = FindWindowById(WC_BUILD_STATION, 0); if (w != NULL) WP(w,def_d).close = true; diff --git a/road_gui.c b/road_gui.c --- a/road_gui.c +++ b/road_gui.c @@ -183,12 +183,11 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) { switch (e->event) { + case WE_CREATE: DisableWindowWidget(w, 11); break; + case WE_PAINT: if (IsWindowWidgetLowered(w, 3) || IsWindowWidgetLowered(w, 4)) { EnableWindowWidget(w, 11); - } else { - DisableWindowWidget(w, 11); - RaiseWindowWidget(w, 11); } DrawWindowWidgets(w); break; @@ -222,6 +221,8 @@ case WE_ABORT_PLACE_OBJ: RaiseWindowButtons(w); + DisableWindowWidget(w, 11); + InvalidateWidget(w, 11); w = FindWindowById(WC_BUS_STATION, 0); if (w != NULL) WP(w,def_d).close = true;