diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -229,7 +229,7 @@ static const NWidgetPart _nested_ai_list /* Window definition for the ai list window. */ static const WindowDesc _ai_list_desc( - WDP_CENTER, WDP_CENTER, 200, 234, + WDP_CENTER, 200, 234, WC_AI_LIST, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_ai_list_widgets, lengthof(_nested_ai_list_widgets) @@ -437,7 +437,7 @@ static const NWidgetPart _nested_ai_sett /* Window definition for the AI settings window. */ static const WindowDesc _ai_settings_desc( - WDP_CENTER, WDP_CENTER, 500, 208, + WDP_CENTER, 500, 208, WC_AI_SETTINGS, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_ai_settings_widgets, lengthof(_nested_ai_settings_widgets) @@ -493,7 +493,7 @@ static const NWidgetPart _nested_ai_conf /* Window definition for the configure AI window. */ static const WindowDesc _ai_config_desc( - WDP_CENTER, WDP_CENTER, 300, 172, + WDP_CENTER, 300, 172, WC_GAME_OPTIONS, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_ai_config_widgets, lengthof(_nested_ai_config_widgets) @@ -959,7 +959,7 @@ static const NWidgetPart _nested_ai_debu }; static const WindowDesc _ai_debug_desc( - WDP_AUTO, WDP_AUTO, 299, 241, + WDP_AUTO, 299, 241, WC_AI_DEBUG, WC_NONE, 0, _nested_ai_debug_widgets, lengthof(_nested_ai_debug_widgets) diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -147,7 +147,7 @@ static const NWidgetPart _nested_air_too }; static const WindowDesc _air_toolbar_desc( - WDP_ALIGN_TOOLBAR, WDP_ALIGN_TOOLBAR, 64, 36, + WDP_ALIGN_TOOLBAR, 64, 36, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_air_toolbar_widgets, lengthof(_nested_air_toolbar_widgets) @@ -368,7 +368,7 @@ static const NWidgetPart _nested_build_a }; static const WindowDesc _build_airport_desc( - WDP_AUTO, WDP_AUTO, 148, 245, + WDP_AUTO, 148, 245, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_airport_widgets, lengthof(_nested_build_airport_widgets) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -530,7 +530,7 @@ static const NWidgetPart _nested_replace }; static const WindowDesc _replace_rail_vehicle_desc( - WDP_AUTO, WDP_AUTO, 456, 140, + WDP_AUTO, 456, 140, WC_REPLACE_VEHICLE, WC_NONE, WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_replace_rail_vehicle_widgets, lengthof(_nested_replace_rail_vehicle_widgets) @@ -561,7 +561,7 @@ static const NWidgetPart _nested_replace }; static const WindowDesc _replace_vehicle_desc( - WDP_AUTO, WDP_AUTO, 456, 118, + WDP_AUTO, 456, 118, WC_REPLACE_VEHICLE, WC_NONE, WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_replace_vehicle_widgets, lengthof(_nested_replace_vehicle_widgets) diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -335,7 +335,7 @@ static const NWidgetPart _nested_build_b /* Window definition for the rail bridge selection window */ static const WindowDesc _build_bridge_desc( - WDP_AUTO, WDP_AUTO, 200, 114, + WDP_AUTO, 200, 114, WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_bridge_widgets, lengthof(_nested_build_bridge_widgets) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1182,7 +1182,7 @@ struct BuildVehicleWindow : Window { }; static const WindowDesc _build_vehicle_desc( - WDP_AUTO, WDP_AUTO, 240, 268, + WDP_AUTO, 240, 268, WC_BUILD_VEHICLE, WC_NONE, WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_build_vehicle_widgets, lengthof(_nested_build_vehicle_widgets) diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -316,7 +316,7 @@ struct CheatWindow : Window { }; static const WindowDesc _cheats_desc( - WDP_AUTO, WDP_AUTO, 0, 0, + WDP_AUTO, 0, 0, WC_CHEATS, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_cheat_widgets, lengthof(_nested_cheat_widgets) diff --git a/src/company_gui.cpp b/src/company_gui.cpp --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -463,7 +463,7 @@ struct CompanyFinancesWindow : Window { Money CompanyFinancesWindow::max_money = INT32_MAX; static const WindowDesc _company_finances_desc( - WDP_AUTO, WDP_AUTO, 0, 0, + WDP_AUTO, 0, 0, WC_FINANCES, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_company_finances_widgets, lengthof(_nested_company_finances_widgets) @@ -816,7 +816,7 @@ static const NWidgetPart _nested_select_ }; static const WindowDesc _select_company_livery_desc( - WDP_AUTO, WDP_AUTO, 0, 0, + WDP_AUTO, 0, 0, WC_COMPANY_COLOUR, WC_NONE, 0, _nested_select_company_livery_widgets, lengthof(_nested_select_company_livery_widgets) @@ -1522,7 +1522,7 @@ const StringID SelectCompanyManagerFaceW /** Company manager face selection window description */ static const WindowDesc _select_company_manager_face_desc( - WDP_AUTO, WDP_AUTO, 190, 163, + WDP_AUTO, 190, 163, WC_COMPANY_MANAGER_FACE, WC_NONE, WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_select_company_manager_face_widgets, lengthof(_nested_select_company_manager_face_widgets) @@ -2008,7 +2008,7 @@ struct CompanyWindow : Window }; static const WindowDesc _company_desc( - WDP_AUTO, WDP_AUTO, 360, 170, + WDP_AUTO, 360, 170, WC_COMPANY, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_company_widgets, lengthof(_nested_company_widgets) @@ -2118,7 +2118,7 @@ static const NWidgetPart _nested_buy_com }; static const WindowDesc _buy_company_desc( - WDP_AUTO, WDP_AUTO, 334, 137, + WDP_AUTO, 334, 137, WC_BUY_COMPANY, WC_NONE, WDF_CONSTRUCTION, _nested_buy_company_widgets, lengthof(_nested_buy_company_widgets) diff --git a/src/console_gui.cpp b/src/console_gui.cpp --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -158,7 +158,7 @@ static const struct NWidgetPart _nested_ }; static const WindowDesc _console_window_desc( - WDP_MANUAL, WDP_MANUAL, 0, 0, + WDP_MANUAL, 0, 0, WC_CONSOLE, WC_NONE, 0, _nested_console_window_widgets, lengthof(_nested_console_window_widgets) diff --git a/src/date_gui.cpp b/src/date_gui.cpp --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -210,7 +210,7 @@ static const NWidgetPart _nested_set_dat }; static const WindowDesc _set_date_desc( - WDP_CENTER, WDP_CENTER, 0, 0, + WDP_CENTER, 0, 0, WC_SET_DATE, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_set_date_widgets, lengthof(_nested_set_date_widgets) diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -89,28 +89,28 @@ static const NWidgetPart _nested_train_d }; static const WindowDesc _train_depot_desc( - WDP_AUTO, WDP_AUTO, 362, 123, + WDP_AUTO, 362, 123, WC_VEHICLE_DEPOT, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets) ); static const WindowDesc _road_depot_desc( - WDP_AUTO, WDP_AUTO, 316, 97, + WDP_AUTO, 316, 97, WC_VEHICLE_DEPOT, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets) ); static const WindowDesc _ship_depot_desc( - WDP_AUTO, WDP_AUTO, 306, 99, + WDP_AUTO, 306, 99, WC_VEHICLE_DEPOT, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets) ); static const WindowDesc _aircraft_depot_desc( - WDP_AUTO, WDP_AUTO, 332, 99, + WDP_AUTO, 332, 99, WC_VEHICLE_DEPOT, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets) diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -279,7 +279,7 @@ static const NWidgetPart _nested_build_d }; static const WindowDesc _build_docks_toolbar_desc( - WDP_ALIGN_TOOLBAR, WDP_ALIGN_TOOLBAR, 160, 36, + WDP_ALIGN_TOOLBAR, 160, 36, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_build_docks_toolbar_widgets, lengthof(_nested_build_docks_toolbar_widgets) @@ -315,7 +315,7 @@ static const NWidgetPart _nested_build_d /** Window definition for the build docks in scenario editor window. */ static const WindowDesc _build_docks_scen_toolbar_desc( - WDP_AUTO, WDP_AUTO, 115, 36, + WDP_AUTO, 115, 36, WC_SCEN_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_build_docks_scen_toolbar_widgets, lengthof(_nested_build_docks_scen_toolbar_widgets) @@ -410,7 +410,7 @@ static const NWidgetPart _nested_build_d }; static const WindowDesc _build_dock_station_desc( - WDP_AUTO, WDP_AUTO, 148, 75, + WDP_AUTO, 148, 75, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_dock_station_widgets, lengthof(_nested_build_dock_station_widgets) @@ -494,7 +494,7 @@ static const NWidgetPart _nested_build_d }; static const WindowDesc _build_docks_depot_desc( - WDP_AUTO, WDP_AUTO, 204, 86, + WDP_AUTO, 204, 86, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_docks_depot_widgets, lengthof(_nested_build_docks_depot_widgets) diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -121,7 +121,7 @@ struct EnginePreviewWindow : Window { }; static const WindowDesc _engine_preview_desc( - WDP_CENTER, WDP_CENTER, 300, 192, + WDP_CENTER, 300, 192, WC_ENGINE_PREVIEW, WC_NONE, WDF_CONSTRUCTION, _nested_engine_preview_widgets, lengthof(_nested_engine_preview_widgets) diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -744,14 +744,14 @@ struct GenerateLandscapeWindow : public }; static const WindowDesc _generate_landscape_desc( - WDP_CENTER, WDP_CENTER, 338, 313, + WDP_CENTER, 338, 313, WC_GENERATE_LANDSCAPE, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_generate_landscape_widgets, lengthof(_nested_generate_landscape_widgets) ); static const WindowDesc _heightmap_load_desc( - WDP_CENTER, WDP_CENTER, 338, 236, + WDP_CENTER, 338, 236, WC_GENERATE_LANDSCAPE, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_heightmap_load_widgets, lengthof(_nested_heightmap_load_widgets) @@ -1057,7 +1057,7 @@ static const NWidgetPart _nested_create_ }; static const WindowDesc _create_scenario_desc( - WDP_CENTER, WDP_CENTER, 338, 170, + WDP_CENTER, 338, 170, WC_GENERATE_LANDSCAPE, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_create_scenario_widgets, lengthof(_nested_create_scenario_widgets) @@ -1090,7 +1090,7 @@ static const NWidgetPart _nested_generat static const WindowDesc _generate_progress_desc( - WDP_CENTER, WDP_CENTER, 181, 97, + WDP_CENTER, 181, 97, WC_GENERATE_PROGRESS_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_generate_progress_widgets, lengthof(_nested_generate_progress_widgets) diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -140,7 +140,7 @@ static const NWidgetPart _nested_graph_l }; static const WindowDesc _graph_legend_desc( - WDP_AUTO, WDP_AUTO, 250, 196, + WDP_AUTO, 250, 196, WC_GRAPH_LEGEND, WC_NONE, 0, _nested_graph_legend_widgets, lengthof(_nested_graph_legend_widgets) @@ -603,7 +603,7 @@ static const NWidgetPart _nested_operati }; static const WindowDesc _operating_profit_desc( - WDP_AUTO, WDP_AUTO, 576, 174, + WDP_AUTO, 576, 174, WC_OPERATING_PROFIT, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_operating_profit_widgets, lengthof(_nested_operating_profit_widgets) @@ -644,7 +644,7 @@ static const NWidgetPart _nested_income_ static const WindowDesc _income_graph_desc( - WDP_AUTO, WDP_AUTO, 576, 142, + WDP_AUTO, 576, 142, WC_INCOME_GRAPH, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_income_graph_widgets, lengthof(_nested_income_graph_widgets) @@ -682,7 +682,7 @@ static const NWidgetPart _nested_deliver }; static const WindowDesc _delivered_cargo_graph_desc( - WDP_AUTO, WDP_AUTO, 576, 142, + WDP_AUTO, 576, 142, WC_DELIVERED_CARGO, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_delivered_cargo_graph_widgets, lengthof(_nested_delivered_cargo_graph_widgets) @@ -734,7 +734,7 @@ static const NWidgetPart _nested_perform }; static const WindowDesc _performance_history_desc( - WDP_AUTO, WDP_AUTO, 576, 238, + WDP_AUTO, 576, 238, WC_PERFORMANCE_HISTORY, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_performance_history_widgets, lengthof(_nested_performance_history_widgets) @@ -772,7 +772,7 @@ static const NWidgetPart _nested_company }; static const WindowDesc _company_value_graph_desc( - WDP_AUTO, WDP_AUTO, 576, 238, + WDP_AUTO, 576, 238, WC_COMPANY_VALUE, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_company_value_graph_widgets, lengthof(_nested_company_value_graph_widgets) @@ -943,7 +943,7 @@ static const NWidgetPart _nested_cargo_p }; static const WindowDesc _cargo_payment_rates_desc( - WDP_AUTO, WDP_AUTO, 568, 46, + WDP_AUTO, 568, 46, WC_PAYMENT_RATES, WC_NONE, 0, _nested_cargo_payment_rates_widgets, lengthof(_nested_cargo_payment_rates_widgets) @@ -1123,7 +1123,7 @@ static const NWidgetPart _nested_company }; static const WindowDesc _company_league_desc( - WDP_AUTO, WDP_AUTO, 400, 167, + WDP_AUTO, 400, 167, WC_COMPANY_LEAGUE, WC_NONE, 0, _nested_company_league_widgets, lengthof(_nested_company_league_widgets) @@ -1461,7 +1461,7 @@ static const NWidgetPart _nested_perform }; static const WindowDesc _performance_rating_detail_desc( - WDP_AUTO, WDP_AUTO, 299, 241, + WDP_AUTO, 299, 241, WC_PERFORMANCE_DETAIL, WC_NONE, 0, _nested_performance_rating_detail_widgets, lengthof(_nested_performance_rating_detail_widgets) diff --git a/src/group_gui.cpp b/src/group_gui.cpp --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -679,14 +679,14 @@ public: static WindowDesc _other_group_desc( - WDP_AUTO, WDP_AUTO, 460, 246, + WDP_AUTO, 460, 246, WC_INVALID, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_group_widgets, lengthof(_nested_group_widgets) ); const static WindowDesc _train_group_desc( - WDP_AUTO, WDP_AUTO, 525, 246, + WDP_AUTO, 525, 246, WC_TRAINS_LIST, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_group_widgets, lengthof(_nested_group_widgets) diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -179,14 +179,14 @@ static const NWidgetPart _nested_highsco }; static const WindowDesc _highscore_desc( - WDP_MANUAL, WDP_MANUAL, 641, 481, + WDP_MANUAL, 641, 481, WC_HIGHSCORE, WC_NONE, 0, _nested_highscore_widgets, lengthof(_nested_highscore_widgets) ); static const WindowDesc _endgame_desc( - WDP_MANUAL, WDP_MANUAL, 641, 481, + WDP_MANUAL, 641, 481, WC_ENDSCREEN, WC_NONE, 0, _nested_highscore_widgets, lengthof(_nested_highscore_widgets) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -122,7 +122,7 @@ static const NWidgetPart _nested_build_i /** Window definition of the dynamic place industries gui */ static const WindowDesc _build_industry_desc( - WDP_AUTO, WDP_AUTO, 170, 212, + WDP_AUTO, 170, 212, WC_BUILD_INDUSTRY, WC_NONE, WDF_CONSTRUCTION, _nested_build_industry_widgets, lengthof(_nested_build_industry_widgets) @@ -811,7 +811,7 @@ static const NWidgetPart _nested_industr /** Window definition of the view industy gui */ static const WindowDesc _industry_view_desc( - WDP_AUTO, WDP_AUTO, 260, 120, + WDP_AUTO, 260, 120, WC_INDUSTRY_VIEW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_industry_view_widgets, lengthof(_nested_industry_view_widgets) @@ -1180,7 +1180,7 @@ const StringID IndustryDirectoryWindow:: /** Window definition of the industy directory gui */ static const WindowDesc _industry_directory_desc( - WDP_AUTO, WDP_AUTO, 428, 190, + WDP_AUTO, 428, 190, WC_INDUSTRY_DIRECTORY, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_industry_directory_widgets, lengthof(_nested_industry_directory_widgets) diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -248,7 +248,7 @@ static const NWidgetPart _nested_select_ }; static const WindowDesc _select_game_desc( - WDP_CENTER, WDP_CENTER, 336, 213, + WDP_CENTER, 336, 213, WC_SELECT_GAME, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_select_game_widgets, lengthof(_nested_select_game_widgets) diff --git a/src/main_gui.cpp b/src/main_gui.cpp --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -200,7 +200,7 @@ static const struct NWidgetPart _nested_ }; static const WindowDesc _main_window_desc( - WDP_MANUAL, WDP_MANUAL, 0, 0, + WDP_MANUAL, 0, 0, WC_MAIN_WINDOW, WC_NONE, 0, _nested_main_window_widgets, lengthof(_nested_main_window_widgets) diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -70,7 +70,7 @@ static const NWidgetPart _nested_land_in }; static const WindowDesc _land_info_desc( - WDP_AUTO, WDP_AUTO, 0, 0, + WDP_AUTO, 0, 0, WC_LAND_INFO, WC_NONE, 0, _nested_land_info_widgets, lengthof(_nested_land_info_widgets) @@ -340,7 +340,7 @@ static const NWidgetPart _nested_about_w }; static const WindowDesc _about_desc( - WDP_CENTER, WDP_CENTER, 0, 0, + WDP_CENTER, 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, _nested_about_widgets, lengthof(_nested_about_widgets) @@ -497,7 +497,7 @@ static const NWidgetPart _nested_errmsg_ }; static const WindowDesc _errmsg_desc( - WDP_MANUAL, WDP_MANUAL, 240, 46, + WDP_MANUAL, 240, 46, WC_ERRMSG, WC_NONE, 0, _nested_errmsg_widgets, lengthof(_nested_errmsg_widgets) @@ -517,7 +517,7 @@ static const NWidgetPart _nested_errmsg_ }; static const WindowDesc _errmsg_face_desc( - WDP_MANUAL, WDP_MANUAL, 334, 137, + WDP_MANUAL, 334, 137, WC_ERRMSG, WC_NONE, 0, _nested_errmsg_face_widgets, lengthof(_nested_errmsg_face_widgets) @@ -764,7 +764,7 @@ static const NWidgetPart _nested_tooltip }; static const WindowDesc _tool_tips_desc( - WDP_MANUAL, WDP_MANUAL, 0, 0, // Coordinates and sizes are not used, + WDP_MANUAL, 0, 0, // Coordinates and sizes are not used, WC_TOOLTIPS, WC_NONE, 0, _nested_tooltips_widgets, lengthof(_nested_tooltips_widgets) @@ -1428,7 +1428,7 @@ static const NWidgetPart _nested_query_s }; static const WindowDesc _query_string_desc( - WDP_AUTO, WDP_AUTO, 260, 42, + WDP_AUTO, 260, 42, WC_QUERY_STRING, WC_NONE, 0, _nested_query_string_widgets, lengthof(_nested_query_string_widgets) @@ -1581,7 +1581,7 @@ static const NWidgetPart _nested_query_w }; static const WindowDesc _query_desc( - WDP_CENTER, WDP_CENTER, 210, 82, + WDP_CENTER, 210, 82, WC_CONFIRM_POPUP_QUERY, WC_NONE, WDF_UNCLICK_BUTTONS | WDF_MODAL, _nested_query_widgets, lengthof(_nested_query_widgets) @@ -2022,14 +2022,14 @@ public: }; static const WindowDesc _load_dialog_desc( - WDP_CENTER, WDP_CENTER, 257, 294, + WDP_CENTER, 257, 294, WC_SAVELOAD, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_load_dialog_widgets, lengthof(_nested_load_dialog_widgets) ); static const WindowDesc _save_dialog_desc( - WDP_CENTER, WDP_CENTER, 257, 320, + WDP_CENTER, 257, 320, WC_SAVELOAD, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_save_dialog_widgets, lengthof(_nested_save_dialog_widgets) diff --git a/src/music_gui.cpp b/src/music_gui.cpp --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -409,7 +409,7 @@ static const NWidgetPart _nested_music_t }; static const WindowDesc _music_track_selection_desc( - WDP_AUTO, WDP_AUTO, 432, 218, + WDP_AUTO, 432, 218, WC_MUSIC_TRACK_SELECTION, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_music_track_selection_widgets, lengthof(_nested_music_track_selection_widgets) @@ -713,7 +713,7 @@ static const NWidgetPart _nested_music_w }; static const WindowDesc _music_window_desc( - WDP_AUTO, WDP_AUTO, 300, 66, + WDP_AUTO, 300, 66, WC_MUSIC_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_music_window_widgets, lengthof(_nested_music_window_widgets) diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -543,7 +543,7 @@ static const NWidgetPart _nested_chat_wi }; static const WindowDesc _chat_window_desc( - WDP_MANUAL, WDP_MANUAL, 640, 14, // x, y, width, height + WDP_MANUAL, 640, 14, // x, y, width, height WC_SEND_NETWORK_MSG, WC_NONE, 0, _nested_chat_window_widgets, lengthof(_nested_chat_window_widgets) diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -46,7 +46,7 @@ static const NWidgetPart _nested_network /** Window description for the download window */ static const WindowDesc _network_content_download_status_window_desc( - WDP_CENTER, WDP_CENTER, 350, 85, + WDP_CENTER, 350, 85, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, _nested_network_content_download_status_window_widgets, lengthof(_nested_network_content_download_status_window_widgets) @@ -866,7 +866,7 @@ static const NWidgetPart _nested_network /** Window description of the content list */ static const WindowDesc _network_content_list_desc( - WDP_CENTER, WDP_CENTER, 630, 460, + WDP_CENTER, 630, 460, WC_NETWORK_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_network_content_list_widgets, lengthof(_nested_network_content_list_widgets) diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1000,7 +1000,7 @@ static const NWidgetPart _nested_network }; static const WindowDesc _network_game_window_desc( - WDP_CENTER, WDP_CENTER, 1000, 730, + WDP_CENTER, 1000, 730, WC_NETWORK_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_network_game_widgets, lengthof(_nested_network_game_widgets) @@ -1425,7 +1425,7 @@ static const NWidgetPart _nested_network }; static const WindowDesc _network_start_server_window_desc( - WDP_CENTER, WDP_CENTER, 420, 244, + WDP_CENTER, 420, 244, WC_NETWORK_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_network_start_server_window_widgets, lengthof(_nested_network_start_server_window_widgets) @@ -1722,7 +1722,7 @@ static const NWidgetPart _nested_network }; static const WindowDesc _network_lobby_window_desc( - WDP_CENTER, WDP_CENTER, 0, 0, + WDP_CENTER, 0, 0, WC_NETWORK_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_network_lobby_window_widgets, lengthof(_nested_network_lobby_window_widgets) @@ -1765,7 +1765,7 @@ static const NWidgetPart _nested_client_ }; static const WindowDesc _client_list_popup_desc( - WDP_AUTO, WDP_AUTO, 150, 1, + WDP_AUTO, 150, 1, WC_TOOLBAR_MENU, WC_CLIENT_LIST, 0, _nested_client_list_popup_widgets, lengthof(_nested_client_list_popup_widgets) @@ -1978,7 +1978,7 @@ static const NWidgetPart _nested_client_ }; static const WindowDesc _client_list_desc( - WDP_AUTO, WDP_AUTO, 250, 16, + WDP_AUTO, 250, 16, WC_CLIENT_LIST, WC_NONE, 0, _nested_client_list_widgets, lengthof(_nested_client_list_widgets) @@ -2259,7 +2259,7 @@ static const NWidgetPart _nested_network }; static const WindowDesc _network_join_status_window_desc( - WDP_CENTER, WDP_CENTER, 250, 85, + WDP_CENTER, 250, 85, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, _nested_network_join_status_window_widgets, lengthof(_nested_network_join_status_window_widgets) @@ -2382,7 +2382,7 @@ static const NWidgetPart _nested_network }; static const WindowDesc _network_company_password_window_desc( - WDP_AUTO, WDP_AUTO, 300, 63, + WDP_AUTO, 300, 63, WC_COMPANY_PASSWORD_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_network_company_password_window_widgets, lengthof(_nested_network_company_password_window_widgets) diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -481,7 +481,7 @@ static const NWidgetPart _nested_newgrf_ /* Window definition for the add a newgrf window */ static const WindowDesc _newgrf_add_dlg_desc( - WDP_CENTER, WDP_CENTER, 306, 347, + WDP_CENTER, 306, 347, WC_SAVELOAD, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_newgrf_add_dlg_widgets, lengthof(_nested_newgrf_add_dlg_widgets) @@ -1038,7 +1038,7 @@ static const NWidgetPart _nested_newgrf_ /* Window definition of the manage newgrfs window */ static const WindowDesc _newgrf_desc( - WDP_CENTER, WDP_CENTER, 300, 263, + WDP_CENTER, 300, 263, WC_GAME_OPTIONS, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_newgrf_widgets, lengthof(_nested_newgrf_widgets) diff --git a/src/news_gui.cpp b/src/news_gui.cpp --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -106,7 +106,7 @@ static const NWidgetPart _nested_normal_ }; static const WindowDesc _normal_news_desc( - WDP_MANUAL, WDP_MANUAL, 430, 170, + WDP_MANUAL, 430, 170, WC_NEWS_WINDOW, WC_NONE, 0, _nested_normal_news_widgets, lengthof(_nested_normal_news_widgets) @@ -133,7 +133,7 @@ static const NWidgetPart _nested_vehicle }; static const WindowDesc _vehicle_news_desc( - WDP_MANUAL, WDP_MANUAL, 430, 170, + WDP_MANUAL, 430, 170, WC_NEWS_WINDOW, WC_NONE, 0, _nested_vehicle_news_widgets, lengthof(_nested_vehicle_news_widgets) @@ -164,7 +164,7 @@ static const NWidgetPart _nested_company }; static const WindowDesc _company_news_desc( - WDP_MANUAL, WDP_MANUAL, 430, 170, + WDP_MANUAL, 430, 170, WC_NEWS_WINDOW, WC_NONE, 0, _nested_company_news_widgets, lengthof(_nested_company_news_widgets) @@ -187,7 +187,7 @@ static const NWidgetPart _nested_thin_ne }; static const WindowDesc _thin_news_desc( - WDP_MANUAL, WDP_MANUAL, 430, 130, + WDP_MANUAL, 430, 130, WC_NEWS_WINDOW, WC_NONE, 0, _nested_thin_news_widgets, lengthof(_nested_thin_news_widgets) @@ -211,7 +211,7 @@ static const NWidgetPart _nested_small_n }; static const WindowDesc _small_news_desc( - WDP_MANUAL, WDP_MANUAL, 280, 87, + WDP_MANUAL, 280, 87, WC_NEWS_WINDOW, WC_NONE, 0, _nested_small_news_widgets, lengthof(_nested_small_news_widgets) @@ -1030,7 +1030,7 @@ static const NWidgetPart _nested_message }; static const WindowDesc _message_history_desc( - WDP_AUTO, WDP_AUTO, 400, 140, + WDP_AUTO, 400, 140, WC_MESSAGE_HISTORY, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_message_history, lengthof(_nested_message_history) @@ -1316,7 +1316,7 @@ static const NWidgetPart _nested_message }; static const WindowDesc _message_options_desc( - WDP_AUTO, WDP_AUTO, 0, 0, + WDP_AUTO, 0, 0, WC_GAME_OPTIONS, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_message_options_widgets, lengthof(_nested_message_options_widgets) diff --git a/src/order_gui.cpp b/src/order_gui.cpp --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -1336,7 +1336,7 @@ static const NWidgetPart _nested_orders_ }; static const WindowDesc _orders_train_desc( - WDP_AUTO, WDP_AUTO, 384, 100, + WDP_AUTO, 384, 100, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, 0, _nested_orders_train_widgets, lengthof(_nested_orders_train_widgets) @@ -1400,7 +1400,7 @@ static const NWidgetPart _nested_orders_ }; static const WindowDesc _orders_desc( - WDP_AUTO, WDP_AUTO, 384, 100, + WDP_AUTO, 384, 100, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, 0, _nested_orders_widgets, lengthof(_nested_orders_widgets) @@ -1426,7 +1426,7 @@ static const NWidgetPart _nested_other_o }; static const WindowDesc _other_orders_desc( - WDP_AUTO, WDP_AUTO, 384, 86, + WDP_AUTO, 384, 86, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_other_orders_widgets, lengthof(_nested_other_orders_widgets) diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -384,7 +384,7 @@ static const NWidgetPart _nested_osk_wid }; static const WindowDesc _osk_desc( - WDP_CENTER, WDP_CENTER, 256, 140, + WDP_CENTER, 256, 140, WC_OSK, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_osk_widgets, lengthof(_nested_osk_widgets) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -856,7 +856,7 @@ static const NWidgetPart _nested_build_r }; static const WindowDesc _build_rail_desc( - WDP_ALIGN_TOOLBAR, WDP_ALIGN_TOOLBAR, 350, 36, + WDP_ALIGN_TOOLBAR, 350, 36, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_build_rail_widgets, lengthof(_nested_build_rail_widgets) @@ -1461,7 +1461,7 @@ static const NWidgetPart _nested_newstat /** High level window description of the default station-build window */ static const WindowDesc _station_builder_desc( - WDP_AUTO, WDP_AUTO, 148, 200, + WDP_AUTO, 148, 200, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_station_builder_widgets, lengthof(_nested_station_builder_widgets) @@ -1469,7 +1469,7 @@ static const WindowDesc _station_builder /** High level window description of the newGRF station-build window */ static const WindowDesc _newstation_builder_desc( - WDP_AUTO, WDP_AUTO, 148, 290, + WDP_AUTO, 148, 290, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_newstation_builder_widgets, lengthof(_nested_newstation_builder_widgets) @@ -1674,7 +1674,7 @@ static const NWidgetPart _nested_signal_ /** Signal selection window description */ static const WindowDesc _signal_builder_desc( - WDP_AUTO, WDP_AUTO, 154, 68, + WDP_AUTO, 154, 68, WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR, WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_signal_builder_widgets, lengthof(_nested_signal_builder_widgets) @@ -1764,7 +1764,7 @@ static const NWidgetPart _nested_build_d }; static const WindowDesc _build_depot_desc( - WDP_AUTO, WDP_AUTO, 140, 122, + WDP_AUTO, 140, 122, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_depot_widgets, lengthof(_nested_build_depot_widgets) @@ -1864,7 +1864,7 @@ static const NWidgetPart _nested_build_w }; static const WindowDesc _build_waypoint_desc( - WDP_AUTO, WDP_AUTO, 344, 92, + WDP_AUTO, 344, 92, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_waypoint_widgets, lengthof(_nested_build_waypoint_widgets) diff --git a/src/road_gui.cpp b/src/road_gui.cpp --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -661,7 +661,7 @@ static const NWidgetPart _nested_build_r }; static const WindowDesc _build_road_desc( - WDP_ALIGN_TOOLBAR, WDP_ALIGN_TOOLBAR, 263, 36, + WDP_ALIGN_TOOLBAR, 263, 36, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_build_road_widgets, lengthof(_nested_build_road_widgets) @@ -700,7 +700,7 @@ static const NWidgetPart _nested_build_t }; static const WindowDesc _build_tramway_desc( - WDP_ALIGN_TOOLBAR, WDP_ALIGN_TOOLBAR, 241, 36, + WDP_ALIGN_TOOLBAR, 241, 36, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_build_tramway_widgets, lengthof(_nested_build_tramway_widgets) @@ -743,7 +743,7 @@ static const NWidgetPart _nested_build_r }; static const WindowDesc _build_road_scen_desc( - WDP_AUTO, WDP_AUTO, 197, 36, + WDP_AUTO, 197, 36, WC_SCEN_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_build_road_scen_widgets, lengthof(_nested_build_road_scen_widgets) @@ -841,7 +841,7 @@ static const NWidgetPart _nested_build_r }; static const WindowDesc _build_road_depot_desc( - WDP_AUTO, WDP_AUTO, 140, 122, + WDP_AUTO, 140, 122, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_road_depot_widgets, lengthof(_nested_build_road_depot_widgets) @@ -1010,7 +1010,7 @@ static const NWidgetPart _nested_rv_stat }; static const WindowDesc _rv_station_picker_desc( - WDP_AUTO, WDP_AUTO, 207, 178, + WDP_AUTO, 207, 178, WC_BUS_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_rv_station_picker_widgets, lengthof(_nested_rv_station_picker_widgets) diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -476,7 +476,7 @@ static const NWidgetPart _nested_game_op }; static const WindowDesc _game_options_desc( - WDP_CENTER, WDP_CENTER, 370, 249, + WDP_CENTER, 370, 249, WC_GAME_OPTIONS, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_game_options_widgets, lengthof(_nested_game_options_widgets) @@ -750,7 +750,7 @@ static const NWidgetPart _nested_game_di /** Window definition for the game difficulty settings window */ static const WindowDesc _game_difficulty_desc( - WDP_CENTER, WDP_CENTER, 370, 279, + WDP_CENTER, 370, 279, WC_GAME_OPTIONS, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_game_difficulty_widgets, lengthof(_nested_game_difficulty_widgets) @@ -1644,7 +1644,7 @@ static const NWidgetPart _nested_setting }; static const WindowDesc _settings_selection_desc( - WDP_CENTER, WDP_CENTER, 450, 397, + WDP_CENTER, 450, 397, WC_GAME_OPTIONS, WC_NONE, 0, _nested_settings_selection_widgets, lengthof(_nested_settings_selection_widgets) @@ -1923,7 +1923,7 @@ static const NWidgetPart _nested_cust_cu }; static const WindowDesc _cust_currency_desc( - WDP_CENTER, WDP_CENTER, 230, 120, + WDP_CENTER, 230, 120, WC_CUSTOM_CURRENCY, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_cust_currency_widgets, lengthof(_nested_cust_currency_widgets) diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -213,7 +213,7 @@ static const NWidgetPart _nested_sign_li }; static const WindowDesc _sign_list_desc( - WDP_AUTO, WDP_AUTO, 358, 138, + WDP_AUTO, 358, 138, WC_SIGN_LIST, WC_NONE, 0, _nested_sign_list_widgets, lengthof(_nested_sign_list_widgets) @@ -408,7 +408,7 @@ static const NWidgetPart _nested_query_s }; static const WindowDesc _query_sign_edit_desc( - WDP_AUTO, WDP_AUTO, 260, 42, + WDP_AUTO, 260, 42, WC_QUERY_STRING, WC_NONE, WDF_CONSTRUCTION | WDF_UNCLICK_BUTTONS, _nested_query_sign_edit_widgets, lengthof(_nested_query_sign_edit_widgets) diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1145,7 +1145,7 @@ SmallMapWindow::SmallMapType SmallMapWin bool SmallMapWindow::show_towns = true; static const WindowDesc _smallmap_desc( - WDP_AUTO, WDP_AUTO, 446, 314, + WDP_AUTO, 446, 314, WC_SMALLMAP, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_smallmap_widgets, lengthof(_nested_smallmap_widgets) diff --git a/src/station_gui.cpp b/src/station_gui.cpp --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -707,7 +707,7 @@ static const NWidgetPart _nested_company }; static const WindowDesc _company_stations_desc( - WDP_AUTO, WDP_AUTO, 358, 162, + WDP_AUTO, 358, 162, WC_STATION_LIST, WC_NONE, 0, _nested_company_stations_widgets, lengthof(_nested_company_stations_widgets) @@ -1165,7 +1165,7 @@ struct StationViewWindow : public Window static const WindowDesc _station_view_desc( - WDP_AUTO, WDP_AUTO, 249, 110, + WDP_AUTO, 249, 110, WC_STATION_VIEW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_station_view_widgets, lengthof(_nested_station_view_widgets) @@ -1412,7 +1412,7 @@ struct SelectStationWindow : Window { }; static const WindowDesc _select_station_desc( - WDP_AUTO, WDP_AUTO, 200, 180, + WDP_AUTO, 200, 180, WC_SELECT_STATION, WC_NONE, WDF_CONSTRUCTION, _nested_select_station_widgets, lengthof(_nested_select_station_widgets) diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -235,7 +235,7 @@ static const NWidgetPart _nested_main_st }; static const WindowDesc _main_status_desc( - WDP_MANUAL, WDP_MANUAL, 640, 12, + WDP_MANUAL, 640, 12, WC_STATUS_BAR, WC_NONE, WDF_UNCLICK_BUTTONS | WDF_NO_FOCUS, _nested_main_status_widgets, lengthof(_nested_main_status_widgets) diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -242,7 +242,7 @@ static const NWidgetPart _nested_subsidi }; static const WindowDesc _subsidies_list_desc( - WDP_AUTO, WDP_AUTO, 500, 127, + WDP_AUTO, 500, 127, WC_SUBSIDIES_LIST, WC_NONE, 0, _nested_subsidies_list_widgets, lengthof(_nested_subsidies_list_widgets) diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -345,7 +345,7 @@ static const NWidgetPart _nested_terrafo }; static const WindowDesc _terraform_desc( - WDP_MANUAL, WDP_MANUAL, 158, 36, + WDP_MANUAL, 158, 36, WC_SCEN_LAND_GEN, WC_NONE, WDF_CONSTRUCTION, _nested_terraform_widgets, lengthof(_nested_terraform_widgets) @@ -773,7 +773,7 @@ struct ScenarioEditorLandscapeGeneration }; static const WindowDesc _scen_edit_land_gen_desc( - WDP_AUTO, WDP_AUTO, 163, 103, + WDP_AUTO, 163, 103, WC_SCEN_LAND_GEN, WC_NONE, WDF_CONSTRUCTION, _nested_scen_edit_land_gen_widgets, lengthof(_nested_scen_edit_land_gen_widgets) diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -635,7 +635,7 @@ static const NWidgetPart _nested_timetab }; static const WindowDesc _timetable_desc( - WDP_AUTO, WDP_AUTO, 400, 130, + WDP_AUTO, 400, 130, WC_VEHICLE_TIMETABLE, WC_VEHICLE_VIEW, WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_timetable_widgets, lengthof(_nested_timetable_widgets) diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1376,7 +1376,7 @@ static const NWidgetPart _nested_toolbar }; static const WindowDesc _toolb_normal_desc( - WDP_MANUAL, WDP_MANUAL, 640, 22, + WDP_MANUAL, 640, 22, WC_MAIN_TOOLBAR, WC_NONE, WDF_NO_FOCUS, _nested_toolbar_normal_widgets, lengthof(_nested_toolbar_normal_widgets) @@ -1599,7 +1599,7 @@ static const NWidgetPart _nested_toolb_s }; static const WindowDesc _toolb_scen_desc( - WDP_MANUAL, WDP_MANUAL, 640, 22, + WDP_MANUAL, 640, 22, WC_MAIN_TOOLBAR, WC_NONE, WDF_UNCLICK_BUTTONS | WDF_NO_FOCUS, _nested_toolb_scen_widgets, lengthof(_nested_toolb_scen_widgets) diff --git a/src/town_gui.cpp b/src/town_gui.cpp --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -282,7 +282,7 @@ public: }; static const WindowDesc _town_authority_desc( - WDP_AUTO, WDP_AUTO, 317, 222, + WDP_AUTO, 317, 222, WC_TOWN_AUTHORITY, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_town_authority_widgets, lengthof(_nested_town_authority_widgets) @@ -540,7 +540,7 @@ static const NWidgetPart _nested_town_ga }; static const WindowDesc _town_game_view_desc( - WDP_AUTO, WDP_AUTO, 260, TownViewWindow::TVW_HEIGHT_NORMAL, + WDP_AUTO, 260, TownViewWindow::TVW_HEIGHT_NORMAL, WC_TOWN_VIEW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_town_game_view_widgets, lengthof(_nested_town_game_view_widgets) @@ -570,7 +570,7 @@ static const NWidgetPart _nested_town_ed }; static const WindowDesc _town_editor_view_desc( - WDP_AUTO, WDP_AUTO, 260, TownViewWindow::TVW_HEIGHT_NORMAL, + WDP_AUTO, 260, TownViewWindow::TVW_HEIGHT_NORMAL, WC_TOWN_VIEW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_town_editor_view_widgets, lengthof(_nested_town_editor_view_widgets) @@ -856,7 +856,7 @@ GUITownList::SortFunction * const TownDi }; static const WindowDesc _town_directory_desc( - WDP_AUTO, WDP_AUTO, 208, 202, + WDP_AUTO, 208, 202, WC_TOWN_DIRECTORY, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_town_directory_widgets, lengthof(_nested_town_directory_widgets) @@ -1141,7 +1141,7 @@ public: }; static const WindowDesc _found_town_desc( - WDP_AUTO, WDP_AUTO, 160, 162, + WDP_AUTO, 160, 162, WC_FOUND_TOWN, WC_NONE, WDF_CONSTRUCTION, _nested_found_town_widgets, lengthof(_nested_found_town_widgets) diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -156,7 +156,7 @@ static const NWidgetPart _nested_transpa }; static const WindowDesc _transparency_desc( - WDP_MANUAL, WDP_MANUAL, 219, 49, + WDP_MANUAL, 219, 49, WC_TRANSPARENCY_TOOLBAR, WC_NONE, 0, _nested_transparency_widgets, lengthof(_nested_transparency_widgets) diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -225,7 +225,7 @@ static const NWidgetPart _nested_build_t }; static const WindowDesc _build_trees_desc( - WDP_AUTO, WDP_AUTO, 143, 184, + WDP_AUTO, 143, 184, WC_BUILD_TREES, WC_NONE, WDF_CONSTRUCTION, _nested_build_trees_widgets, lengthof(_nested_build_trees_widgets) diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -445,7 +445,7 @@ static const NWidgetPart _nested_vehicle }; static const WindowDesc _vehicle_refit_desc( - WDP_AUTO, WDP_AUTO, 240, 174, + WDP_AUTO, 240, 174, WC_VEHICLE_REFIT, WC_VEHICLE_VIEW, WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_vehicle_refit_widgets, lengthof(_nested_vehicle_refit_widgets) @@ -1191,7 +1191,7 @@ public: }; static WindowDesc _vehicle_list_desc( - WDP_AUTO, WDP_AUTO, 260, 246, + WDP_AUTO, 260, 246, WC_INVALID, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_vehicle_list, lengthof(_nested_vehicle_list) @@ -1602,7 +1602,7 @@ struct VehicleDetailsWindow : Window { /** Vehicle details window descriptor. */ static const WindowDesc _train_vehicle_details_desc( - WDP_AUTO, WDP_AUTO, 405, 178, + WDP_AUTO, 405, 178, WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, WDF_UNCLICK_BUTTONS, _nested_train_vehicle_details_widgets, lengthof(_nested_train_vehicle_details_widgets) @@ -1610,7 +1610,7 @@ static const WindowDesc _train_vehicle_d /** Vehicle details window descriptor for other vehicles than a train. */ static const WindowDesc _nontrain_vehicle_details_desc( - WDP_AUTO, WDP_AUTO, 405, 113, + WDP_AUTO, 405, 113, WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, WDF_UNCLICK_BUTTONS, _nested_nontrain_vehicle_details_widgets, lengthof(_nested_nontrain_vehicle_details_widgets) @@ -1667,7 +1667,7 @@ static const NWidgetPart _nested_vehicle /** Vehicle view window descriptor for all vehicles but trains. */ static const WindowDesc _vehicle_view_desc( - WDP_AUTO, WDP_AUTO, 250, 116, + WDP_AUTO, 250, 116, WC_VEHICLE_VIEW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_vehicle_view_widgets, lengthof(_nested_vehicle_view_widgets) @@ -1677,7 +1677,7 @@ static const WindowDesc _vehicle_view_de * default_height are different for train view. */ static const WindowDesc _train_view_desc( - WDP_AUTO, WDP_AUTO, 250, 134, + WDP_AUTO, 250, 134, WC_VEHICLE_VIEW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_vehicle_view_widgets, lengthof(_nested_vehicle_view_widgets) diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp --- a/src/viewport_gui.cpp +++ b/src/viewport_gui.cpp @@ -160,7 +160,7 @@ public: }; static const WindowDesc _extra_view_port_desc( - WDP_AUTO, WDP_AUTO, 300, 268, + WDP_AUTO, 300, 268, WC_EXTRA_VIEW_PORT, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_extra_view_port_widgets, lengthof(_nested_extra_view_port_widgets) diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -147,7 +147,7 @@ static const NWidgetPart _nested_waypoin }; static const WindowDesc _waypoint_view_desc( - WDP_AUTO, WDP_AUTO, 260, 118, + WDP_AUTO, 260, 118, WC_WAYPOINT_VIEW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_waypoint_view_widgets, lengthof(_nested_waypoint_view_widgets) diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -83,7 +83,7 @@ static const NWidgetPart _nested_dropdow }; const WindowDesc _dropdown_desc( - WDP_MANUAL, WDP_MANUAL, 0, 0, // x/y position not used. + WDP_MANUAL, 0, 0, WC_DROPDOWN_MENU, WC_NONE, 0, _nested_dropdown_menu_widgets, lengthof(_nested_dropdown_menu_widgets) diff --git a/src/window.cpp b/src/window.cpp --- a/src/window.cpp +++ b/src/window.cpp @@ -60,11 +60,10 @@ bool _scrolling_viewport; byte _special_mouse_mode; /** Window description constructor. */ -WindowDesc::WindowDesc(int16 left, int16 top, int16 def_width, int16 def_height, +WindowDesc::WindowDesc(WindowPosition def_pos, int16 def_width, int16 def_height, WindowClass window_class, WindowClass parent_class, uint32 flags, const NWidgetPart *nwid_parts, int16 nwid_length) : - left(left), - top(top), + default_pos(def_pos), default_width(def_width), default_height(def_height), cls(window_class), @@ -1099,39 +1098,28 @@ static Point LocalGetWindowPlacement(con pt.x = (_screen.width + 10 - default_width) - 20; } pt.y = w->top + ((desc->parent_cls == WC_BUILD_TOOLBAR || desc->parent_cls == WC_SCEN_LAND_GEN) ? w->height : 10); - } else { - switch (desc->left) { - case WDP_ALIGN_TOOLBAR: // Align to the toolbar - return GetToolbarAlignedWindowPosition(default_width); - - case WDP_AUTO: // Find a good automatic position for the window - return GetAutoPlacePosition(default_width, default_height); + return pt; + } - case WDP_CENTER: // Centre the window horizontally - pt.x = (_screen.width - default_width) / 2; - break; + switch (desc->default_pos) { + case WDP_ALIGN_TOOLBAR: // Align to the toolbar + return GetToolbarAlignedWindowPosition(default_width); - default: - pt.x = desc->left; - if (pt.x < 0) pt.x += _screen.width; // negative is from right of the screen - } + case WDP_AUTO: // Find a good automatic position for the window + return GetAutoPlacePosition(default_width, default_height); - switch (desc->top) { - case WDP_CENTER: // Centre the window vertically - pt.y = (_screen.height - default_height) / 2; - break; + case WDP_CENTER: // Centre the window horizontally + pt.x = (_screen.width - default_width) / 2; + pt.y = (_screen.height - default_height) / 2; + break; - /* WDP_AUTO sets the position at once and is controlled by desc->left. - * Both left and top must be set to WDP_AUTO. Same for toolbar alignment. */ - case WDP_AUTO: - case WDP_ALIGN_TOOLBAR: - NOT_REACHED(); + case WDP_MANUAL: + pt.x = 0; + pt.y = 0; + break; - default: - pt.y = desc->top; - if (pt.y < 0) pt.y += _screen.height; // negative is from bottom of the screen - break; - } + default: + NOT_REACHED(); } return pt; diff --git a/src/window_gui.h b/src/window_gui.h --- a/src/window_gui.h +++ b/src/window_gui.h @@ -123,19 +123,29 @@ extern Window *_z_front_window; extern Window *_z_back_window; extern Window *_focused_window; + +/** How do we the window to be placed? */ +enum WindowPosition { + WDP_MANUAL, ///< Manually align the window (so no automatic location finding) + WDP_AUTO, ///< Find a place automatically + WDP_CENTER, ///< Center the window + WDP_ALIGN_TOOLBAR, ///< Align toward the toolbar +}; + +Point GetToolbarAlignedWindowPosition(int window_width); + /** * High level window description */ struct WindowDesc : ZeroedMemoryAllocator { - WindowDesc(int16 left, int16 top, int16 def_width, int16 def_height, + WindowDesc(WindowPosition default_pos, int16 def_width, int16 def_height, WindowClass window_class, WindowClass parent_class, uint32 flags, const NWidgetPart *nwid_parts = NULL, int16 nwid_length = 0); ~WindowDesc(); - int16 left; ///< Prefered x position of left edge of the window. @see WindowDefaultPosition() - int16 top; ///< Prefered y position of the top of the window. @see WindowDefaultPosition() + WindowPosition default_pos; ///< Prefered position of the window. @see WindowPosition() int16 default_width; ///< Prefered initial width of the window. int16 default_height; ///< Prefered initial height of the window. WindowClass cls; ///< Class of the window, @see WindowClass. @@ -156,18 +166,6 @@ enum WindowDefaultFlag { }; /** - * Special values for 'left' and 'top' to cause a specific placement - */ -enum WindowDefaultPosition { - WDP_MANUAL, ///< Manually align the window (so no automatic location finding) - WDP_AUTO = -1, ///< Find a place automatically - WDP_CENTER = -2, ///< Center the window (left/right or top/bottom) - WDP_ALIGN_TOOLBAR = -3, ///< Align to the main toolbar -}; - -Point GetToolbarAlignedWindowPosition(int window_width); - -/** * Scrollbar data structure */ class Scrollbar {