1
0
Fork 0

(svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard

release/0.5
belugas 2006-10-04 19:11:43 +00:00
parent ddb46fe8d8
commit 6444b0e781
8 changed files with 30 additions and 30 deletions

View File

@ -143,8 +143,8 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
{ {
switch (e->event) { switch (e->event) {
case WE_CREATE: case WE_CREATE:
SetWidgetLoweredState(w, 16, !_station_show_coverage); SetWindowWidgetLoweredState(w, 16, !_station_show_coverage);
SetWidgetLoweredState(w, 17, _station_show_coverage); SetWindowWidgetLoweredState(w, 17, _station_show_coverage);
LowerWindowWidget(w, _selected_airport_type + 7); LowerWindowWidget(w, _selected_airport_type + 7);
break; break;
@ -210,8 +210,8 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
break; break;
case 16: case 17: case 16: case 17:
_station_show_coverage = e->we.click.widget - 16; _station_show_coverage = e->we.click.widget - 16;
SetWidgetLoweredState(w, 16, !_station_show_coverage); SetWindowWidgetLoweredState(w, 16, !_station_show_coverage);
SetWidgetLoweredState(w, 17, _station_show_coverage); SetWindowWidgetLoweredState(w, 17, _station_show_coverage);
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
SetWindowDirty(w); SetWindowDirty(w);
break; break;

View File

@ -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, 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); SetWindowWidgetDisabledState(w, 23, _patches_newgame.snow_line_height >= 13 || _opt_newgame.landscape != LT_HILLY);
SetWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL); SetWindowWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
SetWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY); SetWindowWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
SetWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT); SetvWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
SetWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY); SetWindowWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
DrawWindowWidgets(w); DrawWindowWidgets(w);
y = (mode == GLWP_HEIGHTMAP) ? 22 : 0; 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, 17, _patches_newgame.se_flat_world_height <= 0);
SetWindowWidgetDisabledState(w, 19, _patches_newgame.se_flat_world_height >= 15); SetWindowWidgetDisabledState(w, 19, _patches_newgame.se_flat_world_height >= 15);
SetWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL); SetWindowWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
SetWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY); SetWindowWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
SetWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT); SetWindowWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
SetWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY); SetWindowWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
DrawWindowWidgets(w); DrawWindowWidgets(w);
DrawString( 12, 96, STR_MAPSIZE, 0); DrawString( 12, 96, STR_MAPSIZE, 0);

View File

@ -50,10 +50,10 @@ static void SelectGameWndProc(Window *w, WindowEvent *e)
case WE_CREATE: LowerWindowWidget(w, _opt_newgame.landscape + 8); break; case WE_CREATE: LowerWindowWidget(w, _opt_newgame.landscape + 8); break;
case WE_PAINT: case WE_PAINT:
SetWidgetLoweredState(w, 8, _opt_newgame.landscape == LT_NORMAL); SetWindowWidgetLoweredState(w, 8, _opt_newgame.landscape == LT_NORMAL);
SetWidgetLoweredState(w, 9, _opt_newgame.landscape == LT_HILLY); SetWindowWidgetLoweredState(w, 9, _opt_newgame.landscape == LT_HILLY);
SetWidgetLoweredState(w, 10, _opt_newgame.landscape == LT_DESERT); SetWindowWidgetLoweredState(w, 10, _opt_newgame.landscape == LT_DESERT);
SetWidgetLoweredState(w, 11, _opt_newgame.landscape == LT_CANDY); SetWindowWidgetLoweredState(w, 11, _opt_newgame.landscape == LT_CANDY);
SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level); SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level);
DrawWindowWidgets(w); DrawWindowWidgets(w);
break; break;

View File

