summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-10-04 19:11:43 +0000
committerbelugas <belugas@openttd.org>2006-10-04 19:11:43 +0000
commit6444b0e781b7de0c1d6ca10516e190e3abc5cea6 (patch)
tree1dc99947a62401f0916ac006baeea24f68e8382e
parentddb46fe8d8e030f0acd4f5ce105cd2a92b670636 (diff)
downloadopenttd-6444b0e781b7de0c1d6ca10516e190e3abc5cea6.tar.xz
(svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard
-rw-r--r--airport_gui.c8
-rw-r--r--genworld_gui.c16
-rw-r--r--intro_gui.c8
-rw-r--r--rail_gui.c12
-rw-r--r--settings_gui.c4
-rw-r--r--smallmap_gui.c2
-rw-r--r--station_gui.c8
-rw-r--r--window.h2
8 files changed, 30 insertions, 30 deletions
diff --git a/airport_gui.c b/airport_gui.c
index e1d55845a..9b2c01763 100644
--- a/airport_gui.c
+++ b/airport_gui.c
@@ -143,8 +143,8 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
case WE_CREATE:
- SetWidgetLoweredState(w, 16, !_station_show_coverage);
- SetWidgetLoweredState(w, 17, _station_show_coverage);
+ SetWindowWidgetLoweredState(w, 16, !_station_show_coverage);
+ SetWindowWidgetLoweredState(w, 17, _station_show_coverage);
LowerWindowWidget(w, _selected_airport_type + 7);
break;
@@ -210,8 +210,8 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
break;
case 16: case 17:
_station_show_coverage = e->we.click.widget - 16;
- SetWidgetLoweredState(w, 16, !_station_show_coverage);
- SetWidgetLoweredState(w, 17, _station_show_coverage);
+ SetWindowWidgetLoweredState(w, 16, !_station_show_coverage);
+ SetWindowWidgetLoweredState(w, 17, _station_show_coverage);
SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
diff --git a/genworld_gui.c b/genworld_gui.c
index 6090fe426..9a82924df 100644
--- a/genworld_gui.c
+++ b/genworld_gui.c
@@ -241,10 +241,10 @@ void GenerateLandscapeWndProc(Window *w, WindowEvent *e)
SetWindowWidgetDisabledState(w, 21, _patches_newgame.snow_line_height <= 2 || _opt_newgame.landscape != LT_HILLY);
SetWindowWidgetDisabledState(w, 23, _patches_newgame.snow_line_height >= 13 || _opt_newgame.landscape != LT_HILLY);
- SetWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
- SetWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
- SetWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
- SetWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
+ SetWindowWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
+ SetWindowWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
+ SetvWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
+ SetWindowWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
DrawWindowWidgets(w);
y = (mode == GLWP_HEIGHTMAP) ? 22 : 0;
@@ -594,10 +594,10 @@ void CreateScenarioWndProc(Window *w, WindowEvent *e)
SetWindowWidgetDisabledState(w, 17, _patches_newgame.se_flat_world_height <= 0);
SetWindowWidgetDisabledState(w, 19, _patches_newgame.se_flat_world_height >= 15);
- SetWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
- SetWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
- SetWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
- SetWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
+ SetWindowWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
+ SetWindowWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
+ SetWindowWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
+ SetWindowWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
DrawWindowWidgets(w);
DrawString( 12, 96, STR_MAPSIZE, 0);
diff --git a/intro_gui.c b/intro_gui.c
index 056754a4c..0134b053c 100644
--- a/intro_gui.c
+++ b/intro_gui.c
@@ -50,10 +50,10 @@ static void SelectGameWndProc(Window *w, WindowEvent *e)
case WE_CREATE: LowerWindowWidget(w, _opt_newgame.landscape + 8); break;
case WE_PAINT:
- SetWidgetLoweredState(w, 8, _opt_newgame.landscape == LT_NORMAL);
- SetWidgetLoweredState(w, 9, _opt_newgame.landscape == LT_HILLY);
- SetWidgetLoweredState(w, 10, _opt_newgame.landscape == LT_DESERT);
- SetWidgetLoweredState(w, 11, _opt_newgame.landscape == LT_CANDY);
+ SetWindowWidgetLoweredState(w, 8, _opt_newgame.landscape == LT_NORMAL);
+ SetWindowWidgetLoweredState(w, 9, _opt_newgame.landscape == LT_HILLY);
+ SetWindowWidgetLoweredState(w, 10, _opt_newgame.landscape == LT_DESERT);
+ SetWindowWidgetLoweredState(w, 11, _opt_newgame.landscape == LT_CANDY);
SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level);
DrawWindowWidgets(w);
break;
diff --git a/rail_gui.c b/rail_gui.c
index 629d5bbb7..c7114b88a 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -621,8 +621,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
LowerWindowWidget(w, _railstation.numtracks + 4);
LowerWindowWidget(w, _railstation.platlength + 11);
}
- SetWidgetLoweredState(w, 20, !_station_show_coverage);
- SetWidgetLoweredState(w, 21, _station_show_coverage);
+ SetWindowWidgetLoweredState(w, 20, !_station_show_coverage);
+ SetWindowWidgetLoweredState(w, 21, _station_show_coverage);
break;
case WE_PAINT: {
@@ -768,8 +768,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
case 19:
_railstation.dragdrop ^= true;
ToggleWidgetLoweredState(w, 19);
- SetWidgetLoweredState(w, _railstation.numtracks + 4, !_railstation.dragdrop);
- SetWidgetLoweredState(w, _railstation.platlength + 11, !_railstation.dragdrop);
+ SetWindowWidgetLoweredState(w, _railstation.numtracks + 4, !_railstation.dragdrop);
+ SetWindowWidgetLoweredState(w, _railstation.platlength + 11, !_railstation.dragdrop);
SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
@@ -777,8 +777,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
case 20:
case 21:
_station_show_coverage = e->we.click.widget - 20;
- SetWidgetLoweredState(w, 20, !_station_show_coverage);
- SetWidgetLoweredState(w, 21, _station_show_coverage);
+ SetWindowWidgetLoweredState(w, 20, !_station_show_coverage);
+ SetWindowWidgetLoweredState(w, 21, _station_show_coverage);
SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
diff --git a/settings_gui.c b/settings_gui.c
index 1284a79de..6530aa137 100644
--- a/settings_gui.c
+++ b/settings_gui.c
@@ -108,7 +108,7 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e)
i = GetCurRes();
SetDParam(7, i == _num_resolutions ? STR_RES_OTHER : SPECSTR_RESOLUTION_START + i);
SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format);
- SetWidgetLoweredState(w, 28, _fullscreen);
+ SetWindowWidgetLoweredState(w, 28, _fullscreen);
DrawWindowWidgets(w);
DrawString(20, 175, STR_OPTIONS_FULLSCREEN, 0); // fullscreen
@@ -152,7 +152,7 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e)
ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_RESOLUTION_START, _num_resolutions), GetCurRes(), 27, 0, 0);
return;
case 28: /* Click fullscreen on/off */
- SetWidgetLoweredState(w, 28, !_fullscreen);
+ SetWindowWidgetLoweredState(w, 28, !_fullscreen);
ToggleFullScreen(!_fullscreen); // toggle full-screen on/off
SetWindowDirty(w);
return;
diff --git a/smallmap_gui.c b/smallmap_gui.c
index 0fe425c67..b58fb2c00 100644
--- a/smallmap_gui.c
+++ b/smallmap_gui.c
@@ -983,7 +983,7 @@ void ShowSmallMap(void)
if (w == NULL) return;
LowerWindowWidget(w, _smallmap_type + 5);
- SetWidgetLoweredState(w, 12, _smallmap_show_towns);
+ SetWindowWidgetLoweredState(w, 12, _smallmap_show_towns);
w->resize.width = 350;
w->resize.height = 250;
diff --git a/station_gui.c b/station_gui.c
index 90ea6b974..eb095f8d9 100644
--- a/station_gui.c
+++ b/station_gui.c
@@ -355,7 +355,7 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
SETBIT(facilities, e->we.click.widget - 6);
LowerWindowWidget(w, e->we.click.widget);
}
- SetWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
+ SetWindowWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
sl->flags |= SL_REBUILD;
SetWindowDirty(w);
break;
@@ -405,7 +405,7 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
LowerWindowWidget(w, e->we.click.widget);
}
sl->flags |= SL_REBUILD;
- SetWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
+ SetWindowWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
SetWindowDirty(w);
}
}
@@ -436,8 +436,8 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
for (i = 0; i < NUM_CARGO; i++) {
if (HASBIT(cargo_filter, i)) LowerWindowWidget(w, i + 12);
}
- SetWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
- SetWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
+ SetWindowWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
+ SetWindowWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
sl->sort_list = NULL;
sl->flags = SL_REBUILD;
sl->sort_type = 0;
diff --git a/window.h b/window.h
index faaf16646..c9492955c 100644
--- a/window.h
+++ b/window.h
@@ -695,7 +695,7 @@ static inline bool IsWindowWidgetHidden(Window *w, byte widget_index)
* @param widget_index : index of this widget in the window
* @param hidden_stat : status to use ie: lowered = true, raised = false
*/
-static inline void SetWidgetLoweredState(Window *w, byte widget_index, bool lowered_stat)
+static inline void SetWindowWidgetLoweredState(Window *w, byte widget_index, bool lowered_stat)
{
SB(w->click_state, widget_index, 1, !!lowered_stat);
}