summaryrefslogtreecommitdiff
path: root/road_gui.c
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-10-03 02:08:15 +0000
committerbelugas <belugas@openttd.org>2006-10-03 02:08:15 +0000
commitcf210fdf6b68f3ae0fd45c063d9f292bdf62faac (patch)
treedc2a5593c6d3da96528beb914da8807aea2325e7 /road_gui.c
parentbab116f6847f46360b0732f63a7e6f52c8287aff (diff)
downloadopenttd-cf210fdf6b68f3ae0fd45c063d9f292bdf62faac.tar.xz
(svn r6619) -Codechange: Use accessors for disabled_state.
Another step toward merging XTDwidget. The only two files not converted (window.h and widget.c) will be done at the very last commit)
Diffstat (limited to 'road_gui.c')
-rw-r--r--road_gui.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/road_gui.c b/road_gui.c
index 332842e3d..380940935 100644
--- a/road_gui.c
+++ b/road_gui.c
@@ -155,7 +155,7 @@ static void BuildRoadClick_Tunnel(Window *w)
static void BuildRoadClick_Remove(Window *w)
{
- if (HASBIT(w->disabled_state, 11)) return;
+ if (IsWindowWidgetDisabled(w, 11)) return;
SetWindowDirty(w);
SndPlayFx(SND_15_BEEP);
TOGGLEBIT(w->click_state, 11);
@@ -184,10 +184,11 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
case WE_PAINT:
- w->disabled_state &= ~(1 << 11);
if (!(w->click_state & ((1<<3)|(1<<4)))) {
- w->disabled_state |= (1 << 11);
+ DisableWindowWidget(w, 11);
w->click_state &= ~(1<<11);
+ } else {
+ EnableWindowWidget(w, 11);
}
DrawWindowWidgets(w);
break;