summaryrefslogtreecommitdiff
path: root/smallmap_gui.c
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-10-03 20:16:20 +0000
committerbelugas <belugas@openttd.org>2006-10-03 20:16:20 +0000
commit17eb65050b29b84e1a5b452d302c1a40931764cb (patch)
tree22b881cad1fc846e1fe14182d37c8f6e6261f820 /smallmap_gui.c
parentbdaab39e648891f3e86a290ade9b02fe4d215f45 (diff)
downloadopenttd-17eb65050b29b84e1a5b452d302c1a40931764cb.tar.xz
(svn r6631) -Codechange: Use accessors for click_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 'smallmap_gui.c')
-rw-r--r--smallmap_gui.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/smallmap_gui.c b/smallmap_gui.c
index d08f772a1..0fe425c67 100644
--- a/smallmap_gui.c
+++ b/smallmap_gui.c
@@ -865,9 +865,9 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
case 8: // Show transport routes
case 9: // Show vegetation
case 10: // Show land owners
- w->click_state &= ~( 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10);
- w->click_state |= 1 << e->we.click.widget;
+ RaiseWindowWidget(w, _smallmap_type + 5);
_smallmap_type = e->we.click.widget - 5;
+ LowerWindowWidget(w, _smallmap_type + 5);
SetWindowDirty(w);
SndPlayFx(SND_15_BEEP);
@@ -881,8 +881,8 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
break;
case 12: // Toggle town names
- w->click_state ^= (1 << 12);
- _smallmap_show_towns = (w->click_state >> 12) & 1;
+ ToggleWidgetLoweredState(w, 12);
+ _smallmap_show_towns = IsWindowWidgetLowered(w, 12);
SetWindowDirty(w);
SndPlayFx(SND_15_BEEP);
@@ -982,7 +982,8 @@ void ShowSmallMap(void)
w = AllocateWindowDescFront(&_smallmap_desc, 0);
if (w == NULL) return;
- w->click_state = ((1 << 5) << _smallmap_type) | (_smallmap_show_towns << 12);
+ LowerWindowWidget(w, _smallmap_type + 5);
+ SetWidgetLoweredState(w, 12, _smallmap_show_towns);
w->resize.width = 350;
w->resize.height = 250;