summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2006-11-16 18:41:57 +0000
committerglx <glx@openttd.org>2006-11-16 18:41:57 +0000
commit32fac5c2aa0bb51ec25b733e0a1cdbb13baf33cb (patch)
tree399c856edf6fbaefded539feb942c631ab094a5b
parent8530472e26ec814d72e4c071967363120cb09bac (diff)
downloadopenttd-32fac5c2aa0bb51ec25b733e0a1cdbb13baf33cb.tar.xz
(svn r7176) -Fix: remove button was not always disabled when it should have been (rail/road build toolbar)
-rw-r--r--rail_gui.c2
-rw-r--r--road_gui.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/rail_gui.c b/rail_gui.c
index 722579002..4d9e8ae17 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -493,6 +493,8 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e)
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
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;