changeset 5893:8547517ef719 draft

(svn r8511) -Codechange: make WindowClass an enumerated value.
author rubidium <rubidium@openttd.org>
date Thu, 01 Feb 2007 15:49:12 +0000
parents 64960d9ae9f3
children c4ab8176e02e
files src/aircraft_gui.cpp src/airport_gui.cpp src/autoreplace_gui.cpp src/build_vehicle_gui.cpp src/console.cpp src/depot_gui.cpp src/dock_gui.cpp src/engine_gui.cpp src/genworld.cpp src/genworld_gui.cpp src/graph_gui.cpp src/industry_gui.cpp src/intro_gui.cpp src/main_gui.cpp src/misc.cpp src/misc_gui.cpp src/music_gui.cpp src/network/network_gui.cpp src/newgrf_gui.cpp src/news_gui.cpp src/openttd.h src/order_cmd.cpp src/player_gui.cpp src/rail_gui.cpp src/road_gui.cpp src/roadveh_gui.cpp src/settings_gui.cpp src/ship_gui.cpp src/signs_gui.cpp src/smallmap_gui.cpp src/station_gui.cpp src/subsidy_gui.cpp src/terraform_gui.cpp src/town_gui.cpp src/train_gui.cpp src/vehicle_gui.cpp src/viewport.cpp
diffstat 37 files changed, 124 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/src/aircraft_gui.cpp
+++ b/src/aircraft_gui.cpp
@@ -358,7 +358,7 @@
 
 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
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -124,7 +124,7 @@
 
 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
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -575,7 +575,7 @@
 
 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_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_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
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -924,7 +924,7 @@
 
 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
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -199,7 +199,7 @@
 
 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,
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -88,7 +88,7 @@
 
 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 _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 _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 _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
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -208,7 +208,7 @@
 
 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
--- a/src/engine_gui.cpp
+++ b/src/engine_gui.cpp
@@ -107,7 +107,7 @@
 
 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
--- a/src/genworld.cpp
+++ b/src/genworld.cpp
@@ -84,7 +84,7 @@
 	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.
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -473,7 +473,7 @@
 
 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 _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 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 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
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -309,7 +309,7 @@
 
 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 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 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 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 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 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 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 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 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
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -190,7 +190,7 @@
 
 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_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_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_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_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_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_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_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 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 @@
 /* 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
--- a/src/intro_gui.cpp
+++ b/src/intro_gui.cpp
@@ -91,7 +91,7 @@
 
 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
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -340,7 +340,7 @@
 	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 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 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 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_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_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_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 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 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 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
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -100,7 +100,7 @@
 
 	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;
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -73,7 +73,7 @@
 
 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 @@
 		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 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 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 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 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 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 _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 @@
 	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 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
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -325,7 +325,7 @@
 
 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 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
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -545,7 +545,7 @@
 
 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 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 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 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 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 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
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -208,7 +208,7 @@
 
 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 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,
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -328,7 +328,7 @@
 
 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 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 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 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 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
--- a/src/openttd.h
+++ b/src/openttd.h
@@ -74,7 +74,6 @@
 assert_compile(sizeof(DestinationID) == sizeof(StationID));
 
 typedef int32 WindowNumber;
-typedef byte WindowClass;
 
 enum {
 	INVALID_YEAR = -1,
@@ -386,8 +385,9 @@
 } TileTypeProcs;
 
 
-enum {
-	WC_MAIN_WINDOW,
+enum WindowClass {
+	WC_NONE,
+	WC_MAIN_WINDOW = WC_NONE,
 	WC_MAIN_TOOLBAR,
 	WC_STATUS_BAR,
 	WC_BUILD_TOOLBAR,
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -1131,16 +1131,16 @@
 
 	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) {
--- a/src/player_gui.cpp
+++ b/src/player_gui.cpp
@@ -190,7 +190,7 @@
 
 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_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 _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_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 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 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 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 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 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 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 _endgame_desc = {
 	0, 0, 641, 481,
-	WC_ENDSCREEN,0,
+	WC_ENDSCREEN, WC_NONE,
 	0,
 	_highscore_widgets,
 	EndGameWndProc
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -577,7 +577,7 @@
 
 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
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -318,7 +318,7 @@
 
 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 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
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -327,7 +327,7 @@
 
 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,
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -282,7 +282,7 @@
 
 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 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 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 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,
--- a/src/ship_gui.cpp
+++ b/src/ship_gui.cpp
@@ -328,7 +328,7 @@
 
 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
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -130,7 +130,7 @@
 
 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
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -970,7 +970,7 @@
 
 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 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
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -545,7 +545,7 @@
 
 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 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
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -163,7 +163,7 @@
 
 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
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -272,7 +272,7 @@
 
 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
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -212,7 +212,7 @@
 
 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 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 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 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
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -306,7 +306,7 @@
 
 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
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -104,6 +104,8 @@
 				WP(w, vehiclelist_d).l.flags |= VL_REBUILD;
 				SetWindowDirty(w);
 				break;
+
+			default: break;
 		}
 	}
 }
@@ -123,6 +125,8 @@
 				WP(w, vehiclelist_d).l.flags |= VL_RESORT;
 				SetWindowDirty(w);
 				break;
+
+			default: break;
 		}
 	}
 }
@@ -1203,7 +1207,7 @@
 
 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_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_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_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
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -2478,5 +2478,5 @@
 
 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);
 }