summaryrefslogtreecommitdiff
path: root/dock_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 /dock_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 'dock_gui.c')
-rw-r--r--dock_gui.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/dock_gui.c b/dock_gui.c
index 396c81694..6c8288955 100644
--- a/dock_gui.c
+++ b/dock_gui.c
@@ -157,8 +157,7 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e)
break;
case WE_ABORT_PLACE_OBJ:
- UnclickWindowButtons(w);
- SetWindowDirty(w);
+ RaiseWindowButtons(w);
w = FindWindowById(WC_BUILD_STATION, 0);
if (w != NULL) WP(w,def_d).close = true;
@@ -224,11 +223,12 @@ void ShowBuildDocksToolbar(void)
static void BuildDockStationWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
+ case WE_CREATE: LowerWindowWidget(w, _station_show_coverage + 3); break;
+
case WE_PAINT: {
int rad;
if (WP(w,def_d).close) return;
- w->click_state = (1<<3) << _station_show_coverage;
DrawWindowWidgets(w);
rad = (_patches.modified_catchment) ? CA_DOCK : 4;
@@ -243,7 +243,9 @@ static void BuildDockStationWndProc(Window *w, WindowEvent *e)
switch (e->we.click.widget) {
case 3:
case 4:
+ RaiseWindowWidget(w, _station_show_coverage + 3);
_station_show_coverage = e->we.click.widget - 3;
+ LowerWindowWidget(w, _station_show_coverage + 3);
SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
@@ -300,8 +302,9 @@ static void UpdateDocksDirection(void)
static void BuildDocksDepotWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
+ case WE_CREATE: LowerWindowWidget(w, _ship_depot_direction + 3); break;
+
case WE_PAINT:
- w->click_state = (1<<3) << _ship_depot_direction;
DrawWindowWidgets(w);
DrawShipDepotSprite(67, 35, 0);
@@ -314,7 +317,9 @@ static void BuildDocksDepotWndProc(Window *w, WindowEvent *e)
switch (e->we.click.widget) {
case 3:
case 4:
+ RaiseWindowWidget(w, _ship_depot_direction + 3);
_ship_depot_direction = e->we.click.widget - 3;
+ LowerWindowWidget(w, _ship_depot_direction + 3);
SndPlayFx(SND_15_BEEP);
UpdateDocksDirection();
SetWindowDirty(w);