@ -621,8 +621,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
LowerWindowWidget(w, _railstation.numtracks + 4); LowerWindowWidget(w, _railstation.numtracks + 4);
LowerWindowWidget(w, _railstation.platlength + 11); LowerWindowWidget(w, _railstation.platlength + 11);
} }
SetWidgetLoweredState(w, 20, !_station_show_coverage); SetWindowWidgetLoweredState(w, 20, !_station_show_coverage);
SetWidgetLoweredState(w, 21, _station_show_coverage); SetWindowWidgetLoweredState(w, 21, _station_show_coverage);
break; break;
case WE_PAINT: { case WE_PAINT: {
@ -768,8 +768,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
case 19: case 19:
_railstation.dragdrop ^= true; _railstation.dragdrop ^= true;
ToggleWidgetLoweredState(w, 19); ToggleWidgetLoweredState(w, 19);
SetWidgetLoweredState(w, _railstation.numtracks + 4, !_railstation.dragdrop); SetWindowWidgetLoweredState(w, _railstation.numtracks + 4, !_railstation.dragdrop);
SetWidgetLoweredState(w, _railstation.platlength + 11, !_railstation.dragdrop); SetWindowWidgetLoweredState(w, _railstation.platlength + 11, !_railstation.dragdrop);
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
SetWindowDirty(w); SetWindowDirty(w);
break; break;
@ -777,8 +777,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
case 20: case 20:
case 21: case 21:
_station_show_coverage = e->we.click.widget - 20; _station_show_coverage = e->we.click.widget - 20;
SetWidgetLoweredState(w, 20, !_station_show_coverage); SetWindowWidgetLoweredState(w, 20, !_station_show_coverage);
SetWidgetLoweredState(w, 21, _station_show_coverage); SetWindowWidgetLoweredState(w, 21, _station_show_coverage);
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
SetWindowDirty(w); SetWindowDirty(w);
break; break;

View File

@ -108,7 +108,7 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e)
i = GetCurRes(); i = GetCurRes();
SetDParam(7, i == _num_resolutions ? STR_RES_OTHER : SPECSTR_RESOLUTION_START + i); SetDParam(7, i == _num_resolutions ? STR_RES_OTHER : SPECSTR_RESOLUTION_START + i);
SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format); SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format);
SetWidgetLoweredState(w, 28, _fullscreen); SetWindowWidgetLoweredState(w, 28, _fullscreen);
DrawWindowWidgets(w); DrawWindowWidgets(w);
DrawString(20, 175, STR_OPTIONS_FULLSCREEN, 0); // fullscreen 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); ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_RESOLUTION_START, _num_resolutions), GetCurRes(), 27, 0, 0);
return; return;
case 28: /* Click fullscreen on/off */ case 28: /* Click fullscreen on/off */
SetWidgetLoweredState(w, 28, !_fullscreen); SetWindowWidgetLoweredState(w, 28, !_fullscreen);
ToggleFullScreen(!_fullscreen); // toggle full-screen on/off ToggleFullScreen(!_fullscreen); // toggle full-screen on/off
SetWindowDirty(w); SetWindowDirty(w);
return; return;

View File

@ -983,7 +983,7 @@ void ShowSmallMap(void)
if (w == NULL) return; if (w == NULL) return;
LowerWindowWidget(w, _smallmap_type + 5); LowerWindowWidget(w, _smallmap_type + 5);
SetWidgetLoweredState(w, 12, _smallmap_show_towns); SetWindowWidgetLoweredState(w, 12, _smallmap_show_towns);
w->resize.width = 350; w->resize.width = 350;
w->resize.height = 250; w->resize.height = 250;

View File

@ -355,7 +355,7 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
SETBIT(facilities, e->we.click.widget - 6); SETBIT(facilities, e->we.click.widget - 6);
LowerWindowWidget(w, e->we.click.widget); 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; sl->flags |= SL_REBUILD;
SetWindowDirty(w); SetWindowDirty(w);
break; break;
@ -405,7 +405,7 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
LowerWindowWidget(w, e->we.click.widget); LowerWindowWidget(w, e->we.click.widget);
} }
sl->flags |= SL_REBUILD; sl->flags |= SL_REBUILD;
SetWidgetLoweredState(w, 27, cargo_filter == 0x1FFF); SetWindowWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
SetWindowDirty(w); SetWindowDirty(w);
} }
} }
@ -436,8 +436,8 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
for (i = 0; i < NUM_CARGO; i++) { for (i = 0; i < NUM_CARGO; i++) {
if (HASBIT(cargo_filter, i)) LowerWindowWidget(w, i + 12); 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)); SetWindowWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
SetWidgetLoweredState(w, 27, cargo_filter == 0x1FFF); SetWindowWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
sl->sort_list = NULL; sl->sort_list = NULL;
sl->flags = SL_REBUILD; sl->flags = SL_REBUILD;
sl->sort_type = 0; sl->sort_type = 0;

View File

@ -695,7 +695,7 @@ static inline bool IsWindowWidgetHidden(Window *w, byte widget_index)
* @param widget_index : index of this widget in the window * @param widget_index : index of this widget in the window
* @param hidden_stat : status to use ie: lowered = true, raised = false * @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); SB(w->click_state, widget_index, 1, !!lowered_stat);
} }