Changeset - r9317:9275560f46df
src/airport_gui.cpp
Show inline comments
 
@@ -137,13 +137,12 @@ static const Widget _air_toolbar_widgets
 

	
 
static const WindowDesc _air_toolbar_desc = {
 
	WDP_ALIGN_TBR, 22, 64, 36, 64, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_air_toolbar_widgets,
 
	NULL
 
};
 

	
 
void ShowBuildAirToolbar()
 
{
 
	if (!IsValidPlayer(_current_player)) return;
 

	
 
@@ -279,13 +278,12 @@ static const Widget _build_airport_picke
 

	
 
static const WindowDesc _build_airport_desc = {
 
	WDP_AUTO, WDP_AUTO, 148, 240, 148, 240,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_build_airport_picker_widgets,
 
	NULL
 
};
 

	
 
static void ShowBuildAirportPicker()
 
{
 
	new AirportPickerWindow(&_build_airport_desc);
 
}
src/autoreplace_gui.cpp
Show inline comments
 
@@ -530,21 +530,19 @@ static const Widget _replace_vehicle_wid
 

	
 
static const WindowDesc _replace_rail_vehicle_desc = {
 
	WDP_AUTO, WDP_AUTO, 456, 140, 456, 140,
 
	WC_REPLACE_VEHICLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_replace_vehicle_widgets,
 
	NULL
 
};
 

	
 
static const WindowDesc _replace_vehicle_desc = {
 
	WDP_AUTO, WDP_AUTO, 456, 118, 456, 118,
 
	WC_REPLACE_VEHICLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_replace_vehicle_widgets,
 
	NULL
 
};
 

	
 
RailType ReplaceVehicleWindow::sel_railtype = RAILTYPE_RAIL;
 

	
 
void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
 
{
src/bridge_gui.cpp
Show inline comments
 
@@ -280,13 +280,12 @@ static const Widget _build_bridge_widget
 
/* Window definition for the rail bridge selection window */
 
static const WindowDesc _build_bridge_desc = {
 
	WDP_AUTO, WDP_AUTO, 200, 114, 200, 114,
 
	WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	_build_bridge_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Add a buildable bridge to the list.
 
 *  If the list is empty a new one is created.
 
 *
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1179,13 +1179,12 @@ struct BuildVehicleWindow : Window {
 

	
 
static const WindowDesc _build_vehicle_desc = {
 
	WDP_AUTO, WDP_AUTO, 240, 174, 240, 256,
 
	WC_BUILD_VEHICLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_build_vehicle_widgets,
 
	NULL
 
};
 

	
 
void ShowBuildVehicleWindow(TileIndex tile, VehicleType type)
 
{
 
	/* We want to be able to open both Available Train as Available Ships,
 
	 *  so if tile == 0 (Available XXX Window), use 'type' as unique number.
src/cheat_gui.cpp
Show inline comments
 
@@ -223,13 +223,12 @@ struct CheatWindow : Window {
 

	
 
static const WindowDesc _cheats_desc = {
 
	240, 22, 400, 170, 400, 170,
 
	WC_CHEATS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_cheat_widgets,
 
	NULL
 
};
 

	
 

	
 
void ShowCheatWindow()
 
{
 
	DeleteWindowById(WC_CHEATS, 0);
src/console.cpp
Show inline comments
 
@@ -245,13 +245,12 @@ static const Widget _iconsole_window_wid
 

	
 
static const WindowDesc _iconsole_window_desc = {
 
	0, 0, 2, 2, 2, 2,
 
	WC_CONSOLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_iconsole_window_widgets,
 
	NULL,
 
};
 

	
 
void IConsoleInit()
 
{
 
	_iconsole_output_file = NULL;
 
	_icolour_def  =  1;
src/depot_gui.cpp
Show inline comments
 
@@ -104,37 +104,33 @@ static const Widget _depot_widgets[] = {
 

	
 
static const WindowDesc _train_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 36, 27, 36, 27,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_depot_widgets,
 
	NULL
 
};
 

	
 
static const WindowDesc _road_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 36, 27, 36, 27,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_depot_widgets,
 
	NULL
 
};
 

	
 
static const WindowDesc _ship_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 36, 27, 36, 27,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_depot_widgets,
 
	NULL
 
};
 

	
 
static const WindowDesc _aircraft_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 36, 27, 36, 27,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_depot_widgets,
 
	NULL
 
};
 

	
 
extern int WagonLengthToPixels(int len);
 
extern void DepotSortList(Vehicle **v, uint16 length);
 

	
 
/**
src/dock_gui.cpp
Show inline comments
 
@@ -223,13 +223,12 @@ static const Widget _build_docks_toolb_w
 

	
 
static const WindowDesc _build_docks_toolbar_desc = {
 
	WDP_ALIGN_TBR, 22, 136, 36, 136, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_build_docks_toolb_widgets,
 
	NULL
 
};
 

	
 
void ShowBuildDocksToolbar()
 
{
 
	if (!IsValidPlayer(_current_player)) return;
 

	
 
@@ -308,13 +307,12 @@ static const Widget _build_dock_station_
 

	
 
static const WindowDesc _build_dock_station_desc = {
 
	WDP_AUTO, WDP_AUTO, 148, 75, 148, 75,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_build_dock_station_widgets,
 
	NULL
 
};
 

	
 
static void ShowBuildDockStationPicker()
 
{
 
	new BuildDocksStationWindow(&_build_dock_station_desc);
 
}
 
@@ -383,13 +381,12 @@ static const Widget _build_docks_depot_w
 

	
 
static const WindowDesc _build_docks_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 204, 86, 204, 86,
 
	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_build_docks_depot_widgets,
 
	NULL
 
};
 

	
 

	
 
static void ShowBuildDocksDepotPicker()
 
{
 
	new BuildDocksDepotWindow(&_build_docks_depot_desc);
src/engine_gui.cpp
Show inline comments
 
@@ -104,13 +104,12 @@ struct EnginePreviewWindow : Window {
 

	
 
static const WindowDesc _engine_preview_desc = {
 
	WDP_CENTER, WDP_CENTER, 300, 192, 300, 192,
 
	WC_ENGINE_PREVIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_engine_preview_widgets,
 
	NULL
 
};
 

	
 

	
 
void ShowEnginePreviewWindow(EngineID engine)
 
{
 
	AllocateWindowDescFront<EnginePreviewWindow>(&_engine_preview_desc, engine);
src/genworld_gui.cpp
Show inline comments
 
@@ -551,21 +551,19 @@ struct GenerateLandscapeWindow : public 
 

	
 
static const WindowDesc _generate_landscape_desc = {
 
	WDP_CENTER, WDP_CENTER, 338, 268, 338, 268,
 
	WC_GENERATE_LANDSCAPE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_generate_landscape_widgets,
 
	NULL,
 
};
 

	
 
static const WindowDesc _heightmap_load_desc = {
 
	WDP_CENTER, WDP_CENTER, 338, 236, 338, 236,
 
	WC_GENERATE_LANDSCAPE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
 
	_heightmap_load_widgets,
 
	NULL,
 
};
 

	
 
static void _ShowGenerateLandscape(glwp_modes mode)
 
{
 
	uint x = 0;
 
	uint y = 0;
 
@@ -798,13 +796,12 @@ static const Widget _create_scenario_wid
 

	
 
static const WindowDesc _create_scenario_desc = {
 
	WDP_CENTER, WDP_CENTER, 338, 170, 338, 170,
 
	WC_GENERATE_LANDSCAPE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS,
 
	_create_scenario_widgets,
 
	NULL,
 
};
 

	
 
void ShowCreateScenario()
 
{
 
	DeleteWindowByClass(WC_GENERATE_LANDSCAPE);
 
	new CreateScenarioWindow(&_create_scenario_desc, GLWP_SCENARIO);
 
@@ -820,13 +817,12 @@ static const Widget _generate_progress_w
 

	
 
static const WindowDesc _generate_progress_desc = {
 
	WDP_CENTER, WDP_CENTER, 181, 97, 181, 97,
 
	WC_GENERATE_PROGRESS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_generate_progress_widgets,
 
	NULL
 
};
 

	
 
struct tp_info {
 
	uint percent;
 
	StringID cls;
 
	uint current;
src/graph_gui.cpp
Show inline comments
 
@@ -98,13 +98,12 @@ static const Widget _graph_legend_widget
 

	
 
static const WindowDesc _graph_legend_desc = {
 
	WDP_AUTO, WDP_AUTO, 250, 114, 250, 114,
 
	WC_GRAPH_LEGEND, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_graph_legend_widgets,
 
	NULL
 
};
 

	
 
static void ShowGraphLegend()
 
{
 
	AllocateWindowDescFront<GraphLegendWindow>(&_graph_legend_desc, 0);
 
}
 
@@ -439,13 +438,12 @@ static const Widget _operating_profit_wi
 

	
 
static const WindowDesc _operating_profit_desc = {
 
	WDP_AUTO, WDP_AUTO, 576, 174, 576, 174,
 
	WC_OPERATING_PROFIT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_operating_profit_widgets,
 
	NULL
 
};
 

	
 

	
 
void ShowOperatingProfitGraph()
 
{
 
	AllocateWindowDescFront<OperatingProfitGraphWindow>(&_operating_profit_desc, 0);
 
@@ -479,13 +477,12 @@ static const Widget _income_graph_widget
 

	
 
static const WindowDesc _income_graph_desc = {
 
	WDP_AUTO, WDP_AUTO, 576, 142, 576, 142,
 
	WC_INCOME_GRAPH, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_income_graph_widgets,
 
	NULL
 
};
 

	
 
void ShowIncomeGraph()
 
{
 
	AllocateWindowDescFront<IncomeGraphWindow>(&_income_graph_desc, 0);
 
}
 
@@ -517,13 +514,12 @@ static const Widget _delivered_cargo_gra
 

	
 
static const WindowDesc _delivered_cargo_graph_desc = {
 
	WDP_AUTO, WDP_AUTO, 576, 142, 576, 142,
 
	WC_DELIVERED_CARGO, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_delivered_cargo_graph_widgets,
 
	NULL
 
};
 

	
 
void ShowDeliveredCargoGraph()
 
{
 
	AllocateWindowDescFront<DeliveredCargoGraphWindow>(&_delivered_cargo_graph_desc, 0);
 
}
 
@@ -562,13 +558,12 @@ static const Widget _performance_history
 

	
 
static const WindowDesc _performance_history_desc = {
 
	WDP_AUTO, WDP_AUTO, 576, 238, 576, 238,
 
	WC_PERFORMANCE_HISTORY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_performance_history_widgets,
 
	NULL
 
};
 

	
 
void ShowPerformanceHistoryGraph()
 
{
 
	AllocateWindowDescFront<PerformanceHistoryGraphWindow>(&_performance_history_desc, 0);
 
}
 
@@ -600,13 +595,12 @@ static const Widget _company_value_graph
 

	
 
static const WindowDesc _company_value_graph_desc = {
 
	WDP_AUTO, WDP_AUTO, 576, 238, 576, 238,
 
	WC_COMPANY_VALUE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_company_value_graph_widgets,
 
	NULL
 
};
 

	
 
void ShowCompanyValueGraph()
 
{
 
	AllocateWindowDescFront<CompanyValueGraphWindow>(&_company_value_graph_desc, 0);
 
}
 
@@ -725,13 +719,12 @@ static const Widget _cargo_payment_rates
 

	
 
static const WindowDesc _cargo_payment_rates_desc = {
 
	WDP_AUTO, WDP_AUTO, 568, 46, 568, 46,
 
	WC_PAYMENT_RATES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_cargo_payment_rates_widgets,
 
	NULL
 
};
 

	
 

	
 
void ShowCargoPaymentRates()
 
{
 
	AllocateWindowDescFront<PaymentRatesGraphWindow>(&_cargo_payment_rates_desc, 0);
 
@@ -814,13 +807,12 @@ static const Widget _company_league_widg
 

	
 
static const WindowDesc _company_league_desc = {
 
	WDP_AUTO, WDP_AUTO, 400, 97, 400, 97,
 
	WC_COMPANY_LEAGUE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_company_league_widgets,
 
	NULL
 
};
 

	
 
void ShowCompanyLeagueTable()
 
{
 
	AllocateWindowDescFront<CompanyLeagueWindow>(&_company_league_desc, 0);
 
}
 
@@ -1046,13 +1038,12 @@ static const Widget _performance_rating_
 

	
 
static const WindowDesc _performance_rating_detail_desc = {
 
	WDP_AUTO, WDP_AUTO, 299, 228, 299, 228,
 
	WC_PERFORMANCE_DETAIL, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_performance_rating_detail_widgets,
 
	NULL
 
};
 

	
 
void ShowPerformanceRatingDetail()
 
{
 
	AllocateWindowDescFront<PerformanceRatingDetailWindow>(&_performance_rating_detail_desc, 0);
 
}
src/group_gui.cpp
Show inline comments
 
@@ -754,13 +754,12 @@ struct VehicleGroupWindow : public Windo
 

	
 
static const WindowDesc _group_desc = {
 
	WDP_AUTO, WDP_AUTO, 460, 194, 526, 246,
 
	WC_TRAINS_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_group_widgets,
 
	NULL
 
};
 

	
 
void ShowPlayerGroup(PlayerID player, VehicleType vehicle_type)
 
{
 
	if (!IsValidPlayer(player)) return;
 

	
src/industry_gui.cpp
Show inline comments
 
@@ -88,13 +88,12 @@ static const Widget _build_industry_widg
 
/** Window definition of the dynamic place industries gui */
 
static const WindowDesc _build_industry_desc = {
 
	WDP_AUTO, WDP_AUTO, 170, 212, 170, 212,
 
	WC_BUILD_INDUSTRY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	_build_industry_widgets,
 
	NULL,
 
};
 

	
 
class BuildIndustryWindow : public Window {
 
	int selected_index;                         ///< index of the element in the matrix
 
	IndustryType selected_type;                 ///< industry corresponding to the above index
 
	uint16 callback_timer;                      ///< timer counter for callback eventual verification
 
@@ -677,13 +676,12 @@ static const Widget _industry_view_widge
 
/** Window definition of the view industy gui */
 
static const WindowDesc _industry_view_desc = {
 
	WDP_AUTO, WDP_AUTO, 260, 120, 260, 120,
 
	WC_INDUSTRY_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_industry_view_widgets,
 
	NULL
 
};
 

	
 
void ShowIndustryViewWindow(int industry)
 
{
 
	AllocateWindowDescFront<IndustryViewWindow>(&_industry_view_desc, industry);
 
}
 
@@ -965,13 +963,12 @@ Listing IndustryDirectoryWindow::industr
 
/** Window definition of the industy directory gui */
 
static const WindowDesc _industry_directory_desc = {
 
	WDP_AUTO, WDP_AUTO, 508, 190, 508, 190,
 
	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,
 
	NULL
 
};
 

	
 
void ShowIndustryDirectory()
 
{
 
	AllocateWindowDescFront<IndustryDirectoryWindow>(&_industry_directory_desc, 0);
 
}
src/intro_gui.cpp
Show inline comments
 
@@ -130,13 +130,12 @@ public:
 

	
 
static const WindowDesc _select_game_desc = {
 
	WDP_CENTER, WDP_CENTER, 336, 195, 336, 195,
 
	WC_SELECT_GAME, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_select_game_widgets,
 
	NULL
 
};
 

	
 
void ShowSelectGameWindow()
 
{
 
	new SelectGameWindow(&_select_game_desc);
 
}
src/misc_gui.cpp
Show inline comments
 
@@ -66,13 +66,12 @@ static const Widget _land_info_widgets[]
 

	
 
static const WindowDesc _land_info_desc = {
 
	WDP_AUTO, WDP_AUTO, 280, 93, 280, 93,
 
	WC_LAND_INFO, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_land_info_widgets,
 
	NULL
 
};
 

	
 
class LandInfoWindow : public Window {
 
	enum {
 
		LAND_INFO_LINES          =   7,
 
		LAND_INFO_LINE_BUFF_SIZE = 512,
 
@@ -216,13 +215,12 @@ static const Widget _about_widgets[] = {
 

	
 
static const WindowDesc _about_desc = {
 
	WDP_CENTER, WDP_CENTER, 420, 272, 420, 272,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_about_widgets,
 
	NULL
 
};
 

	
 
struct AboutWindow : public Window {
 
	int scroll_height;
 
	uint16 counter;
 

	
 
@@ -1071,13 +1069,12 @@ static const Widget _query_string_widget
 

	
 
static const WindowDesc _query_string_desc = {
 
	190, 219, 260, 42, 260, 42,
 
	WC_QUERY_STRING, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_query_string_widgets,
 
	NULL
 
};
 

	
 
/** Show a query popup window with a textbox in it.
 
 * @param str StringID for the text shown in the textbox
 
 * @param caption StringID of text shown in caption of querywindow
 
 * @param maxlen maximum length in characters allowed. If bit 12 is set we
 
@@ -1205,13 +1202,12 @@ static const Widget _query_widgets[] = {
 

	
 
static const WindowDesc _query_desc = {
 
	WDP_CENTER, WDP_CENTER, 210, 82, 210, 82,
 
	WC_CONFIRM_POPUP_QUERY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_DEF_WIDGET | WDF_MODAL,
 
	_query_widgets,
 
	NULL
 
};
 

	
 
/** Show a modal confirmation window with standard 'yes' and 'no' buttons
 
 * The window is aligned to the centre of its parent.
 
 * NOTE: You cannot use BindCString as parameter for this window!
 
 * @param caption string shown as window caption
 
@@ -1586,21 +1582,19 @@ struct SaveLoadWindow : public QueryStri
 

	
 
static const WindowDesc _load_dialog_desc = {
 
	WDP_CENTER, WDP_CENTER, 257, 154, 257, 294,
 
	WC_SAVELOAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_load_dialog_widgets,
 
	NULL,
 
};
 

	
 
static const WindowDesc _save_dialog_desc = {
 
	WDP_CENTER, WDP_CENTER, 257, 180, 257, 320,
 
	WC_SAVELOAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_save_dialog_widgets,
 
	NULL,
 
};
 

	
 
/** These values are used to convert the file/operations mode into a corresponding file type.
 
 * So each entry, as expressed by the related comment, is based on the enum   */
 
static const FileType _file_modetotype[] = {
 
	FT_SAVEGAME,  ///< used for SLD_LOAD_GAME
src/music_gui.cpp
Show inline comments
 
@@ -348,13 +348,12 @@ static const Widget _music_track_selecti
 

	
 
static const WindowDesc _music_track_selection_desc = {
 
	104, 131, 432, 218, 432, 218,
 
	WC_MUSIC_TRACK_SELECTION, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_music_track_selection_widgets,
 
	NULL
 
};
 

	
 
static void ShowMusicTrackSelection()
 
{
 
	AllocateWindowDescFront<MusicTrackSelectionWindow>(&_music_track_selection_desc, 0);
 
}
 
@@ -550,13 +549,12 @@ static const Widget _music_window_widget
 

	
 
static const WindowDesc _music_window_desc = {
 
	0, 22, 300, 66, 300, 66,
 
	WC_MUSIC_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_music_window_widgets,
 
	NULL
 
};
 

	
 
void ShowMusicWindow()
 
{
 
	AllocateWindowDescFront<MusicWindow>(&_music_window_desc, 0);
 
}
src/network/network_gui.cpp
Show inline comments
 
@@ -639,13 +639,12 @@ static const Widget _network_game_window
 

	
 
static const WindowDesc _network_game_window_desc = {
 
	WDP_CENTER, WDP_CENTER, 450, 264, 550, 264,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_network_game_window_widgets,
 
	NULL,
 
};
 

	
 
void ShowNetworkGameWindow()
 
{
 
	static bool first = true;
 
	DeleteWindowById(WC_NETWORK_WINDOW, 0);
 
@@ -974,13 +973,12 @@ static const Widget _network_start_serve
 

	
 
static const WindowDesc _network_start_server_window_desc = {
 
	WDP_CENTER, WDP_CENTER, 420, 244, 420, 244,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_network_start_server_window_widgets,
 
	NULL,
 
};
 

	
 
static void ShowNetworkStartServerWindow()
 
{
 
	DeleteWindowById(WC_NETWORK_WINDOW, 0);
 

	
 
@@ -1188,13 +1186,12 @@ static const Widget _network_lobby_windo
 

	
 
static const WindowDesc _network_lobby_window_desc = {
 
	WDP_CENTER, WDP_CENTER, 420, 235, 420, 235,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_network_lobby_window_widgets,
 
	NULL,
 
};
 

	
 
/* Show the networklobbywindow with the selected server
 
 * @param ngl Selected game pointer which is passed to the new window */
 
static void ShowNetworkLobbyWindow(NetworkGameList *ngl)
 
{
 
@@ -1234,18 +1231,17 @@ static const Widget _client_list_widgets
 

	
 
static const Widget _client_list_popup_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,    14,     0,   99,     0,     0,     0, STR_NULL},
 
{   WIDGETS_END},
 
};
 

	
 
static WindowDesc _client_list_desc = {
 
static const WindowDesc _client_list_desc = {
 
	WDP_AUTO, WDP_AUTO, 250, 1, 250, 1,
 
	WC_CLIENT_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_client_list_widgets,
 
	NULL
 
};
 

	
 
// Finds the Xth client-info that is active
 
static const NetworkClientInfo *NetworkFindClientInfo(byte client_no)
 
{
 
	const NetworkClientInfo *ci;
 
@@ -1662,13 +1658,12 @@ static const Widget _network_join_status
 

	
 
static const WindowDesc _network_join_status_window_desc = {
 
	WDP_CENTER, WDP_CENTER, 250, 85, 250, 85,
 
	WC_NETWORK_STATUS_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_MODAL,
 
	_network_join_status_window_widget,
 
	NULL,
 
};
 

	
 
void ShowJoinStatusWindow()
 
{
 
	DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
	new NetworkJoinStatusWindow(&_network_join_status_window_desc);
 
@@ -1906,13 +1901,12 @@ static const Widget _chat_window_widgets
 

	
 
static const WindowDesc _chat_window_desc = {
 
	WDP_CENTER, -26, 320, 14, 640, 14, // x, y, width, height
 
	WC_SEND_NETWORK_MSG, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
 
	_chat_window_widgets,
 
	NULL
 
};
 

	
 
void ShowNetworkChatQueryWindow(DestType type, int dest)
 
{
 
	DeleteWindowById(WC_SEND_NETWORK_MSG, 0);
 
	new NetworkChatWindow (&_chat_window_desc, type, dest);
 
@@ -2015,13 +2009,12 @@ static const Widget _ncp_window_widgets[
 

	
 
static const WindowDesc _ncp_window_desc = {
 
	WDP_AUTO, WDP_AUTO, 300, 63, 300, 63,
 
	WC_COMPANY_PASSWORD_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_ncp_window_widgets,
 
	NULL
 
};
 

	
 
void ShowNetworkCompanyPasswordWindow(Window *parent)
 
{
 
	DeleteWindowById(WC_COMPANY_PASSWORD_WINDOW, 0);
 

	
src/newgrf_gui.cpp
Show inline comments
 
@@ -247,13 +247,12 @@ static const Widget _newgrf_add_dlg_widg
 
/* Window definition for the add a newgrf window */
 
static const WindowDesc _newgrf_add_dlg_desc = {
 
	WDP_CENTER, WDP_CENTER, 307, 237, 307, 337,
 
	WC_SAVELOAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_newgrf_add_dlg_widgets,
 
	NULL,
 
};
 

	
 

	
 
static void NewGRFConfirmationCallback(Window *w, bool confirmed);
 

	
 
/**
 
@@ -549,13 +548,12 @@ static const Widget _newgrf_widgets[] = 
 
/* Window definition of the manage newgrfs window */
 
static const WindowDesc _newgrf_desc = {
 
	WDP_CENTER, WDP_CENTER, 300, 225, 300, 225,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_newgrf_widgets,
 
	NULL,
 
};
 

	
 
/** Callback function for the newgrf 'apply changes' confirmation window
 
 * @param w Window which is calling this callback
 
 * @param confirmed boolean value, true when yes was clicked, false otherwise
 
 */
src/news_gui.cpp
Show inline comments
 
@@ -442,13 +442,12 @@ static const Widget _news_type13_widgets
 

	
 
static WindowDesc _news_type13_desc = {
 
	WDP_CENTER, 476, 430, 170, 430, 170,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	_news_type13_widgets,
 
	NULL
 
};
 

	
 
static const Widget _news_type2_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,    15,     0,   429,     0,   129, 0x0, STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,    15,     0,    10,     0,    11, 0x0, STR_NULL},
 
{   WIDGETS_END},
 
@@ -456,13 +455,12 @@ static const Widget _news_type2_widgets[
 

	
 
static WindowDesc _news_type2_desc = {
 
	WDP_CENTER, 476, 430, 130, 430, 130,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	_news_type2_widgets,
 
	NULL
 
};
 

	
 
static const Widget _news_type0_widgets[] = {
 
{      WWT_PANEL,   RESIZE_NONE,     5,     0,   279,    14,    86, 0x0,              STR_NULL},
 
{   WWT_CLOSEBOX,   RESIZE_NONE,     5,     0,    10,     0,    13, STR_00C5,         STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,     5,    11,   279,     0,    13, STR_012C_MESSAGE, STR_NULL},
 
@@ -472,13 +470,12 @@ static const Widget _news_type0_widgets[
 

	
 
static WindowDesc _news_type0_desc = {
 
	WDP_CENTER, 476, 280, 87, 280, 87,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	_news_type0_widgets,
 
	NULL
 
};
 

	
 

	
 
/** Open up an own newspaper window for the news item */
 
static void ShowNewspaper(NewsItem *ni)
 
{
 
@@ -760,13 +757,12 @@ static const Widget _message_history_wid
 

	
 
static const WindowDesc _message_history_desc = {
 
	240, 22, 400, 140, 400, 140,
 
	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,
 
	NULL
 
};
 

	
 
/** Display window with news messages history */
 
void ShowMessageHistory()
 
{
 
	DeleteWindowById(WC_MESSAGE_HISTORY, 0);
 
@@ -968,13 +964,12 @@ NEWS_SETTINGS_LINE(26, NT_GENERAL, STR_0
 
static const WindowDesc _message_options_desc = {
 
	270,  22,  410,  65 + NT_END * NEWS_SETTING_BASELINE_SKIP,
 
	           410,  65 + NT_END * NEWS_SETTING_BASELINE_SKIP,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_message_options_widgets,
 
	NULL
 
};
 

	
 
void ShowMessageOptions()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new MessageOptionsWindow(&_message_options_desc);
src/order_gui.cpp
Show inline comments
 
@@ -1060,13 +1060,12 @@ static const Widget _orders_train_widget
 

	
 
static const WindowDesc _orders_train_desc = {
 
	WDP_AUTO, WDP_AUTO, 386, 100, 386, 100,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	_orders_train_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Widget definition for player orders (!train)
 
 */
 
static const Widget _orders_widgets[] = {
 
@@ -1101,13 +1100,12 @@ static const Widget _orders_widgets[] = 
 

	
 
static const WindowDesc _orders_desc = {
 
	WDP_AUTO, WDP_AUTO, 386, 100, 386, 100,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	_orders_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Widget definition for competitor orders
 
 */
 
static const Widget _other_orders_widgets[] = {
 
@@ -1142,13 +1140,12 @@ static const Widget _other_orders_widget
 

	
 
static const WindowDesc _other_orders_desc = {
 
	WDP_AUTO, WDP_AUTO, 386, 88, 386, 88,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_other_orders_widgets,
 
	NULL
 
};
 

	
 
void ShowOrdersWindow(const Vehicle *v)
 
{
 
	VehicleID veh = v->index;
 

	
src/osk_gui.cpp
Show inline comments
 
@@ -280,18 +280,17 @@ static const Widget _osk_widgets[] = {
 
{    WWT_PUSHBTN, RESIZE_NONE,    14,   210,   225,   103,   118, 0x0,    STR_NULL},
 
{    WWT_PUSHBTN, RESIZE_NONE,    14,   228,   243,   103,   118, 0x0,    STR_NULL},
 

	
 
{   WIDGETS_END},
 
};
 

	
 
WindowDesc _osk_desc = {
 
static const WindowDesc _osk_desc = {
 
	WDP_CENTER, WDP_CENTER, 256, 140, 256, 140,
 
	WC_OSK, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_osk_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Retrieve keyboard layout from language string or (if set) config file.
 
 * Also check for invalid characters.
 
 */
src/player_gui.cpp
Show inline comments
 
@@ -227,21 +227,19 @@ struct PlayerFinancesWindow : Window {
 

	
 
static const WindowDesc _player_finances_desc = {
 
	WDP_AUTO, WDP_AUTO, 407, 86 + 10 * EXPENSES_END, 407, 86 + 10 * EXPENSES_END,
 
	WC_FINANCES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_player_finances_widgets,
 
	NULL
 
};
 

	
 
static const WindowDesc _player_finances_small_desc = {
 
	WDP_AUTO, WDP_AUTO, 280, 60, 280, 60,
 
	WC_FINANCES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_player_finances_small_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Open the small/large finance window of the player
 
 *
 
 * @param player         the player who's finances are requested to be seen
 
@@ -540,13 +538,12 @@ static const Widget _select_player_liver
 

	
 
static const WindowDesc _select_player_livery_desc = {
 
	WDP_AUTO, WDP_AUTO, 400, 49 + 1 * 14, 400, 49 + 1 * 14,
 
	WC_PLAYER_COLOR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_select_player_livery_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Draws the face of a player.
 
 * @param pf    the player's face
 
 * @param color the (background) color of the gradient
 
@@ -1007,22 +1004,20 @@ public:
 
/** normal/simple player face selection window description */
 
static const WindowDesc _select_player_face_desc = {
 
	WDP_AUTO, WDP_AUTO, 190, 163, 190, 163,
 
	WC_PLAYER_FACE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_select_player_face_widgets,
 
	NULL
 
};
 

	
 
/** advanced player face selection window description */
 
static const WindowDesc _select_player_face_adv_desc = {
 
	WDP_AUTO, WDP_AUTO, 220, 220, 220, 220,
 
	WC_PLAYER_FACE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_select_player_face_adv_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Open the simple/advanced player face selection window
 
 *
 
 * @param player the player which face shall be edited
 
@@ -1345,13 +1340,12 @@ struct PlayerCompanyWindow : Window
 

	
 
static const WindowDesc _player_company_desc = {
 
	WDP_AUTO, WDP_AUTO, 360, 170, 360, 170,
 
	WC_COMPANY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_player_company_widgets,
 
	NULL
 
};
 

	
 
void ShowPlayerCompany(PlayerID player)
 
{
 
	if (!IsValidPlayer(player)) return;
 

	
 
@@ -1404,13 +1398,12 @@ static const Widget _buy_company_widgets
 

	
 
static const WindowDesc _buy_company_desc = {
 
	153, 171, 334, 137, 334, 137,
 
	WC_BUY_COMPANY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_buy_company_widgets,
 
	NULL
 
};
 

	
 

	
 
void ShowBuyCompanyDialog(uint player)
 
{
 
	AllocateWindowDescFront<BuyCompanyWindow>(&_buy_company_desc, player);
 
@@ -1575,21 +1568,19 @@ static const Widget _highscore_widgets[]
 

	
 
static const WindowDesc _highscore_desc = {
 
	0, 0, 641, 481, 641, 481,
 
	WC_HIGHSCORE, WC_NONE,
 
	0,
 
	_highscore_widgets,
 
	NULL
 
};
 

	
 
static const WindowDesc _endgame_desc = {
 
	0, 0, 641, 481, 641, 481,
 
	WC_ENDSCREEN, WC_NONE,
 
	0,
 
	_highscore_widgets,
 
	NULL
 
};
 

	
 
/** Show the highscore table for a given difficulty. When called from
 
 * endgame ranking is set to the top5 element that was newly added
 
 * and is thus highlighted */
 
void ShowHighscoreTable(int difficulty, int8 ranking)
src/rail_gui.cpp
Show inline comments
 
@@ -798,13 +798,12 @@ static const Widget _build_rail_widgets[
 

	
 
static const WindowDesc _build_rail_desc = {
 
	WDP_ALIGN_TBR, 22, 350, 36, 350, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_build_rail_widgets,
 
	NULL
 
};
 

	
 

	
 
/** Configures the rail toolbar for railtype given
 
 * @param railtype the railtype to display
 
 * @param w the window to modify
 
@@ -1320,22 +1319,20 @@ static const Widget _newstation_builder_
 
/** High level window description of the default station-build window */
 
static const WindowDesc _station_builder_desc = {
 
	WDP_AUTO, WDP_AUTO, 148, 200, 148, 200,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_station_builder_widgets,
 
	NULL
 
};
 

	
 
/** High level window description of the newGRF station-build window */
 
static const WindowDesc _newstation_builder_desc = {
 
	WDP_AUTO, WDP_AUTO, 148, 290, 148, 290,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_newstation_builder_widgets,
 
	NULL
 
};
 

	
 
/** Open station build window */
 
static void ShowStationBuilder()
 
{
 
	if (GetNumStationClasses() <= 2 && GetNumCustomStations(STAT_CLASS_DFLT) == 1) {
 
@@ -1483,13 +1480,12 @@ static const Widget _signal_builder_widg
 
/** Signal selection window description */
 
static const WindowDesc _signal_builder_desc = {
 
	WDP_AUTO, WDP_AUTO, 110, 68, 110, 68,
 
	WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_signal_builder_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Open the signal selection window
 
 */
 
static void ShowSignalBuilder()
 
@@ -1558,13 +1554,12 @@ static const Widget _build_depot_widgets
 

	
 
static const WindowDesc _build_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 140, 122, 140, 122,
 
	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_build_depot_widgets,
 
	NULL
 
};
 

	
 
static void ShowBuildTrainDepotPicker()
 
{
 
	new BuildRailDepotWindow(&_build_depot_desc);
 
}
 
@@ -1660,13 +1655,12 @@ static const Widget _build_waypoint_widg
 

	
 
static const WindowDesc _build_waypoint_desc = {
 
	WDP_AUTO, WDP_AUTO, 344, 92, 344, 92,
 
	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_build_waypoint_widgets,
 
	NULL
 
};
 

	
 
static void ShowBuildWaypointPicker()
 
{
 
	new BuildRailWaypointWindow(&_build_waypoint_desc);
 
}
src/road_gui.cpp
Show inline comments
 
@@ -640,13 +640,12 @@ static const Widget _build_road_widgets[
 

	
 
static const WindowDesc _build_road_desc = {
 
	WDP_ALIGN_TBR, 22, 263, 36, 263, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_build_road_widgets,
 
	NULL
 
};
 

	
 
/** Widget definition of the build tram toolbar */
 
static const Widget _build_tramway_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,     7,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},                // RTW_CLOSEBOX
 
{    WWT_CAPTION,   RESIZE_NONE,     7,    11,   228,     0,    13, STR_WHITE_TRAMWAY_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},      // RTW_CAPTION
 
@@ -669,13 +668,12 @@ static const Widget _build_tramway_widge
 

	
 
static const WindowDesc _build_tramway_desc = {
 
	WDP_ALIGN_TBR, 22, 241, 36, 241, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_build_tramway_widgets,
 
	NULL
 
};
 

	
 
void ShowBuildRoadToolbar(RoadType roadtype)
 
{
 
	if (!IsValidPlayer(_current_player)) return;
 
	_cur_roadtype = roadtype;
 
@@ -706,13 +704,12 @@ static const Widget _build_road_scen_wid
 

	
 
static const WindowDesc _build_road_scen_desc = {
 
	WDP_AUTO, WDP_AUTO, 197, 36, 197, 36,
 
	WC_SCEN_BUILD_ROAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_build_road_scen_widgets,
 
	NULL
 
};
 

	
 
void ShowBuildRoadScenToolbar()
 
{
 
	_cur_roadtype = ROADTYPE_ROAD;
 
	AllocateWindowDescFront<BuildRoadToolbarWindow>(&_build_road_scen_desc, 0);
 
@@ -786,13 +783,12 @@ static const Widget _build_road_depot_wi
 

	
 
static const WindowDesc _build_road_depot_desc = {
 
	WDP_AUTO, WDP_AUTO, 140, 122, 140, 122,
 
	WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_build_road_depot_widgets,
 
	NULL
 
};
 

	
 
static void ShowRoadDepotPicker()
 
{
 
	new BuildRoadDepotWindow(&_build_road_depot_desc);
 
}
 
@@ -929,13 +925,12 @@ static const Widget _rv_station_picker_w
 

	
 
static const WindowDesc _rv_station_picker_desc = {
 
	WDP_AUTO, WDP_AUTO, 207, 177, 207, 177,
 
	WC_BUS_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_rv_station_picker_widgets,
 
	NULL
 
};
 

	
 
static void ShowRVStationPicker(RoadStopType rs)
 
{
 
	new BuildRoadStationWindow(&_rv_station_picker_desc, rs);
 
}
src/settings_gui.cpp
Show inline comments
 
@@ -346,13 +346,12 @@ static const Widget _game_options_widget
 

	
 
static const WindowDesc _game_options_desc = {
 
	WDP_CENTER, WDP_CENTER, 370, 239, 370, 239,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_game_options_widgets,
 
	NULL
 
};
 

	
 

	
 
void ShowGameOptions()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
@@ -465,13 +464,12 @@ static const Widget _game_difficulty_wid
 
/* Window definition for the game difficulty settings window */
 
static const WindowDesc _game_difficulty_desc = {
 
	WDP_CENTER, WDP_CENTER, 370, 279, 370, 279,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_game_difficulty_widgets,
 
	NULL
 
};
 

	
 
struct GameDifficultyWindow : public Window {
 
private:
 
	bool clicked_increase;
 
	uint8 clicked_button;
 
@@ -1061,13 +1059,12 @@ static const Widget _patches_selection_w
 

	
 
static const WindowDesc _patches_selection_desc = {
 
	WDP_CENTER, WDP_CENTER, 370, 51, 370, 51,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_patches_selection_widgets,
 
	NULL,
 
};
 

	
 
void ShowPatchesSelection()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new PatchesSelectionWindow(&_patches_selection_desc);
 
@@ -1292,13 +1289,12 @@ static const Widget _cust_currency_widge
 

	
 
static const WindowDesc _cust_currency_desc = {
 
	WDP_CENTER, WDP_CENTER, 230, 120, 230, 120,
 
	WC_CUSTOM_CURRENCY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_cust_currency_widgets,
 
	NULL,
 
};
 

	
 
static void ShowCustCurrency()
 
{
 
	DeleteWindowById(WC_CUSTOM_CURRENCY, 0);
 
	new CustomCurrencyWindow(&_cust_currency_desc);
src/signs_gui.cpp
Show inline comments
 
@@ -136,13 +136,12 @@ static const Widget _sign_list_widget[] 
 

	
 
static const WindowDesc _sign_list_desc = {
 
	WDP_AUTO, WDP_AUTO, 358, 138, 358, 138,
 
	WC_SIGN_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_sign_list_widget,
 
	NULL
 
};
 

	
 

	
 
void ShowSignList()
 
{
 
	AllocateWindowDescFront<SignListWindow>(&_sign_list_desc, 0);
 
@@ -297,13 +296,12 @@ static const Widget _query_sign_edit_wid
 

	
 
static const WindowDesc _query_sign_edit_desc = {
 
	190, 170, 260, 42, 260, 42,
 
	WC_QUERY_STRING, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_query_sign_edit_widgets,
 
	NULL
 
};
 

	
 
void ShowRenameSignWindow(const Sign *si)
 
{
 
	/* Delete all other edit windows and the save window */
 
	DeleteWindowById(WC_QUERY_STRING, 0);
src/smallmap_gui.cpp
Show inline comments
 
@@ -1075,13 +1075,12 @@ public:
 

	
 
static const WindowDesc _smallmap_desc = {
 
	WDP_AUTO, WDP_AUTO, 350, 214, 446, 314,
 
	WC_SMALLMAP, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_smallmap_widgets,
 
	NULL
 
};
 

	
 
void ShowSmallMap()
 
{
 
	AllocateWindowDescFront<SmallMapWindow>(&_smallmap_desc, 0);
 
}
 
@@ -1221,13 +1220,12 @@ public:
 

	
 
static const WindowDesc _extra_view_port_desc = {
 
	WDP_AUTO, WDP_AUTO, 300, 68, 300, 268,
 
	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,
 
	NULL
 
};
 

	
 
void ShowExtraViewPortWindow(TileIndex tile)
 
{
 
	int i = 0;
 

	
src/station_gui.cpp
Show inline comments
 
@@ -612,13 +612,12 @@ static const Widget _player_stations_wid
 

	
 
static const WindowDesc _player_stations_desc = {
 
	WDP_AUTO, WDP_AUTO, 358, 162, 358, 162,
 
	WC_STATION_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_player_stations_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Opens window with list of player's stations
 
 *
 
 * @param player player whose stations' list show
 
@@ -984,13 +983,12 @@ struct StationViewWindow : public Window
 

	
 
static const WindowDesc _station_view_desc = {
 
	WDP_AUTO, WDP_AUTO, 249, 110, 249, 110,
 
	WC_STATION_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_station_view_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Opens StationViewWindow for given station
 
 *
 
 * @param station station which window should be opened
src/statusbar_gui.cpp
Show inline comments
 
@@ -165,13 +165,12 @@ static const Widget _main_status_widgets
 

	
 
static WindowDesc _main_status_desc = {
 
	WDP_CENTER, 0, 320, 12, 640, 12,
 
	WC_STATUS_BAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_main_status_widgets,
 
	NULL
 
};
 

	
 
/**
 
 * Checks whether the news ticker is currently being used.
 
 */
 
bool IsNewsTickerShown()
src/subsidy_gui.cpp
Show inline comments
 
@@ -176,13 +176,12 @@ static const Widget _subsidies_list_widg
 

	
 
static const WindowDesc _subsidies_list_desc = {
 
	WDP_AUTO, WDP_AUTO, 320, 127, 320, 127,
 
	WC_SUBSIDIES_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_subsidies_list_widgets,
 
	NULL
 
};
 

	
 

	
 
void ShowSubsidiesList()
 
{
 
	AllocateWindowDescFront<SubsidyListWindow>(&_subsidies_list_desc, 0);
src/terraform_gui.cpp
Show inline comments
 
@@ -310,13 +310,12 @@ static const Widget _terraform_widgets[]
 

	
 
static const WindowDesc _terraform_desc = {
 
	WDP_ALIGN_TBR, 22 + 36, 158, 36, 158, 36,
 
	WC_SCEN_LAND_GEN, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_terraform_widgets,
 
	NULL
 
};
 

	
 
void ShowTerraformToolbar(Window *link)
 
{
 
	if (!IsValidPlayer(_current_player)) return;
 
	Window *w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
 
@@ -689,13 +688,12 @@ struct ScenarioEditorLandscapeGeneration
 

	
 
static const WindowDesc _scen_edit_land_gen_desc = {
 
	WDP_AUTO, WDP_AUTO, 204, 103, 204, 103,
 
	WC_SCEN_LAND_GEN, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_scen_edit_land_gen_widgets,
 
	NULL,
 
};
 

	
 
void ShowEditorTerraformToolbar()
 
{
 
	AllocateWindowDescFront<ScenarioEditorLandscapeGenerationWindow>(&_scen_edit_land_gen_desc, 0);
 
}
src/timetable_gui.cpp
Show inline comments
 
@@ -295,13 +295,12 @@ static const Widget _timetable_widgets[]
 

	
 
static const WindowDesc _timetable_desc = {
 
	WDP_AUTO, WDP_AUTO, 400, 130, 400, 130,
 
	WC_VEHICLE_TIMETABLE, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_timetable_widgets,
 
	NULL
 
};
 

	
 
void ShowTimetableWindow(const Vehicle *v)
 
{
 
	AllocateWindowDescFront<TimetableWindow>(&_timetable_desc, v->index);
 
}
src/toolbar_gui.cpp
Show inline comments
 
@@ -855,13 +855,12 @@ static const Widget _toolb_normal_widget
 

	
 
static const WindowDesc _toolb_normal_desc = {
 
	0, 0, 0, 22, 640, 22,
 
	WC_MAIN_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
 
	_toolb_normal_widgets,
 
	NULL
 
};
 

	
 

	
 
/* --- Toolbar handling for the scenario editor */
 

	
 
static ToolbarButtonProc * const _scen_toolbar_button_procs[] = {
 
@@ -1104,13 +1103,12 @@ static const Widget _toolb_scen_widgets[
 

	
 
static const WindowDesc _toolb_scen_desc = {
 
	0, 0, 130, 22, 640, 22,
 
	WC_MAIN_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_toolb_scen_widgets,
 
	NULL
 
};
 

	
 
/* --- Rendering/handling the drop down menus --- */
 

	
 
typedef void MenuClickedProc(int index);
 

	
src/town_gui.cpp
Show inline comments
 
@@ -261,13 +261,12 @@ struct TownAuthorityWindow : Window {
 

	
 
static const WindowDesc _town_authority_desc = {
 
	WDP_AUTO, WDP_AUTO, 317, 222, 317, 222,
 
	WC_TOWN_AUTHORITY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_town_authority_widgets,
 
	NULL
 
};
 

	
 
static void ShowTownAuthorityWindow(uint town)
 
{
 
	AllocateWindowDescFront<TownAuthorityWindow>(&_town_authority_desc, town);
 
}
 
@@ -394,13 +393,12 @@ static const Widget _town_view_widgets[]
 

	
 
static const WindowDesc _town_view_desc = {
 
	WDP_AUTO, WDP_AUTO, 260, 150, 260, 150,
 
	WC_TOWN_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	_town_view_widgets,
 
	NULL
 
};
 

	
 
void ShowTownViewWindow(TownID town)
 
{
 
	AllocateWindowDescFront<TownViewWindow>(&_town_view_desc, town);
 
}
 
@@ -580,13 +578,12 @@ struct TownDirectoryWindow : public Wind
 

	
 
static const WindowDesc _town_directory_desc = {
 
	WDP_AUTO, WDP_AUTO, 208, 202, 208, 202,
 
	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,
 
	NULL
 
};
 

	
 
void ShowTownDirectory()
 
{
 
	new TownDirectoryWindow(&_town_directory_desc);
 
}
 
@@ -707,13 +704,12 @@ struct ScenarioEditorTownGenerationWindo
 

	
 
static const WindowDesc _scen_edit_town_gen_desc = {
 
	WDP_AUTO, WDP_AUTO, 160, 95, 160, 95,
 
	WC_SCEN_TOWN_GEN, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_scen_edit_town_gen_widgets,
 
	NULL,
 
};
 

	
 
void ShowBuildTownWindow()
 
{
 
	if (_game_mode != GM_EDITOR && !IsValidPlayer(_current_player)) return;
 
	AllocateWindowDescFront<ScenarioEditorTownGenerationWindow>(&_scen_edit_town_gen_desc, 0);
src/transparency_gui.cpp
Show inline comments
 
@@ -122,13 +122,12 @@ static const Widget _transparency_widget
 

	
 
static const WindowDesc _transparency_desc = {
 
	WDP_ALIGN_TBR, 58+36, 219, 49, 219, 49,
 
	WC_TRANSPARENCY_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_transparency_widgets,
 
	NULL
 
};
 

	
 
void ShowTransparencyToolbar(void)
 
{
 
	AllocateWindowDescFront<TransparenciesWindow>(&_transparency_desc, 0);
 
}
src/tree_gui.cpp
Show inline comments
 
@@ -172,13 +172,12 @@ static const Widget _build_trees_widgets
 

	
 
static const WindowDesc _build_trees_desc = {
 
	WDP_AUTO, WDP_AUTO, 143, 184, 143, 184,
 
	WC_BUILD_TREES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	_build_trees_widgets,
 
	NULL
 
};
 

	
 
void ShowBuildTreesToolbar()
 
{
 
	if (_game_mode != GM_EDITOR && !IsValidPlayer(_current_player)) return;
 
	AllocateWindowDescFront<BuildTreesWindow>(&_build_trees_desc, 0);
src/vehicle_gui.cpp
Show inline comments
 
@@ -429,13 +429,12 @@ static const Widget _vehicle_refit_widge
 

	
 
static const WindowDesc _vehicle_refit_desc = {
 
	WDP_AUTO, WDP_AUTO, 240, 174, 240, 174,
 
	WC_VEHICLE_REFIT, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_vehicle_refit_widgets,
 
	NULL
 
};
 

	
 
/** Show the refit window for a vehicle
 
* @param *v The vehicle to show the refit window for
 
* @param order of the vehicle ( ? )
 
*/
 
@@ -1155,37 +1154,33 @@ struct VehicleListWindow : public Window
 

	
 
static const WindowDesc _player_vehicle_list_train_desc = {
 
	WDP_AUTO, WDP_AUTO, 260, 182, 260, 182,
 
	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,
 
	NULL
 
};
 

	
 
static const WindowDesc _player_vehicle_list_road_veh_desc = {
 
	WDP_AUTO, WDP_AUTO, 260, 182, 260, 182,
 
	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,
 
	NULL
 
};
 

	
 
static const WindowDesc _player_vehicle_list_ship_desc = {
 
	WDP_AUTO, WDP_AUTO, 260, 182, 260, 182,
 
	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,
 
	NULL
 
};
 

	
 
static const WindowDesc _player_vehicle_list_aircraft_desc = {
 
	WDP_AUTO, WDP_AUTO, 260, 182, 260, 182,
 
	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,
 
	NULL
 
};
 

	
 
static void ShowVehicleListWindowLocal(PlayerID player, uint16 VLW_flag, VehicleType vehicle_type, uint16 unique_number)
 
{
 
	VehicleListWindow *w;
 
	WindowNumber num;
 
@@ -1610,13 +1605,12 @@ struct VehicleDetailsWindow : Window {
 
/** Vehicle details window descriptor. */
 
static const WindowDesc _vehicle_details_desc = {
 
	WDP_AUTO, WDP_AUTO, 405, 113, 405, 113,
 
	WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	_vehicle_details_widgets,
 
	NULL
 
};
 

	
 
/** Shows the vehicle details window of the given vehicle. */
 
static void ShowVehicleDetailsWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_ORDERS, v->index);
 
@@ -1652,24 +1646,22 @@ static const Widget _vehicle_view_widget
 
/** Vehicle view window descriptor for all vehicles but trains. */
 
static const WindowDesc _vehicle_view_desc = {
 
	WDP_AUTO, WDP_AUTO, 250, 116, 250, 116,
 
	WC_VEHICLE_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_vehicle_view_widgets,
 
	NULL
 
};
 

	
 
/** Vehicle view window descriptor for trains. Only minimum_height and
 
 *  default_height are different for train view.
 
 */
 
static const WindowDesc _train_view_desc = {
 
	WDP_AUTO, WDP_AUTO, 250, 134, 250, 134,
 
	WC_VEHICLE_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_vehicle_view_widgets,
 
	NULL
 
};
 

	
 

	
 
/* Just to make sure, nobody has changed the vehicle type constants, as we are
 
	 using them for array indexing in a number of places here. */
 
assert_compile(VEH_TRAIN == 0);
src/window.cpp
Show inline comments
 
@@ -45,175 +45,12 @@ byte _scroller_click_timeout;
 
bool _scrolling_scrollbar;
 
bool _scrolling_viewport;
 

	
 
byte _special_mouse_mode;
 

	
 

	
 
/**
 
 * Call the window event handler for handling event \a e.
 
 * This is a temporary helper functions that will be removed
 
 * once all windows that still rely on WindowEvent and
 
 * WindowEventCodes have been rewritten to use the 'OnXXX'
 
 * event handlers.
 
 * @param e Window event to handle
 
 */
 
void Window::HandleWindowEvent(WindowEvent *e)
 
{
 
	if (wndproc != NULL) wndproc(this, e);
 
}
 

	
 
void Window::OnPaint()
 
{
 
	WindowEvent e;
 
	e.event = WE_PAINT;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
Window::EventState Window::OnKeyPress(uint16 key, uint16 keycode)
 
{
 
	WindowEvent e;
 
	e.event = WE_KEYPRESS;
 
	e.we.keypress.key     = key;
 
	e.we.keypress.keycode = keycode;
 
	e.we.keypress.cont    = true;
 
	this->HandleWindowEvent(&e);
 

	
 
	return e.we.keypress.cont ? ES_NOT_HANDLED : ES_HANDLED;
 
}
 

	
 
Window::EventState Window::OnCTRLStateChange()
 
{
 
	WindowEvent e;
 
	e.event = WE_CTRL_CHANGED;
 
	e.we.ctrl.cont = true;
 
	this->HandleWindowEvent(&e);
 

	
 
	return e.we.ctrl.cont ? ES_NOT_HANDLED : ES_HANDLED;
 
}
 

	
 
void Window::OnClick(Point pt, int widget)
 
{
 
	WindowEvent e;
 
	e.event = WE_CLICK;
 
	e.we.click.pt     = pt;
 
	e.we.click.widget = widget;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnMouseLoop()
 
{
 
	WindowEvent e;
 
	e.event = WE_MOUSELOOP;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnTick()
 
{
 
	WindowEvent e;
 
	e.event = WE_TICK;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnHundredthTick()
 
{
 
	WindowEvent e;
 
	e.event = WE_100_TICKS;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnTimeout()
 
{
 
	WindowEvent e;
 
	e.event = WE_TIMEOUT;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnResize(Point new_size, Point delta)
 
{
 
	WindowEvent e;
 
	e.event = WE_RESIZE;
 
	e.we.sizing.size = new_size;
 
	e.we.sizing.diff = delta;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnDropdownSelect(int widget, int index)
 
{
 
	WindowEvent e;
 
	e.event = WE_DROPDOWN_SELECT;
 
	e.we.dropdown.button = widget;
 
	e.we.dropdown.index  = index;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnQueryTextFinished(char *str)
 
{
 
	WindowEvent e;
 
	e.event = WE_ON_EDIT_TEXT;
 
	e.we.edittext.str = str;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnInvalidateData(int data)
 
{
 
	WindowEvent e;
 
	e.event = WE_INVALIDATE_DATA;
 
	e.we.invalidate.data = data;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnPlaceObject(Point pt, TileIndex tile)
 
{
 
	WindowEvent e;
 
	e.event = WE_PLACE_OBJ;
 
	e.we.place.pt   = pt;
 
	e.we.place.tile = tile;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnPlaceObjectAbort()
 
{
 
	WindowEvent e;
 
	e.event = WE_ABORT_PLACE_OBJ;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 

	
 
void Window::OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
 
{
 
	WindowEvent e;
 
	e.event = WE_PLACE_DRAG;
 
	e.we.place.select_method = select_method;
 
	e.we.place.select_proc   = select_proc;
 
	e.we.place.pt            = pt;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
 
{
 
	WindowEvent e;
 
	e.event = WE_PLACE_MOUSEUP;
 
	e.we.place.select_method = select_method;
 
	e.we.place.select_proc   = select_proc;
 
	e.we.place.pt            = pt;
 
	e.we.place.tile          = end_tile;
 
	e.we.place.starttile     = start_tile;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
void Window::OnPlacePresize(Point pt, TileIndex tile)
 
{
 
	WindowEvent e;
 
	e.event = WE_PLACE_PRESIZE;
 
	e.we.place.pt   = pt;
 
	e.we.place.tile = tile;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 

	
 

	
 
void CDECL Window::SetWidgetsDisabledState(bool disab_stat, int widgets, ...)
 
{
 
	va_list wdg_list;
 

	
 
	va_start(wdg_list, widgets);
 

	
 
@@ -578,15 +415,12 @@ Window::~Window()
 
	Window *child = FindChildWindow(this);
 
	while (child != NULL) {
 
		delete child;
 
		child = FindChildWindow(this);
 
	}
 

	
 
	WindowEvent e;
 
	e.event = WE_DESTROY;
 
	this->HandleWindowEvent(&e);
 
	if (this->viewport != NULL) DeleteWindowViewport(this);
 

	
 
	this->SetDirty();
 
	free(this->widget);
 
}
 

	
 
@@ -828,20 +662,19 @@ static void AssignWidgetToWindow(Window 
 
 * See descriptions for those functions for usage
 
 * Only addition here is window_number, which is the window_number being assigned to the new window
 
 * @param x offset in pixels from the left of the screen
 
 * @param y offset in pixels from the top of the screen
 
 * @param min_width minimum width in pixels of the window
 
 * @param min_height minimum height in pixels of the window
 
 * @param *proc see WindowProc function to call when any messages/updates happen to the window
 
 * @param cls see WindowClass class of the window, used for identification and grouping
 
 * @param *widget see Widget pointer to the window layout and various elements
 
 * @param window_number number being assigned to the new window
 
 * @return Window pointer of the newly created window
 
 */
 
void Window::Initialize(int x, int y, int min_width, int min_height,
 
				WindowProc *proc, WindowClass cls, const Widget *widget, int window_number)
 
				WindowClass cls, const Widget *widget, int window_number)
 
{
 
	/* We have run out of windows, close one and use that as the place for our new one */
 
	if (_last_z_window == endof(_z_windows)) {
 
		Window *w = FindDeletableWindow();
 
		if (w == NULL) w = ForceFindDeletableWindow();
 
		delete w;
 
@@ -852,13 +685,12 @@ void Window::Initialize(int x, int y, in
 
	this->flags4 = WF_WHITE_BORDER_MASK; // just opened windows have a white border
 
	this->caption_color = 0xFF;
 
	this->left = x;
 
	this->top = y;
 
	this->width = min_width;
 
	this->height = min_height;
 
	this->wndproc = proc;
 
	AssignWidgetToWindow(this, widget);
 
	this->resize.width = min_width;
 
	this->resize.height = min_height;
 
	this->resize.step_width = 1;
 
	this->resize.step_height = 1;
 
	this->window_number = window_number;
 
@@ -881,16 +713,12 @@ void Window::Initialize(int x, int y, in
 
		assert(wz >= _z_windows);
 
		if (wz != _last_z_window) memmove(wz + 1, wz, (byte*)_last_z_window - (byte*)wz);
 
	}
 

	
 
	*wz = this;
 
	_last_z_window++;
 

	
 
	WindowEvent e;
 
	e.event = WE_CREATE;
 
	this->HandleWindowEvent(&e);
 
}
 

	
 
/**
 
 * Find a nice spot for this window and resize it towards the default size.
 
 * @param def_width default width in pixels of the window
 
 * @param def_height default height in pixels of the window
 
@@ -966,13 +794,13 @@ void Window::FindWindowPlacementAndResiz
 
 * @param cls see WindowClass class of the window, used for identification and grouping
 
 * @param *widget see Widget pointer to the window layout and various elements
 
 * @return Window pointer of the newly created window
 
 */
 
Window::Window(int x, int y, int width, int height, WindowClass cls, const Widget *widget)
 
{
 
	this->Initialize(x, y, width, height, NULL, cls, widget, 0);
 
	this->Initialize(x, y, width, height, cls, widget, 0);
 
}
 

	
 

	
 
static bool IsGoodAutoPlace1(int left, int top, int width, int height, Point &pos)
 
{
 
	Window* const *wz;
 
@@ -1158,16 +986,14 @@ static Point LocalGetWindowPlacement(con
 
 *
 
 * @return Window pointer of the newly created window
 
 */
 
Window::Window(const WindowDesc *desc, WindowNumber window_number)
 
{
 
	Point pt = LocalGetWindowPlacement(desc, window_number);
 
	this->Initialize(pt.x, pt.y, desc->minimum_width, desc->minimum_height, desc->proc, desc->cls, desc->widgets, window_number);
 
	this->Initialize(pt.x, pt.y, desc->minimum_width, desc->minimum_height, desc->cls, desc->widgets, window_number);
 
	this->desc_flags = desc->flags;
 

	
 
	if (desc->proc != NULL) this->FindWindowPlacementAndResize(desc->default_width, desc->default_height);
 
}
 

	
 
/** Do a search for a window at specific coordinates. For this we start
 
 * at the topmost window, obviously and work our way down to the bottom
 
 * @param x position x to query
 
 * @param y position y to query
src/window_gui.h
Show inline comments
 
@@ -101,94 +101,12 @@ enum FrameFlags {
 
DECLARE_ENUM_AS_BIT_SET(FrameFlags);
 

	
 
/* wiget.cpp */
 
void DrawFrameRect(int left, int top, int right, int bottom, int color, FrameFlags flags);
 

	
 
/**
 
 * Available window events
 
 */
 
enum WindowEventCodes {
 
	WE_CREATE,       ///< Initialize the Window
 
	WE_DESTROY,      ///< Prepare for deletion of the window
 
	WE_PAINT,        ///< Repaint the window contents
 
	WE_KEYPRESS,     ///< Key pressed
 
	WE_CLICK,        ///< Left mouse button click
 
	WE_MOUSELOOP,    ///< Event for each mouse event in the game (at least once every game tick)
 
	WE_TICK,         ///< Regularly occurring event (every game tick)
 
	WE_100_TICKS,    ///< Regularly occurring event (every 100 game ticks, approximatelly 3 seconds)
 
	WE_TIMEOUT,
 
	WE_PLACE_OBJ,
 
	WE_ABORT_PLACE_OBJ,
 
	WE_ON_EDIT_TEXT,
 
	WE_PLACE_DRAG,
 
	WE_PLACE_MOUSEUP,
 
	WE_PLACE_PRESIZE,
 
	WE_DROPDOWN_SELECT,
 
	WE_RESIZE,          ///< Request to resize the window, @see WindowEvent.we.resize
 
	WE_INVALIDATE_DATA, ///< Notification that data displayed by the window is obsolete
 
	WE_CTRL_CHANGED,    ///< CTRL key has changed state
 
};
 

	
 
/**
 
 * Data structures for additional data associated with a window event
 
 * @see WindowEventCodes
 
 */
 
struct WindowEvent {
 
	byte event;
 
	union {
 
		struct {
 
			Point pt;
 
			int widget;
 
		} click;
 

	
 
		struct {
 
			Point pt;
 
			TileIndex tile;
 
			TileIndex starttile;
 
			ViewportPlaceMethod select_method;
 
			ViewportDragDropSelectionProcess select_proc;
 
		} place;
 

	
 
		struct {
 
			Point pt;
 
			int widget;
 
		} dragdrop;
 

	
 
		struct {
 
			Point size;
 
			Point diff;
 
		} sizing;
 

	
 
		struct {
 
			char *str;
 
		} edittext;
 

	
 
		struct {
 
			int button;
 
			int index;
 
		} dropdown;
 

	
 
		struct {
 
			bool cont;      ///< continue the search? (default true)
 
			uint16 key;     ///< 16-bit Unicode value of the key
 
			uint16 keycode; ///< untranslated key (including shift-state)
 
		} keypress;
 

	
 
		struct {
 
			int data;
 
		} invalidate;
 

	
 
		struct {
 
			bool cont;     ///< continue the search? (default true)
 
		} ctrl;
 
	} we;
 
};
 

	
 
typedef void WindowProc(Window *w, WindowEvent *e);
 

	
 
/**
 
 * High level window description
 
 */
 
struct 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()
 
	int16 minimum_width;    ///< Minimal width of the window
 
@@ -196,13 +114,12 @@ struct WindowDesc {
 
	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
 
	WindowClass parent_cls; ///< Class of the parent window, @see WindowClass
 
	uint32 flags;           ///< Flags, @see WindowDefaultFlags
 
	const Widget *widgets;  ///< List of widgets with their position and size for the window
 
	WindowProc *proc;       ///< Window event handler function for the window
 
};
 

	
 
/**
 
 * Window default widget/window handling flags
 
 */
 
enum WindowDefaultFlag {
 
@@ -268,19 +185,15 @@ struct ViewportData : ViewPort {
 
struct Window : ZeroedMemoryAllocator {
 
	enum EventState {
 
		ES_HANDLED,
 
		ES_NOT_HANDLED,
 
	};
 

	
 
private:
 
	WindowProc *wndproc;   ///< Event handler function for the window. Do not use directly, call HandleWindowEvent() instead.
 
	void HandleWindowEvent(WindowEvent *e);
 

	
 
protected:
 
	void Initialize(int x, int y, int min_width, int min_height,
 
			WindowProc *proc, WindowClass cls, const Widget *widget, int window_number);
 
			WindowClass cls, const Widget *widget, int window_number);
 
	void FindWindowPlacementAndResize(int def_width, int def_height);
 
	void FindWindowPlacementAndResize(const WindowDesc *desc);
 

	
 
public:
 
	Window(int x, int y, int width, int height, WindowClass cls, const Widget *widget);
 
	Window(const WindowDesc *desc, WindowNumber number = 0);
 
@@ -340,38 +253,38 @@ public:
 

	
 
	/*** Event handling ***/
 

	
 
	/**
 
	 * This window is currently being repainted.
 
	 */
 
	virtual void OnPaint();
 
	virtual void OnPaint() {}
 

	
 

	
 
	/**
 
	 * A key has been pressed.
 
	 * @param key     the Unicode value of the key.
 
	 * @param keycode the untranslated key code including shift state.
 
	 * @return ES_HANDLED if the key press has been handled and no other
 
	 *         window should receive the event.
 
	 */
 
	virtual EventState OnKeyPress(uint16 key, uint16 keycode);
 
	virtual EventState OnKeyPress(uint16 key, uint16 keycode) { return ES_NOT_HANDLED; }
 

	
 
	/**
 
	 * The state of the control key has changed
 
	 * @return ES_HANDLED if the change has been handled and no other
 
	 *         window should receive the event.
 
	 */
 
	virtual EventState OnCTRLStateChange();
 
	virtual EventState OnCTRLStateChange() { return ES_NOT_HANDLED; }
 

	
 

	
 
	/**
 
	 * A click with the left mouse button has been made on the window.
 
	 * @param pt     the point inside the window that has been clicked.
 
	 * @param widget the clicked widget.
 
	 */
 
	virtual void OnClick(Point pt, int widget);
 
	virtual void OnClick(Point pt, int widget) {}
 

	
 
	/**
 
	 * A double click with the left mouse button has been made on the window.
 
	 * @param pt     the point inside the window that has been clicked.
 
	 * @param widget the clicked widget.
 
	 */
 
@@ -412,100 +325,100 @@ public:
 
	virtual void OnMouseWheel(int wheel) {}
 

	
 

	
 
	/**
 
	 * Called for every mouse loop run, which is at least once per (game) tick.
 
	 */
 
	virtual void OnMouseLoop();
 
	virtual void OnMouseLoop() {}
 

	
 
	/**
 
	 * Called once per (game) tick.
 
	 */
 
	virtual void OnTick();
 
	virtual void OnTick() {}
 

	
 
	/**
 
	 * Called once every 100 (game) ticks.
 
	 */
 
	virtual void OnHundredthTick();
 
	virtual void OnHundredthTick() {}
 

	
 
	/**
 
	 * Called when this window's timeout has been reached.
 
	 */
 
	virtual void OnTimeout();
 
	virtual void OnTimeout() {}
 

	
 

	
 
	/**
 
	 * Called when the window got resized.
 
	 * @param new_size the new size of the window.
 
	 * @param delta    the amount of which the window size changed.
 
	 */
 
	virtual void OnResize(Point new_size, Point delta);
 
	virtual void OnResize(Point new_size, Point delta) {}
 

	
 
	/**
 
	 * A dropdown option associated to this window has been selected.
 
	 * @param widget the widget (button) that the dropdown is associated with.
 
	 * @param index  the element in the dropdown that is selected.
 
	 */
 
	virtual void OnDropdownSelect(int widget, int index);
 
	virtual void OnDropdownSelect(int widget, int index) {}
 

	
 
	/**
 
	 * The query window opened from this window has closed.
 
	 * @param str the new value of the string or NULL if the window
 
	 *            was cancelled.
 
	 */
 
	virtual void OnQueryTextFinished(char *str);
 
	virtual void OnQueryTextFinished(char *str) {}
 

	
 
	/**
 
	 * Some data on this window has become invalid.
 
	 * @param data information about the changed data.
 
	 */
 
	virtual void OnInvalidateData(int data = 0);
 
	virtual void OnInvalidateData(int data = 0) {}
 

	
 

	
 
	/**
 
	 * The user clicked some place on the map when a tile highlight mode
 
	 * has been set.
 
	 * @param pt   the exact point on the map that has been clicked.
 
	 * @param tile the tile on the map that has been clicked.
 
	 */
 
	virtual void OnPlaceObject(Point pt, TileIndex tile);
 
	virtual void OnPlaceObject(Point pt, TileIndex tile) {}
 

	
 
	/**
 
	 * The user cancelled a tile highlight mode that has been set.
 
	 */
 
	virtual void OnPlaceObjectAbort();
 
	virtual void OnPlaceObjectAbort() {}
 

	
 

	
 
	/**
 
	 * The user is dragging over the map when the tile highlight mode
 
	 * has been set.
 
	 * @param select_method the method of selection (allowed directions)
 
	 * @param select_proc   what will be created when the drag is over.
 
	 * @param pt            the exact point on the map where the mouse is.
 
	 */
 
	virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt);
 
	virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) {}
 

	
 
	/**
 
	 * The user has dragged over the map when the tile highlight mode
 
	 * has been set.
 
	 * @param select_method the method of selection (allowed directions)
 
	 * @param select_proc   what should be created.
 
	 * @param pt            the exact point on the map where the mouse was released.
 
	 * @param start_tile    the begin tile of the drag.
 
	 * @param end_tile      the end tile of the drag.
 
	 */
 
	virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile);
 
	virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) {}
 

	
 
	/**
 
	 * The user moves over the map when a tile highlight mode has been set
 
	 * when the special mouse mode has been set to 'PRESIZE' mode. An
 
	 * example of this is the tile highlight for dock building.
 
	 * @param pt   the exact point on the map where the mouse is.
 
	 * @param tile the tile on the map where the mouse is.
 
	 */
 
	virtual void OnPlacePresize(Point pt, TileIndex tile);
 
	virtual void OnPlacePresize(Point pt, TileIndex tile) {}
 

	
 
	/*** End of the event handling ***/
 
};
 

	
 
/**
 
 * Data structure for a window opened from a toolbar
0 comments (0 inline, 0 general)