From 2a9851a3ad3ffc9bdf90afb10021587e9a9ef190 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 1 Feb 2007 15:49:12 +0000 Subject: (svn r8511) -Codechange: make WindowClass an enumerated value. --- src/aircraft_gui.cpp | 2 +- src/airport_gui.cpp | 2 +- src/autoreplace_gui.cpp | 6 +++--- src/build_vehicle_gui.cpp | 2 +- src/console.cpp | 2 +- src/depot_gui.cpp | 8 ++++---- src/dock_gui.cpp | 2 +- src/engine_gui.cpp | 2 +- src/genworld.cpp | 2 +- src/genworld_gui.cpp | 8 ++++---- src/graph_gui.cpp | 18 +++++++++--------- src/industry_gui.cpp | 20 ++++++++++---------- src/intro_gui.cpp | 2 +- src/main_gui.cpp | 20 ++++++++++---------- src/misc.cpp | 2 +- src/misc_gui.cpp | 20 ++++++++++---------- src/music_gui.cpp | 4 ++-- src/network/network_gui.cpp | 12 ++++++------ src/newgrf_gui.cpp | 4 ++-- src/news_gui.cpp | 10 +++++----- src/openttd.h | 6 +++--- src/order_cmd.cpp | 12 ++++++------ src/player_gui.cpp | 22 +++++++++++----------- src/rail_gui.cpp | 2 +- src/road_gui.cpp | 4 ++-- src/roadveh_gui.cpp | 2 +- src/settings_gui.cpp | 8 ++++---- src/ship_gui.cpp | 2 +- src/signs_gui.cpp | 2 +- src/smallmap_gui.cpp | 4 ++-- src/station_gui.cpp | 4 ++-- src/subsidy_gui.cpp | 2 +- src/terraform_gui.cpp | 2 +- src/town_gui.cpp | 8 ++++---- src/train_gui.cpp | 2 +- src/vehicle_gui.cpp | 12 ++++++++---- src/viewport.cpp | 2 +- 37 files changed, 124 insertions(+), 120 deletions(-) (limited to 'src') diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index 5a3572de2..86ed0d72e 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -358,7 +358,7 @@ static void AircraftViewWndProc(Window *w, WindowEvent *e) static const WindowDesc _aircraft_view_desc = { WDP_AUTO, WDP_AUTO, 250, 116, - WC_VEHICLE_VIEW ,0, + WC_VEHICLE_VIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _aircraft_view_widgets, AircraftViewWndProc diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index bebb62183..90eaab323 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -124,7 +124,7 @@ static const Widget _air_toolbar_widgets[] = { static const WindowDesc _air_toolbar_desc = { WDP_ALIGN_TBR, 22, 64, 36, - WC_BUILD_TOOLBAR, 0, + WC_BUILD_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _air_toolbar_widgets, BuildAirToolbWndProc diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 372052f46..2ab57c654 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -575,7 +575,7 @@ static const Widget _replace_ship_aircraft_vehicle_widgets[] = { static const WindowDesc _replace_rail_vehicle_desc = { WDP_AUTO, WDP_AUTO, 456, 252, - WC_REPLACE_VEHICLE,0, + WC_REPLACE_VEHICLE, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _replace_rail_vehicle_widgets, ReplaceVehicleWndProc @@ -583,7 +583,7 @@ static const WindowDesc _replace_rail_vehicle_desc = { static const WindowDesc _replace_road_vehicle_desc = { WDP_AUTO, WDP_AUTO, 456, 230, - WC_REPLACE_VEHICLE,0, + WC_REPLACE_VEHICLE, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _replace_road_vehicle_widgets, ReplaceVehicleWndProc @@ -591,7 +591,7 @@ static const WindowDesc _replace_road_vehicle_desc = { static const WindowDesc _replace_ship_aircraft_vehicle_desc = { WDP_AUTO, WDP_AUTO, 456, 214, - WC_REPLACE_VEHICLE,0, + WC_REPLACE_VEHICLE, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _replace_ship_aircraft_vehicle_widgets, ReplaceVehicleWndProc diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index b43327f15..38b66bef5 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -924,7 +924,7 @@ static void NewVehicleWndProc(Window *w, WindowEvent *e) static const WindowDesc _build_vehicle_desc = { WDP_AUTO, WDP_AUTO, 228, 236, - WC_BUILD_VEHICLE,0, + WC_BUILD_VEHICLE, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE, _build_vehicle_widgets, NewVehicleWndProc diff --git a/src/console.cpp b/src/console.cpp index 4cb6e8af7..14d0a5772 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -199,7 +199,7 @@ static const Widget _iconsole_window_widgets[] = { static const WindowDesc _iconsole_window_desc = { 0, 0, 2, 2, - WC_CONSOLE, 0, + WC_CONSOLE, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _iconsole_window_widgets, IConsoleWndProc, diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index e4163fcf2..1f83e9638 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -88,7 +88,7 @@ static void DepotWndProc(Window *w, WindowEvent *e); static const WindowDesc _train_depot_desc = { WDP_AUTO, WDP_AUTO, 305, 96, - WC_VEHICLE_DEPOT,0, + WC_VEHICLE_DEPOT, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _depot_widgets, DepotWndProc @@ -96,7 +96,7 @@ static const WindowDesc _train_depot_desc = { static const WindowDesc _road_depot_desc = { WDP_AUTO, WDP_AUTO, 305, 96, - WC_VEHICLE_DEPOT,0, + WC_VEHICLE_DEPOT, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _depot_widgets, DepotWndProc @@ -104,7 +104,7 @@ static const WindowDesc _road_depot_desc = { static const WindowDesc _ship_depot_desc = { WDP_AUTO, WDP_AUTO, 305, 96, - WC_VEHICLE_DEPOT,0, + WC_VEHICLE_DEPOT, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _depot_widgets, DepotWndProc @@ -112,7 +112,7 @@ static const WindowDesc _ship_depot_desc = { static const WindowDesc _aircraft_depot_desc = { WDP_AUTO, WDP_AUTO, 305, 96, - WC_VEHICLE_DEPOT,0, + WC_VEHICLE_DEPOT, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _depot_widgets, DepotWndProc diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 9930b89ae..8b3cda116 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -208,7 +208,7 @@ static const Widget _build_docks_toolb_widgets[] = { static const WindowDesc _build_docks_toolbar_desc = { WDP_ALIGN_TBR, 22, 136, 36, - WC_BUILD_TOOLBAR, 0, + WC_BUILD_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _build_docks_toolb_widgets, BuildDocksToolbWndProc diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 6b15c6541..1c1ac20de 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -107,7 +107,7 @@ static void EnginePreviewWndProc(Window *w, WindowEvent *e) static const WindowDesc _engine_preview_desc = { WDP_CENTER, WDP_CENTER, 300, 192, - WC_ENGINE_PREVIEW,0, + WC_ENGINE_PREVIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _engine_preview_widgets, EnginePreviewWndProc diff --git a/src/genworld.cpp b/src/genworld.cpp index f67fc2a4f..dd7d42bd3 100644 --- a/src/genworld.cpp +++ b/src/genworld.cpp @@ -84,7 +84,7 @@ static void *_GenerateWorld(void *arg) if (_patches.generation_seed == GENERATE_NEW_SEED) _patches.generation_seed = _patches_newgame.generation_seed = InteractiveRandom(); _random_seeds[0][0] = _random_seeds[0][1] = _patches.generation_seed; SetGeneratingWorldProgress(GWP_MAP_INIT, 2); - SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, 0, 0); + SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, WC_MAIN_WINDOW, 0); IncreaseGeneratingWorldProgress(GWP_MAP_INIT); // Must start economy early because of the costs. diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index c74e0150d..3131b95f4 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -473,7 +473,7 @@ void GenerateLandscapeWndProc(Window *w, WindowEvent *e) const WindowDesc _generate_landscape_desc = { WDP_CENTER, WDP_CENTER, 338, 268, - WC_GENERATE_LANDSCAPE, 0, + WC_GENERATE_LANDSCAPE, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _generate_landscape_widgets, GenerateLandscapeWndProc, @@ -481,7 +481,7 @@ const WindowDesc _generate_landscape_desc = { const WindowDesc _heightmap_load_desc = { WDP_CENTER, WDP_CENTER, 338, 236, - WC_GENERATE_LANDSCAPE, 0, + WC_GENERATE_LANDSCAPE, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _heightmap_load_widgets, GenerateLandscapeWndProc, @@ -711,7 +711,7 @@ const Widget _create_scenario_widgets[] = { const WindowDesc _create_scenario_desc = { WDP_CENTER, WDP_CENTER, 338, 180, - WC_GENERATE_LANDSCAPE, 0, + WC_GENERATE_LANDSCAPE, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _create_scenario_widgets, CreateScenarioWndProc, @@ -791,7 +791,7 @@ static void ShowTerrainProgressProc(Window* w, WindowEvent* e) static const WindowDesc _show_terrain_progress_desc = { WDP_CENTER, WDP_CENTER, 181, 97, - WC_GENERATE_PROGRESS_WINDOW, 0, + WC_GENERATE_PROGRESS_WINDOW, WC_NONE, WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _show_terrain_progress_widgets, ShowTerrainProgressProc diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 587f90947..da300fa97 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -309,7 +309,7 @@ static const Widget _graph_legend_widgets[] = { static const WindowDesc _graph_legend_desc = { WDP_AUTO, WDP_AUTO, 250, 114, - WC_GRAPH_LEGEND,0, + WC_GRAPH_LEGEND, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _graph_legend_widgets, GraphLegendWndProc @@ -407,7 +407,7 @@ static const Widget _operating_profit_widgets[] = { static const WindowDesc _operating_profit_desc = { WDP_AUTO, WDP_AUTO, 576, 174, - WC_OPERATING_PROFIT,0, + WC_OPERATING_PROFIT, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _operating_profit_widgets, OperatingProfitWndProc @@ -479,7 +479,7 @@ static const Widget _income_graph_widgets[] = { static const WindowDesc _income_graph_desc = { WDP_AUTO, WDP_AUTO, 576, 142, - WC_INCOME_GRAPH,0, + WC_INCOME_GRAPH, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _income_graph_widgets, IncomeGraphWndProc @@ -549,7 +549,7 @@ static const Widget _delivered_cargo_graph_widgets[] = { static const WindowDesc _delivered_cargo_graph_desc = { WDP_AUTO, WDP_AUTO, 576, 142, - WC_DELIVERED_CARGO,0, + WC_DELIVERED_CARGO, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _delivered_cargo_graph_widgets, DeliveredCargoGraphWndProc @@ -622,7 +622,7 @@ static const Widget _performance_history_widgets[] = { static const WindowDesc _performance_history_desc = { WDP_AUTO, WDP_AUTO, 576, 238, - WC_PERFORMANCE_HISTORY,0, + WC_PERFORMANCE_HISTORY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _performance_history_widgets, PerformanceHistoryWndProc @@ -692,7 +692,7 @@ static const Widget _company_value_graph_widgets[] = { static const WindowDesc _company_value_graph_desc = { WDP_AUTO, WDP_AUTO, 576, 238, - WC_COMPANY_VALUE,0, + WC_COMPANY_VALUE, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _company_value_graph_widgets, CompanyValueGraphWndProc @@ -802,7 +802,7 @@ static const Widget _cargo_payment_rates_widgets[] = { static const WindowDesc _cargo_payment_rates_desc = { WDP_AUTO, WDP_AUTO, 568, 142, - WC_PAYMENT_RATES,0, + WC_PAYMENT_RATES, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _cargo_payment_rates_widgets, CargoPaymentRatesWndProc @@ -894,7 +894,7 @@ static const Widget _company_league_widgets[] = { static const WindowDesc _company_league_desc = { WDP_AUTO, WDP_AUTO, 400, 97, - WC_COMPANY_LEAGUE,0, + WC_COMPANY_LEAGUE, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _company_league_widgets, CompanyLeagueWndProc @@ -1115,7 +1115,7 @@ static const Widget _performance_rating_detail_widgets[] = { static const WindowDesc _performance_rating_detail_desc = { WDP_AUTO, WDP_AUTO, 299, 228, - WC_PERFORMANCE_DETAIL,0, + WC_PERFORMANCE_DETAIL, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _performance_rating_detail_widgets, PerformanceRatingDetailWndProc diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 2b0917811..aa308b721 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -190,7 +190,7 @@ static const Widget _build_industry_land3_widgets_extra[] = { static const WindowDesc _build_industry_land0_desc = { WDP_AUTO, WDP_AUTO, 170, 116, - WC_BUILD_INDUSTRY,0, + WC_BUILD_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_industry_land0_widgets, BuildIndustryWndProc @@ -198,7 +198,7 @@ static const WindowDesc _build_industry_land0_desc = { static const WindowDesc _build_industry_land1_desc = { WDP_AUTO, WDP_AUTO, 170, 116, - WC_BUILD_INDUSTRY,0, + WC_BUILD_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_industry_land1_widgets, BuildIndustryWndProc @@ -206,7 +206,7 @@ static const WindowDesc _build_industry_land1_desc = { static const WindowDesc _build_industry_land2_desc = { WDP_AUTO, WDP_AUTO, 170, 116, - WC_BUILD_INDUSTRY,0, + WC_BUILD_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_industry_land2_widgets, BuildIndustryWndProc @@ -214,7 +214,7 @@ static const WindowDesc _build_industry_land2_desc = { static const WindowDesc _build_industry_land3_desc = { WDP_AUTO, WDP_AUTO, 170, 116, - WC_BUILD_INDUSTRY,0, + WC_BUILD_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_industry_land3_widgets, BuildIndustryWndProc @@ -222,7 +222,7 @@ static const WindowDesc _build_industry_land3_desc = { static const WindowDesc _build_industry_land0_desc_extra = { WDP_AUTO, WDP_AUTO, 170, 188, - WC_BUILD_INDUSTRY,0, + WC_BUILD_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_industry_land0_widgets_extra, BuildIndustryWndProc @@ -230,7 +230,7 @@ static const WindowDesc _build_industry_land0_desc_extra = { static const WindowDesc _build_industry_land1_desc_extra = { WDP_AUTO, WDP_AUTO, 170, 175, - WC_BUILD_INDUSTRY,0, + WC_BUILD_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_industry_land1_widgets_extra, BuildIndustryWndProc @@ -238,7 +238,7 @@ static const WindowDesc _build_industry_land1_desc_extra = { static const WindowDesc _build_industry_land2_desc_extra = { WDP_AUTO, WDP_AUTO, 170, 201, - WC_BUILD_INDUSTRY,0, + WC_BUILD_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_industry_land2_widgets_extra, BuildIndustryWndProc @@ -246,7 +246,7 @@ static const WindowDesc _build_industry_land2_desc_extra = { static const WindowDesc _build_industry_land3_desc_extra = { WDP_AUTO, WDP_AUTO, 170, 188, - WC_BUILD_INDUSTRY,0, + WC_BUILD_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_industry_land3_widgets_extra, BuildIndustryWndProc @@ -433,7 +433,7 @@ static const Widget _industry_view_widgets[] = { static const WindowDesc _industry_view_desc = { WDP_AUTO, WDP_AUTO, 260, 160, - WC_INDUSTRY_VIEW,0, + WC_INDUSTRY_VIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, _industry_view_widgets, IndustryViewWndProc @@ -674,7 +674,7 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) /* Industry List */ static const WindowDesc _industry_directory_desc = { WDP_AUTO, WDP_AUTO, 508, 190, - WC_INDUSTRY_DIRECTORY,0, + WC_INDUSTRY_DIRECTORY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _industry_directory_widgets, IndustryDirectoryWndProc diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 5f78e3a65..5bb93bcd9 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -91,7 +91,7 @@ static void SelectGameWndProc(Window *w, WindowEvent *e) static const WindowDesc _select_game_desc = { WDP_CENTER, WDP_CENTER, 336, 195, - WC_SELECT_GAME,0, + WC_SELECT_GAME, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _select_game_widgets, SelectGameWndProc diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 1a856b9ec..399058e6e 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -340,7 +340,7 @@ static void SelectSignTool(void) if (_cursor.sprite == SPR_CURSOR_SIGN) { ResetObjectToPlace(); } else { - SetObjectToPlace(SPR_CURSOR_SIGN, PAL_NONE, 1, 1, 0); + SetObjectToPlace(SPR_CURSOR_SIGN, PAL_NONE, 1, WC_MAIN_TOOLBAR, 0); _place_proc = PlaceProc_Sign; } } @@ -1369,7 +1369,7 @@ static void ScenEditLandGenWndProc(Window *w, WindowEvent *e) static const WindowDesc _scen_edit_land_gen_desc = { WDP_AUTO, WDP_AUTO, 182, 103, - WC_SCEN_LAND_GEN,0, + WC_SCEN_LAND_GEN, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _scen_edit_land_gen_widgets, ScenEditLandGenWndProc, @@ -1485,7 +1485,7 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e) static const WindowDesc _scen_edit_town_gen_desc = { WDP_AUTO, WDP_AUTO, 160, 82, - WC_SCEN_TOWN_GEN,0, + WC_SCEN_TOWN_GEN, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _scen_edit_town_gen_widgets, ScenEditTownGenWndProc, @@ -1696,7 +1696,7 @@ static void ScenEditIndustryWndProc(Window *w, WindowEvent *e) static const WindowDesc _scenedit_industry_normal_desc = { WDP_AUTO, WDP_AUTO, 170, 225, - WC_SCEN_INDUSTRY,0, + WC_SCEN_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _scenedit_industry_normal_widgets, ScenEditIndustryWndProc, @@ -1704,7 +1704,7 @@ static const WindowDesc _scenedit_industry_normal_desc = { static const WindowDesc _scenedit_industry_hilly_desc = { WDP_AUTO, WDP_AUTO, 170, 225, - WC_SCEN_INDUSTRY,0, + WC_SCEN_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _scenedit_industry_hilly_widgets, ScenEditIndustryWndProc, @@ -1712,7 +1712,7 @@ static const WindowDesc _scenedit_industry_hilly_desc = { static const WindowDesc _scenedit_industry_desert_desc = { WDP_AUTO, WDP_AUTO, 170, 225, - WC_SCEN_INDUSTRY,0, + WC_SCEN_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _scenedit_industry_desert_widgets, ScenEditIndustryWndProc, @@ -1720,7 +1720,7 @@ static const WindowDesc _scenedit_industry_desert_desc = { static const WindowDesc _scenedit_industry_candy_desc = { WDP_AUTO, WDP_AUTO, 170, 225, - WC_SCEN_INDUSTRY,0, + WC_SCEN_INDUSTRY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _scenedit_industry_candy_widgets, ScenEditIndustryWndProc, @@ -1935,7 +1935,7 @@ static const Widget _toolb_normal_widgets[] = { static const WindowDesc _toolb_normal_desc = { 0, 0, 640, 22, - WC_MAIN_TOOLBAR,0, + WC_MAIN_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET, _toolb_normal_widgets, MainToolbarWndProc @@ -2086,7 +2086,7 @@ static void ScenEditToolbarWndProc(Window *w, WindowEvent *e) static const WindowDesc _toolb_scen_desc = { 0, 0, 640, 22, - WC_MAIN_TOOLBAR,0, + WC_MAIN_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _toolb_scen_widgets, ScenEditToolbarWndProc @@ -2224,7 +2224,7 @@ static const Widget _main_status_widgets[] = { static WindowDesc _main_status_desc = { WDP_CENTER, 0, 640, 12, - WC_STATUS_BAR,0, + WC_STATUS_BAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _main_status_widgets, StatusBarWndProc diff --git a/src/misc.cpp b/src/misc.cpp index 23855221a..242aaff16 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -100,7 +100,7 @@ void InitializeGame(int mode, uint size_x, uint size_y) AddTypeToEngines(); // make sure all engines have a type - SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, 0, 0); + SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, WC_MAIN_WINDOW, 0); _pause = 0; _fast_forward = 0; diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 823e3edbf..c3f4dbf86 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -73,7 +73,7 @@ static const Widget _land_info_widgets[] = { static const WindowDesc _land_info_desc = { WDP_AUTO, WDP_AUTO, 280, 93, - WC_LAND_INFO,0, + WC_LAND_INFO, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _land_info_widgets, LandInfoWndProc @@ -193,7 +193,7 @@ void PlaceLandBlockInfo(void) ResetObjectToPlace(); } else { _place_proc = Place_LandInfo; - SetObjectToPlace(SPR_CURSOR_QUERY, PAL_NONE, 1, 1, 0); + SetObjectToPlace(SPR_CURSOR_QUERY, PAL_NONE, 1, WC_MAIN_TOOLBAR, 0); } } @@ -293,7 +293,7 @@ static const Widget _about_widgets[] = { static const WindowDesc _about_desc = { WDP_CENTER, WDP_CENTER, 420, 272, - WC_GAME_OPTIONS,0, + WC_GAME_OPTIONS, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _about_widgets, AboutWindowProc @@ -454,7 +454,7 @@ static const Widget _build_trees_scen_widgets[] = { static const WindowDesc _build_trees_scen_desc = { WDP_AUTO, WDP_AUTO, 143, 184, - WC_BUILD_TREES,0, + WC_BUILD_TREES, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _build_trees_scen_widgets, BuildTreesWndProc @@ -1134,7 +1134,7 @@ static const Widget _query_string_widgets[] = { static const WindowDesc _query_string_desc = { 190, 219, 260, 42, - WC_QUERY_STRING,0, + WC_QUERY_STRING, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _query_string_widgets, QueryStringWndProc @@ -1258,7 +1258,7 @@ static const Widget _query_widgets[] = { static const WindowDesc _query_desc = { WDP_CENTER, WDP_CENTER, 210, 82, - WC_CONFIRM_POPUP_QUERY, 0, + WC_CONFIRM_POPUP_QUERY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_DEF_WIDGET | WDF_MODAL, _query_widgets, QueryWndProc @@ -1597,7 +1597,7 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e) static const WindowDesc _load_dialog_desc = { WDP_CENTER, WDP_CENTER, 257, 294, - WC_SAVELOAD,0, + WC_SAVELOAD, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE, _load_dialog_widgets, SaveLoadDlgWndProc, @@ -1605,7 +1605,7 @@ static const WindowDesc _load_dialog_desc = { static const WindowDesc _save_dialog_desc = { WDP_CENTER, WDP_CENTER, 257, 320, - WC_SAVELOAD,0, + WC_SAVELOAD, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE, _save_dialog_widgets, SaveLoadDlgWndProc, @@ -1625,7 +1625,7 @@ void ShowSaveLoadDialog(int mode) const WindowDesc *sld = &_save_dialog_desc; - SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, 0, 0); + SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, WC_MAIN_WINDOW, 0); DeleteWindowById(WC_QUERY_STRING, 0); DeleteWindowById(WC_SAVELOAD, 0); @@ -1913,7 +1913,7 @@ static void CheatsWndProc(Window *w, WindowEvent *e) static const WindowDesc _cheats_desc = { 240, 22, 400, 170, - WC_CHEATS,0, + WC_CHEATS, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _cheat_widgets, CheatsWndProc diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 620346e7e..49d7b7ef8 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -325,7 +325,7 @@ static const Widget _music_track_selection_widgets[] = { static const WindowDesc _music_track_selection_desc = { 104, 131, 432, 218, - WC_MUSIC_TRACK_SELECTION,0, + WC_MUSIC_TRACK_SELECTION, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _music_track_selection_widgets, MusicTrackSelectionWndProc @@ -494,7 +494,7 @@ static const Widget _music_window_widgets[] = { static const WindowDesc _music_window_desc = { 0, 22, 300, 66, - WC_MUSIC_WINDOW,0, + WC_MUSIC_WINDOW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _music_window_widgets, MusicWindowWndProc diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 394521811..e0bd94205 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -545,7 +545,7 @@ static const Widget _network_game_window_widgets[] = { static const WindowDesc _network_game_window_desc = { WDP_CENTER, WDP_CENTER, 550, 264, - WC_NETWORK_WINDOW,0, + WC_NETWORK_WINDOW, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _network_game_window_widgets, NetworkGameWindowWndProc, @@ -772,7 +772,7 @@ static const Widget _network_start_server_window_widgets[] = { static const WindowDesc _network_start_server_window_desc = { WDP_CENTER, WDP_CENTER, 420, 244, - WC_NETWORK_WINDOW,0, + WC_NETWORK_WINDOW, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _network_start_server_window_widgets, NetworkStartServerWindowWndProc, @@ -981,7 +981,7 @@ static const Widget _network_lobby_window_widgets[] = { static const WindowDesc _network_lobby_window_desc = { WDP_CENTER, WDP_CENTER, 420, 235, - WC_NETWORK_WINDOW,0, + WC_NETWORK_WINDOW, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _network_lobby_window_widgets, NetworkLobbyWindowWndProc, @@ -1045,7 +1045,7 @@ static const Widget _client_list_popup_widgets[] = { static WindowDesc _client_list_desc = { WDP_AUTO, WDP_AUTO, 250, 1, - WC_CLIENT_LIST,0, + WC_CLIENT_LIST, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _client_list_widgets, ClientListWndProc @@ -1454,7 +1454,7 @@ static const Widget _network_join_status_window_widget[] = { static const WindowDesc _network_join_status_window_desc = { WDP_CENTER, WDP_CENTER, 250, 85, - WC_NETWORK_STATUS_WINDOW, 0, + WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_MODAL, _network_join_status_window_widget, NetworkJoinStatusWindowWndProc, @@ -1688,7 +1688,7 @@ static const Widget _chat_window_widgets[] = { static const WindowDesc _chat_window_desc = { WDP_CENTER, -26, 640, 14, // x, y, width, height - WC_SEND_NETWORK_MSG,0, + WC_SEND_NETWORK_MSG, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET, _chat_window_widgets, ChatWindowWndProc diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index a06bddaf6..0de82b529 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -208,7 +208,7 @@ static const Widget _newgrf_add_dlg_widgets[] = { static const WindowDesc _newgrf_add_dlg_desc = { WDP_CENTER, WDP_CENTER, 307, 337, - WC_SAVELOAD, 0, + WC_SAVELOAD, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE, _newgrf_add_dlg_widgets, NewGRFAddDlgWndProc, @@ -506,7 +506,7 @@ static const Widget _newgrf_widgets[] = { static const WindowDesc _newgrf_desc = { WDP_CENTER, WDP_CENTER, 300, 225, - WC_GAME_OPTIONS, 0, + WC_GAME_OPTIONS, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE, _newgrf_widgets, NewGRFWndProc, diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 7a2432f57..ce8355391 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -328,7 +328,7 @@ static const Widget _news_type13_widgets[] = { static WindowDesc _news_type13_desc = { WDP_CENTER, 476, 430, 170, - WC_NEWS_WINDOW, 0, + WC_NEWS_WINDOW, WC_NONE, WDF_DEF_WIDGET, _news_type13_widgets, NewsWindowProc @@ -342,7 +342,7 @@ static const Widget _news_type2_widgets[] = { static WindowDesc _news_type2_desc = { WDP_CENTER, 476, 430, 130, - WC_NEWS_WINDOW, 0, + WC_NEWS_WINDOW, WC_NONE, WDF_DEF_WIDGET, _news_type2_widgets, NewsWindowProc @@ -358,7 +358,7 @@ static const Widget _news_type0_widgets[] = { static WindowDesc _news_type0_desc = { WDP_CENTER, 476, 280, 87, - WC_NEWS_WINDOW, 0, + WC_NEWS_WINDOW, WC_NONE, WDF_DEF_WIDGET, _news_type0_widgets, NewsWindowProc @@ -687,7 +687,7 @@ static const Widget _message_history_widgets[] = { static const WindowDesc _message_history_desc = { 240, 22, 400, 140, - WC_MESSAGE_HISTORY, 0, + WC_MESSAGE_HISTORY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _message_history_widgets, MessageHistoryWndProc @@ -865,7 +865,7 @@ static const Widget _message_options_widgets[] = { static const WindowDesc _message_options_desc = { 270, 22, 410, 185, - WC_GAME_OPTIONS, 0, + WC_GAME_OPTIONS, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _message_options_widgets, MessageOptionsWndProc diff --git a/src/openttd.h b/src/openttd.h index cfb4040bd..0126d72c8 100644 --- a/src/openttd.h +++ b/src/openttd.h @@ -74,7 +74,6 @@ assert_compile(sizeof(DestinationID) == sizeof(WaypointID)); assert_compile(sizeof(DestinationID) == sizeof(StationID)); typedef int32 WindowNumber; -typedef byte WindowClass; enum { INVALID_YEAR = -1, @@ -386,8 +385,9 @@ typedef struct { } TileTypeProcs; -enum { - WC_MAIN_WINDOW, +enum WindowClass { + WC_NONE, + WC_MAIN_WINDOW = WC_NONE, WC_MAIN_TOOLBAR, WC_STATUS_BAR, WC_BUILD_TOOLBAR, diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 7b89e7b54..826f3584d 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1131,16 +1131,16 @@ void DeleteVehicleOrders(Vehicle *v) if (cur != NULL) { /* Delete the vehicle list of shared orders, if any */ - int window_type = 0; + WindowClass window_class = WC_NONE; switch (v->type) { - case VEH_Train: window_type = WC_TRAINS_LIST; break; - case VEH_Road: window_type = WC_ROADVEH_LIST; break; - case VEH_Ship: window_type = WC_SHIPS_LIST; break; - case VEH_Aircraft: window_type = WC_AIRCRAFT_LIST; break; default: NOT_REACHED(); + case VEH_Train: window_class = WC_TRAINS_LIST; break; + case VEH_Road: window_class = WC_ROADVEH_LIST; break; + case VEH_Ship: window_class = WC_SHIPS_LIST; break; + case VEH_Aircraft: window_class = WC_AIRCRAFT_LIST; break; } - DeleteWindowById(window_type, (cur->index << 16) | (v->type << 11) | VLW_SHARED_ORDERS | v->owner); + DeleteWindowById(window_class, (cur->index << 16) | (v->type << 11) | VLW_SHARED_ORDERS | v->owner); } while (cur != NULL) { diff --git a/src/player_gui.cpp b/src/player_gui.cpp index 94367e1ad..42f857a15 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -190,7 +190,7 @@ static void PlayerFinancesWndProc(Window *w, WindowEvent *e) static const WindowDesc _player_finances_desc = { WDP_AUTO, WDP_AUTO, 407, 216, - WC_FINANCES,0, + WC_FINANCES, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, _player_finances_widgets, PlayerFinancesWndProc @@ -198,7 +198,7 @@ static const WindowDesc _player_finances_desc = { static const WindowDesc _player_finances_small_desc = { WDP_AUTO, WDP_AUTO, 280, 60, - WC_FINANCES,0, + WC_FINANCES, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, _player_finances_small_widgets, PlayerFinancesWndProc @@ -206,7 +206,7 @@ static const WindowDesc _player_finances_small_desc = { static const WindowDesc _other_player_finances_desc = { WDP_AUTO, WDP_AUTO, 407, 204, - WC_FINANCES,0, + WC_FINANCES, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, _other_player_finances_widgets, PlayerFinancesWndProc @@ -214,7 +214,7 @@ static const WindowDesc _other_player_finances_desc = { static const WindowDesc _other_player_finances_small_desc = { WDP_AUTO, WDP_AUTO, 280, 48, - WC_FINANCES,0, + WC_FINANCES, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, _other_player_finances_small_widgets, PlayerFinancesWndProc @@ -472,7 +472,7 @@ static const Widget _select_player_livery_2cc_widgets[] = { static const WindowDesc _select_player_livery_2cc_desc = { WDP_AUTO, WDP_AUTO, 400, 49 + 1 * 14, - WC_PLAYER_COLOR, 0, + WC_PLAYER_COLOR, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _select_player_livery_2cc_widgets, SelectPlayerLiveryWndProc @@ -499,7 +499,7 @@ static const Widget _select_player_livery_widgets[] = { static const WindowDesc _select_player_livery_desc = { WDP_AUTO, WDP_AUTO, 275, 49 + 1 * 14, - WC_PLAYER_COLOR, 0, + WC_PLAYER_COLOR, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _select_player_livery_widgets, SelectPlayerLiveryWndProc @@ -553,7 +553,7 @@ static const Widget _select_player_face_widgets[] = { static const WindowDesc _select_player_face_desc = { WDP_AUTO, WDP_AUTO, 190, 149, - WC_PLAYER_FACE,0, + WC_PLAYER_FACE, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _select_player_face_widgets, SelectPlayerFaceWndProc @@ -869,7 +869,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) static const WindowDesc _player_company_desc = { WDP_AUTO, WDP_AUTO, 360, 170, - WC_COMPANY, 0, + WC_COMPANY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _player_company_widgets, PlayerCompanyWndProc @@ -930,7 +930,7 @@ static const Widget _buy_company_widgets[] = { static const WindowDesc _buy_company_desc = { 153, 171, 334, 137, - WC_BUY_COMPANY,0, + WC_BUY_COMPANY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _buy_company_widgets, BuyCompanyWndProc @@ -1053,7 +1053,7 @@ static const Widget _highscore_widgets[] = { static const WindowDesc _highscore_desc = { 0, 0, 641, 481, - WC_HIGHSCORE,0, + WC_HIGHSCORE, WC_NONE, 0, _highscore_widgets, HighScoreWndProc @@ -1061,7 +1061,7 @@ static const WindowDesc _highscore_desc = { static const WindowDesc _endgame_desc = { 0, 0, 641, 481, - WC_ENDSCREEN,0, + WC_ENDSCREEN, WC_NONE, 0, _highscore_widgets, EndGameWndProc diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 10cbbab84..36e191202 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -577,7 +577,7 @@ static const Widget _build_rail_widgets[] = { static const WindowDesc _build_rail_desc = { WDP_ALIGN_TBR, 22, 350, 36, - WC_BUILD_TOOLBAR, 0, + WC_BUILD_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _build_rail_widgets, BuildRailToolbWndProc diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 6b9806033..2d539f8c9 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -318,7 +318,7 @@ static const Widget _build_road_widgets[] = { static const WindowDesc _build_road_desc = { WDP_ALIGN_TBR, 22, 218, 36, - WC_BUILD_TOOLBAR, 0, + WC_BUILD_TOOLBAR, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _build_road_widgets, BuildRoadToolbWndProc @@ -352,7 +352,7 @@ static const Widget _build_road_scen_widgets[] = { static const WindowDesc _build_road_scen_desc = { WDP_AUTO, WDP_AUTO, 152, 36, - WC_SCEN_BUILD_ROAD, 0, + WC_SCEN_BUILD_ROAD, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _build_road_scen_widgets, BuildRoadToolbWndProc diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index e9e06d524..d9dd3bc98 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -327,7 +327,7 @@ static const Widget _roadveh_view_widgets[] = { static const WindowDesc _roadveh_view_desc = { WDP_AUTO, WDP_AUTO, 250, 116, - WC_VEHICLE_VIEW,0, + WC_VEHICLE_VIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _roadveh_view_widgets, RoadVehViewWndProc, diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 10389b23d..cefff603d 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -282,7 +282,7 @@ static const Widget _game_options_widgets[] = { static const WindowDesc _game_options_desc = { WDP_CENTER, WDP_CENTER, 370, 239, - WC_GAME_OPTIONS,0, + WC_GAME_OPTIONS, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _game_options_widgets, GameOptionsWndProc @@ -545,7 +545,7 @@ static const Widget _game_difficulty_widgets[] = { static const WindowDesc _game_difficulty_desc = { WDP_CENTER, WDP_CENTER, 370, 279, - WC_GAME_OPTIONS,0, + WC_GAME_OPTIONS, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _game_difficulty_widgets, GameDifficultyWndProc @@ -907,7 +907,7 @@ static const Widget _patches_selection_widgets[] = { static const WindowDesc _patches_selection_desc = { WDP_CENTER, WDP_CENTER, 370, 371, - WC_GAME_OPTIONS,0, + WC_GAME_OPTIONS, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _patches_selection_widgets, PatchesSelectionWndProc, @@ -1127,7 +1127,7 @@ static const Widget _cust_currency_widgets[] = { static const WindowDesc _cust_currency_desc = { WDP_CENTER, WDP_CENTER, 230, 120, - WC_CUSTOM_CURRENCY, 0, + WC_CUSTOM_CURRENCY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _cust_currency_widgets, CustCurrencyWndProc, diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp index 4176e9655..0215ec327 100644 --- a/src/ship_gui.cpp +++ b/src/ship_gui.cpp @@ -328,7 +328,7 @@ static const Widget _ship_view_widgets[] = { static const WindowDesc _ship_view_desc = { WDP_AUTO, WDP_AUTO, 250, 116, - WC_VEHICLE_VIEW,0, + WC_VEHICLE_VIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _ship_view_widgets, ShipViewWndProc diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index d63d5c250..038260f20 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -130,7 +130,7 @@ static const Widget _sign_list_widget[] = { static const WindowDesc _sign_list_desc = { WDP_AUTO, WDP_AUTO, 358, 138, - WC_SIGN_LIST,0, + WC_SIGN_LIST, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE, _sign_list_widget, SignListWndProc diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 65e040656..fa85017e8 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -970,7 +970,7 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e) static const WindowDesc _smallmap_desc = { WDP_AUTO, WDP_AUTO, 446, 314, - WC_SMALLMAP,0, + WC_SMALLMAP, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE, _smallmap_widgets, SmallMapWindowProc @@ -1083,7 +1083,7 @@ static void ExtraViewPortWndProc(Window *w, WindowEvent *e) static const WindowDesc _extra_view_port_desc = { WDP_AUTO, WDP_AUTO, 300, 268, - WC_EXTRA_VIEW_PORT,0, + WC_EXTRA_VIEW_PORT, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _extra_view_port_widgets, ExtraViewPortWndProc diff --git a/src/station_gui.cpp b/src/station_gui.cpp index fee50bba6..9e4bcccad 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -545,7 +545,7 @@ static const Widget _player_stations_widgets[] = { static const WindowDesc _player_stations_desc = { WDP_AUTO, WDP_AUTO, 358, 162, - WC_STATION_LIST,0, + WC_STATION_LIST, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE, _player_stations_widgets, PlayerStationsWndProc @@ -814,7 +814,7 @@ static void StationViewWndProc(Window *w, WindowEvent *e) static const WindowDesc _station_view_desc = { WDP_AUTO, WDP_AUTO, 249, 110, - WC_STATION_VIEW,0, + WC_STATION_VIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, _station_view_widgets, StationViewWndProc diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index a1b40ad90..bb2504982 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -163,7 +163,7 @@ static const Widget _subsidies_list_widgets[] = { static const WindowDesc _subsidies_list_desc = { WDP_AUTO, WDP_AUTO, 630, 127, - WC_SUBSIDIES_LIST,0, + WC_SUBSIDIES_LIST, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _subsidies_list_widgets, SubsidiesListWndProc diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index a71cb3cd5..ca8c75255 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -272,7 +272,7 @@ static const Widget _terraform_widgets[] = { static const WindowDesc _terraform_desc = { WDP_ALIGN_TBR, 22+36, 158, 36, - WC_SCEN_LAND_GEN, 0, + WC_SCEN_LAND_GEN, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _terraform_widgets, TerraformToolbWndProc diff --git a/src/town_gui.cpp b/src/town_gui.cpp index ee59f44fd..847e3d92f 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -212,7 +212,7 @@ static void TownAuthorityWndProc(Window *w, WindowEvent *e) static const WindowDesc _town_authority_desc = { WDP_AUTO, WDP_AUTO, 317, 222, - WC_TOWN_AUTHORITY,0, + WC_TOWN_AUTHORITY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _town_authority_widgets, TownAuthorityWndProc @@ -306,7 +306,7 @@ static const Widget _town_view_widgets[] = { static const WindowDesc _town_view_desc = { WDP_AUTO, WDP_AUTO, 260, 150, - WC_TOWN_VIEW,0, + WC_TOWN_VIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, _town_view_widgets, TownViewWndProc @@ -329,7 +329,7 @@ static const Widget _town_view_scen_widgets[] = { static const WindowDesc _town_view_scen_desc = { WDP_AUTO, WDP_AUTO, 260, 150, - WC_TOWN_VIEW,0, + WC_TOWN_VIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, _town_view_scen_widgets, TownViewWndProc @@ -506,7 +506,7 @@ static void TownDirectoryWndProc(Window *w, WindowEvent *e) static const WindowDesc _town_directory_desc = { WDP_AUTO, WDP_AUTO, 208, 202, - WC_TOWN_DIRECTORY,0, + WC_TOWN_DIRECTORY, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _town_directory_widgets, TownDirectoryWndProc diff --git a/src/train_gui.cpp b/src/train_gui.cpp index cff2edf20..c73051600 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -306,7 +306,7 @@ static void TrainViewWndProc(Window *w, WindowEvent *e) static const WindowDesc _train_view_desc = { WDP_AUTO, WDP_AUTO, 250, 134, - WC_VEHICLE_VIEW,0, + WC_VEHICLE_VIEW, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _train_view_widgets, TrainViewWndProc diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 10f9da671..22dced73e 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -104,6 +104,8 @@ void RebuildVehicleLists(void) WP(w, vehiclelist_d).l.flags |= VL_REBUILD; SetWindowDirty(w); break; + + default: break; } } } @@ -123,6 +125,8 @@ void ResortVehicleLists(void) WP(w, vehiclelist_d).l.flags |= VL_RESORT; SetWindowDirty(w); break; + + default: break; } } } @@ -1203,7 +1207,7 @@ void PlayerVehWndProc(Window *w, WindowEvent *e) static const WindowDesc _player_vehicle_list_train_desc = { WDP_AUTO, WDP_AUTO, 260, 182, - WC_TRAINS_LIST, 0, + WC_TRAINS_LIST, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _vehicle_list_widgets, PlayerVehWndProc @@ -1211,7 +1215,7 @@ static const WindowDesc _player_vehicle_list_train_desc = { static const WindowDesc _player_vehicle_list_road_veh_desc = { WDP_AUTO, WDP_AUTO, 260, 182, - WC_ROADVEH_LIST,0, + WC_ROADVEH_LIST, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _vehicle_list_widgets, PlayerVehWndProc @@ -1219,7 +1223,7 @@ static const WindowDesc _player_vehicle_list_road_veh_desc = { static const WindowDesc _player_vehicle_list_ship_desc = { WDP_AUTO, WDP_AUTO, 260, 182, - WC_SHIPS_LIST,0, + WC_SHIPS_LIST, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _vehicle_list_widgets, PlayerVehWndProc @@ -1227,7 +1231,7 @@ static const WindowDesc _player_vehicle_list_ship_desc = { static const WindowDesc _player_vehicle_list_aircraft_desc = { WDP_AUTO, WDP_AUTO, 260, 182, - WC_AIRCRAFT_LIST,0, + WC_AIRCRAFT_LIST, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, _vehicle_list_widgets, PlayerVehWndProc diff --git a/src/viewport.cpp b/src/viewport.cpp index 5be898e4c..c3420df5e 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2478,5 +2478,5 @@ void SetObjectToPlace(CursorID icon, SpriteID pal, byte mode, WindowClass window void ResetObjectToPlace(void) { - SetObjectToPlace(SPR_CURSOR_MOUSE, PAL_NONE, VHM_NONE, 0, 0); + SetObjectToPlace(SPR_CURSOR_MOUSE, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0); } -- cgit v1.2.3-54-g00ecf