(svn r7176) -Fix: remove button was not always disabled when it should have been (rail/road build toolbar)
--- a/rail_gui.c Thu Nov 16 18:33:55 2006 +0000
+++ b/rail_gui.c Thu Nov 16 18:41:57 2006 +0000
@@ -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;
--- a/road_gui.c Thu Nov 16 18:33:55 2006 +0000
+++ b/road_gui.c Thu Nov 16 18:41:57 2006 +0000
@@ -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;