From a1a54976f58ade3778b376c75b0437ee91f35653 Mon Sep 17 00:00:00 2001 From: glx Date: Thu, 16 Nov 2006 18:41:57 +0000 Subject: (svn r7176) -Fix: remove button was not always disabled when it should have been (rail/road build toolbar) --- road_gui.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'road_gui.c') diff --git a/road_gui.c b/road_gui.c index 47238b5b5..7bb31ca48 100644 --- a/road_gui.c +++ b/road_gui.c @@ -183,12 +183,11 @@ static OnButtonClick* const _build_road_button_proc[] = { 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 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) 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; -- cgit v1.2.3-54-g00ecf