(svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard
authorbelugas
Wed, 04 Oct 2006 19:11:43 +0000
changeset 4727 6819acce7c57
parent 4726 a609ab3ee4c7
child 4728 d4426f6c6191
(svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard
airport_gui.c
genworld_gui.c
intro_gui.c
rail_gui.c
settings_gui.c
smallmap_gui.c
station_gui.c
window.h
--- a/airport_gui.c	Wed Oct 04 17:09:17 2006 +0000
+++ b/airport_gui.c	Wed Oct 04 19:11:43 2006 +0000
@@ -143,8 +143,8 @@
 {
 	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 @@
 			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;
--- a/genworld_gui.c	Wed Oct 04 17:09:17 2006 +0000
+++ b/genworld_gui.c	Wed Oct 04 19:11:43 2006 +0000
@@ -241,10 +241,10 @@
 		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 @@
 		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);
--- a/intro_gui.c	Wed Oct 04 17:09:17 2006 +0000
+++ b/intro_gui.c	Wed Oct 04 19:11:43 2006 +0000
@@ -50,10 +50,10 @@
 	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;
--- a/rail_gui.c	Wed Oct 04 17:09:17 2006 +0000
+++ b/rail_gui.c	Wed Oct 04 19:11:43 2006 +0000
@@ -621,8 +621,8 @@
 			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 @@
 		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 @@
 		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;
--- a/settings_gui.c	Wed Oct 04 17:09:17 2006 +0000
+++ b/settings_gui.c	Wed Oct 04 19:11:43 2006 +0000
@@ -108,7 +108,7 @@
 		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 @@
 			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;
--- a/smallmap_gui.c	Wed Oct 04 17:09:17 2006 +0000
+++ b/smallmap_gui.c	Wed Oct 04 19:11:43 2006 +0000
@@ -983,7 +983,7 @@
 	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;
 
--- a/station_gui.c	Wed Oct 04 17:09:17 2006 +0000
+++ b/station_gui.c	Wed Oct 04 19:11:43 2006 +0000
@@ -355,7 +355,7 @@
 				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 @@
 					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 @@
 		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;
--- a/window.h	Wed Oct 04 17:09:17 2006 +0000
+++ b/window.h	Wed Oct 04 19:11:43 2006 +0000
@@ -695,7 +695,7 @@
  * @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);
 }