Changeset - r13554:d1964ead02ee
src/ai/ai_gui.cpp
Show inline comments
 
@@ -227,25 +227,25 @@ static const NWidgetPart _nested_ai_list
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIL_WIDGET_CONTENT_DOWNLOAD), SetMinimalSize(188, 12), SetResize(1, 0), SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT),
 
		NWidget(WWT_RESIZEBOX, COLOUR_MAUVE, AIL_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
/* Window definition for the ai list window. */
 
static const WindowDesc _ai_list_desc(
 
	WDP_CENTER, WDP_CENTER, 200, 234, 200, 234,
 
	WC_AI_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	NULL, _nested_ai_list_widgets, lengthof(_nested_ai_list_widgets)
 
	_nested_ai_list_widgets, lengthof(_nested_ai_list_widgets)
 
);
 

	
 
static void ShowAIListWindow(CompanyID slot)
 
{
 
	DeleteWindowByClass(WC_AI_LIST);
 
	new AIListWindow(&_ai_list_desc, slot);
 
}
 

	
 
/** Enum referring to the widgets of the AI settings window */
 
enum AISettingsWindowWidgest {
 
	AIS_WIDGET_CLOSEBOX = 0, ///< Close window button
 
	AIS_WIDGET_CAPTION,      ///< Window caption
 
@@ -426,25 +426,25 @@ static const NWidgetPart _nested_ai_sett
 
	NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIS_WIDGET_ACCEPT), SetMinimalSize(94, 12), SetResize(1, 0), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIS_WIDGET_RESET), SetMinimalSize(94, 12), SetResize(1, 0), SetDataTip(STR_AI_SETTINGS_RESET, STR_NULL),
 
		NWidget(WWT_RESIZEBOX, COLOUR_MAUVE, AIS_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
/* Window definition for the AI settings window. */
 
static const WindowDesc _ai_settings_desc(
 
	WDP_CENTER, WDP_CENTER, 200, 208, 500, 208,
 
	WC_AI_SETTINGS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	NULL, _nested_ai_settings_widgets, lengthof(_nested_ai_settings_widgets)
 
	_nested_ai_settings_widgets, lengthof(_nested_ai_settings_widgets)
 
);
 

	
 
static void ShowAISettingsWindow(CompanyID slot)
 
{
 
	DeleteWindowByClass(WC_AI_LIST);
 
	DeleteWindowByClass(WC_AI_SETTINGS);
 
	new AISettingsWindow(&_ai_settings_desc, slot);
 
}
 

	
 
/** Enum referring to the widgets of the AI config window */
 
enum AIConfigWindowWidgets {
 
	AIC_WIDGET_CLOSEBOX = 0, ///< Close window button
 
@@ -475,25 +475,25 @@ static const NWidgetPart _nested_ai_conf
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_CONFIGURE), SetFill(true, false), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_CLOSE), SetFill(true, false), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 9),
 
	EndContainer(),
 
};
 

	
 
/* Window definition for the configure AI window. */
 
static const WindowDesc _ai_config_desc(
 
	WDP_CENTER, WDP_CENTER, 300, 172, 300, 172,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	NULL, _nested_ai_config_widgets, lengthof(_nested_ai_config_widgets)
 
	_nested_ai_config_widgets, lengthof(_nested_ai_config_widgets)
 
);
 

	
 
/**
 
 * Window to configure which AIs will start.
 
 */
 
struct AIConfigWindow : public Window {
 
	CompanyID selected_slot;
 
	bool clicked_button;
 
	bool clicked_increase;
 
	int timeout;
 
	int line_height;
 

	
 
@@ -943,25 +943,25 @@ static const NWidgetPart _nested_ai_debu
 
		EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_SCROLLBAR, COLOUR_GREY, AID_WIDGET_SCROLLBAR),
 
			NWidget(WWT_RESIZEBOX, COLOUR_GREY, AID_WIDGET_RESIZE),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _ai_debug_desc(
 
	WDP_AUTO, WDP_AUTO, 299, 241, 299, 241,
 
	WC_AI_DEBUG, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_ai_debug_widgets, lengthof(_nested_ai_debug_widgets)
 
	_nested_ai_debug_widgets, lengthof(_nested_ai_debug_widgets)
 
);
 

	
 
void ShowAIDebugWindow(CompanyID show_company)
 
{
 
	if (!_networking || _network_server) {
 
		AIDebugWindow *w = (AIDebugWindow *)BringWindowToFrontById(WC_AI_DEBUG, 0);
 
		if (w == NULL) w = new AIDebugWindow(&_ai_debug_desc, 0);
 
		if (show_company != INVALID_COMPANY) w->ChangeToAI(show_company);
 
	} else {
 
		ShowErrorMessage(STR_ERROR_AI_DEBUG_SERVER_ONLY, INVALID_STRING_ID, 0, 0);
 
	}
 
}
src/airport_gui.cpp
Show inline comments
 
@@ -145,25 +145,25 @@ static const NWidgetPart _nested_air_too
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, ATW_AIRPORT), SetFill(false, true), SetMinimalSize(42, 22), SetDataTip(SPR_IMG_AIRPORT, STR_TOOLBAR_AIRCRAFT_BUILD_AIRPORT_TOOLTIP),
 
		NWidget(WWT_PANEL, COLOUR_DARK_GREEN, ATW_SPACER), SetMinimalSize(4, 22), SetFill(true, true), EndContainer(),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, ATW_DEMOLISH), SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_air_toolbar_widgets, lengthof(_nested_air_toolbar_widgets)
 
	_nested_air_toolbar_widgets, lengthof(_nested_air_toolbar_widgets)
 
);
 

	
 
void ShowBuildAirToolbar()
 
{
 
	if (!Company::IsValidID(_local_company)) return;
 

	
 
	DeleteWindowByClass(WC_BUILD_TOOLBAR);
 
	AllocateWindowDescFront<BuildAirToolbarWindow>(&_air_toolbar_desc, TRANSPORT_AIR);
 
}
 

	
 
/** Airport widgets in the airport picker window. */
 
enum AirportPickerWidgets {
 
@@ -378,24 +378,24 @@ static const NWidgetPart _nested_build_a
 
											SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP),
 
			EndContainer(),
 
			NWidget(NWID_SPACER), SetMinimalSize(14, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 10), SetResize(0, 1), SetFill(true, false),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _build_airport_desc(
 
	WDP_AUTO, WDP_AUTO, 148, 245, 148, 245,
 
	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	NULL, _nested_build_airport_widgets, lengthof(_nested_build_airport_widgets)
 
	_nested_build_airport_widgets, lengthof(_nested_build_airport_widgets)
 
);
 

	
 
static void ShowBuildAirportPicker(Window *parent)
 
{
 
	new AirportPickerWindow(&_build_airport_desc, parent);
 
}
 

	
 
void InitializeAirportGui()
 
{
 
	_selected_airport_type = AT_SMALL;
 
}
src/autoreplace_gui.cpp
Show inline comments
 
@@ -519,25 +519,25 @@ static const NWidgetPart _nested_replace
 
		NWidget(WWT_PANEL, COLOUR_GREY, RVW_WIDGET_TRAIN_FLUFF_LEFT), SetMinimalSize(15, 12), EndContainer(),
 
		NWidget(WWT_DROPDOWN, COLOUR_GREY, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN), SetMinimalSize(136, 12), SetDataTip(0x0, STR_REPLACE_HELP_RAILTYPE), SetResize(1, 0),
 
		NWidget(WWT_PANEL, COLOUR_GREY, RVW_WIDGET_TRAIN_FLUFF_RIGHT), SetMinimalSize(16, 12), EndContainer(),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE), SetMinimalSize(138, 12), SetDataTip(STR_REPLACE_REMOVE_WAGON, STR_REPLACE_REMOVE_WAGON_HELP),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, RVW_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_replace_rail_vehicle_widgets, lengthof(_nested_replace_rail_vehicle_widgets)
 
	_nested_replace_rail_vehicle_widgets, lengthof(_nested_replace_rail_vehicle_widgets)
 
);
 

	
 
static const NWidgetPart _nested_replace_vehicle_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, RVW_WIDGET_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, RVW_WIDGET_CAPTION), SetMinimalSize(433, 14), SetDataTip(STR_REPLACE_VEHICLES_WHITE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY, RVW_WIDGET_STICKY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
		NWidget(WWT_MATRIX, COLOUR_GREY, RVW_WIDGET_LEFT_MATRIX), SetMinimalSize(216, 0), SetDataTip(0x1, STR_REPLACE_HELP_LEFT_ARRAY), SetResize(1, 1),
 
		NWidget(WWT_SCROLLBAR, COLOUR_GREY, RVW_WIDGET_LEFT_SCROLLBAR),
 
		NWidget(WWT_MATRIX, COLOUR_GREY, RVW_WIDGET_RIGHT_MATRIX), SetMinimalSize(216, 0), SetDataTip(0x1, STR_REPLACE_HELP_RIGHT_ARRAY), SetResize(1, 1),
 
@@ -550,20 +550,20 @@ static const NWidgetPart _nested_replace
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, RVW_WIDGET_START_REPLACE), SetMinimalSize(139, 12), SetDataTip(STR_REPLACE_VEHICLES_START, STR_REPLACE_HELP_START_BUTTON),
 
		NWidget(WWT_PANEL, COLOUR_GREY, RVW_WIDGET_INFO_TAB), SetMinimalSize(167, 12), SetDataTip(0x0, STR_REPLACE_HELP_REPLACE_INFO_TAB), SetResize(1, 0), EndContainer(),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, RVW_WIDGET_STOP_REPLACE), SetMinimalSize(138, 12), SetDataTip(STR_REPLACE_VEHICLES_STOP, STR_REPLACE_HELP_STOP_BUTTON),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, RVW_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_replace_vehicle_widgets, lengthof(_nested_replace_vehicle_widgets)
 
	_nested_replace_vehicle_widgets, lengthof(_nested_replace_vehicle_widgets)
 
);
 

	
 
void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
 
{
 
	DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype);
 
	new ReplaceVehicleWindow(vehicletype == VEH_TRAIN ? &_replace_rail_vehicle_desc : &_replace_vehicle_desc, vehicletype, id_g);
 
}
src/bridge_gui.cpp
Show inline comments
 
@@ -333,25 +333,25 @@ static const NWidgetPart _nested_build_b
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_SCROLLBAR, COLOUR_DARK_GREEN, BBSW_SCROLLBAR), SetFill(false, true),
 
			NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN, BBSW_RESIZEBOX),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
/* 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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_bridge_widgets, lengthof(_nested_build_bridge_widgets)
 
	_nested_build_bridge_widgets, lengthof(_nested_build_bridge_widgets)
 
);
 

	
 
/**
 
 * Prepare the data for the build a bridge window.
 
 *  If we can't build a bridge under the given conditions
 
 *  show an error message.
 
 *
 
 * @param start The start tile of the bridge
 
 * @param end The end tile of the bridge
 
 * @param transport_type The transport type
 
 * @param road_rail_type The road/rail type
 
 */
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1178,25 +1178,25 @@ struct BuildVehicleWindow : Window {
 

	
 
	virtual void OnResize()
 
	{
 
		this->vscroll.SetCapacity((this->GetWidget<NWidgetCore>(BUILD_VEHICLE_WIDGET_LIST)->current_y) / this->resize.step_height);
 
		this->GetWidget<NWidgetCore>(BUILD_VEHICLE_WIDGET_LIST)->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
 
	}
 
};
 

	
 
static const WindowDesc _build_vehicle_desc(
 
	WDP_AUTO, WDP_AUTO, 240, 186, 240, 268,
 
	WC_BUILD_VEHICLE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	NULL, _nested_build_vehicle_widgets, lengthof(_nested_build_vehicle_widgets)
 
	_nested_build_vehicle_widgets, lengthof(_nested_build_vehicle_widgets)
 
);
 

	
 
void ShowBuildVehicleWindow(TileIndex tile, VehicleType type)
 
{
 
	/* We want to be able to open both Available Train as Available Ships,
 
	 *  so if tile == INVALID_TILE (Available XXX Window), use 'type' as unique number.
 
	 *  As it always is a low value, it won't collide with any real tile
 
	 *  number. */
 
	uint num = (tile == INVALID_TILE) ? (int)type : tile;
 

	
 
	assert(IsCompanyBuildableVehicleType(type));
 

	
src/cheat_gui.cpp
Show inline comments
 
@@ -302,21 +302,21 @@ struct CheatWindow : Window {
 

	
 
	virtual void OnTimeout()
 
	{
 
		this->clicked = 0;
 
		this->SetDirty();
 
	}
 
};
 

	
 
static const WindowDesc _cheats_desc(
 
	240, 22, 0, 0, 0, 0,
 
	WC_CHEATS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	NULL, _nested_cheat_widgets, lengthof(_nested_cheat_widgets)
 
	_nested_cheat_widgets, lengthof(_nested_cheat_widgets)
 
);
 

	
 

	
 
void ShowCheatWindow()
 
{
 
	DeleteWindowById(WC_CHEATS, 0);
 
	new CheatWindow(&_cheats_desc);
 
}
src/company_gui.cpp
Show inline comments
 
@@ -452,25 +452,25 @@ struct CompanyFinancesWindow : Window {
 

	
 
			case CFW_REPAY_LOAN: // repay loan
 
				DoCommandP(0, 0, _ctrl_pressed, CMD_DECREASE_LOAN | CMD_MSG(STR_ERROR_CAN_T_REPAY_LOAN));
 
				break;
 
		}
 
	}
 
};
 

	
 
static const WindowDesc _company_finances_desc(
 
	WDP_AUTO, WDP_AUTO, 0, 0, 0, 0,
 
	WC_FINANCES, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	NULL, _nested_company_finances_widgets, lengthof(_nested_company_finances_widgets)
 
	_nested_company_finances_widgets, lengthof(_nested_company_finances_widgets)
 
);
 

	
 
/** Open the finances window of a company.
 
 * @param company Company to show finances of.
 
 * @pre is company a valid company.
 
 */
 
void ShowCompanyFinances(CompanyID company)
 
{
 
	if (!Company::IsValidID(company)) return;
 
	if (BringWindowToFrontById(WC_FINANCES, company)) return;
 

	
 
	new CompanyFinancesWindow(&_company_finances_desc, company);
 
@@ -792,25 +792,25 @@ static const NWidgetPart _nested_select_
 
		NWidget(WWT_PANEL, COLOUR_GREY, SCLW_WIDGET_SPACER_DROPDOWN), SetMinimalSize(150, 12), SetFill(true, true), EndContainer(),
 
		NWidget(WWT_DROPDOWN, COLOUR_GREY, SCLW_WIDGET_PRI_COL_DROPDOWN), SetMinimalSize(125, 12), SetFill(false, true), SetDataTip(STR_BLACK_STRING, STR_LIVERY_PRIMARY_TOOLTIP),
 
		NWidget(WWT_DROPDOWN, COLOUR_GREY, SCLW_WIDGET_SEC_COL_DROPDOWN), SetMinimalSize(125, 12), SetFill(false, true),
 
				SetDataTip(STR_BLACK_STRING, STR_LIVERY_SECONDARY_TOOLTIP),
 
	EndContainer(),
 
	NWidget(WWT_MATRIX, COLOUR_GREY, SCLW_WIDGET_MATRIX), SetMinimalSize(275, 15), SetFill(true, false), SetDataTip((1 << MAT_ROW_START) | (1 << MAT_COL_START), STR_LIVERY_PANEL_TOOLTIP),
 
};
 

	
 
static const WindowDesc _select_company_livery_desc(
 
	WDP_AUTO, WDP_AUTO, 0, 0, 0, 0,
 
	WC_COMPANY_COLOUR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	NULL, _nested_select_company_livery_widgets, lengthof(_nested_select_company_livery_widgets)
 
	_nested_select_company_livery_widgets, lengthof(_nested_select_company_livery_widgets)
 
);
 

	
 
/**
 
 * Draws the face of a company manager's face.
 
 * @param cmf   the company manager's face
 
 * @param colour the (background) colour of the gradient
 
 * @param x     x-position to draw the face
 
 * @param y     y-position to draw the face
 
 */
 
void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, int x, int y)
 
{
 
	GenderEthnicity ge = (GenderEthnicity)GetCompanyManagerFaceBits(cmf, CMFV_GEN_ETHN, GE_WM);
 
@@ -1373,33 +1373,33 @@ public:
 
			this->SetDirty();
 
		} else {
 
			ShowErrorMessage(STR_FACE_FACECODE_ERR, INVALID_STRING_ID, 0, 0);
 
		}
 
	}
 
};
 

	
 
/** normal/simple company manager face selection window description */
 
static const WindowDesc _select_company_manager_face_desc(
 
	WDP_AUTO, WDP_AUTO, 190, 163, 190, 163,
 
	WC_COMPANY_MANAGER_FACE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
 
	NULL, _nested_select_company_manager_face_widgets, lengthof(_nested_select_company_manager_face_widgets)
 
	_nested_select_company_manager_face_widgets, lengthof(_nested_select_company_manager_face_widgets)
 
);
 

	
 
/** advanced company manager face selection window description */
 
static const WindowDesc _select_company_manager_face_adv_desc(
 
	WDP_AUTO, WDP_AUTO, 220, 220, 220, 220,
 
	WC_COMPANY_MANAGER_FACE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
 
	NULL, _nested_select_company_manager_face_adv_widgets, lengthof(_nested_select_company_manager_face_adv_widgets)
 
	_nested_select_company_manager_face_adv_widgets, lengthof(_nested_select_company_manager_face_adv_widgets)
 
);
 

	
 
/**
 
 * Open the simple/advanced company manager face selection window
 
 *
 
 * @param parent the parent company window
 
 * @param adv    simple or advanced face selection window
 
 * @param top    previous top position of the window
 
 * @param left   previous left position of the window
 
 */
 
static void DoSelectCompanyManagerFace(Window *parent, bool adv, int top, int left)
 
{
 
@@ -1418,41 +1418,24 @@ enum CompanyWindowWidgets {
 
	CW_WIDGET_NEW_FACE,
 
	CW_WIDGET_COLOUR_SCHEME,
 
	CW_WIDGET_PRESIDENT_NAME,
 
	CW_WIDGET_COMPANY_NAME,
 
	CW_WIDGET_BUILD_VIEW_HQ,
 
	CW_WIDGET_RELOCATE_HQ,
 
	CW_WIDGET_BUY_SHARE,
 
	CW_WIDGET_SELL_SHARE,
 
	CW_WIDGET_COMPANY_PASSWORD,
 
	CW_WIDGET_COMPANY_JOIN,
 
};
 

	
 
static const Widget _company_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,     0,    13, STR_BLACK_CROSS,                        STR_TOOLTIP_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_GREY,    11,   359,     0,    13, STR_COMPANY_VIEW_CAPTION,               STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,     0,   359,    14,   157, 0x0,                                    STR_NULL},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,    89,   158,   169, STR_COMPANY_VIEW_NEW_FACE_BUTTON,       STR_COMPANY_VIEW_NEW_FACE_TOOLTIP},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,    90,   179,   158,   169, STR_COMPANY_VIEW_COLOUR_SCHEME_BUTTON,  STR_COMPANY_VIEW_COLOUR_SCHEME_TOOLTIP},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   180,   269,   158,   169, STR_COMPANY_VIEW_PRESIDENT_NAME_BUTTON, STR_COMPANY_VIEW_PRESIDENT_NAME_TOOLTIP},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   270,   359,   158,   169, STR_COMPANY_VIEW_COMPANY_NAME_BUTTON,   STR_COMPANY_VIEW_COMPANY_NAME_TOOLTIP},
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,   266,   355,    18,    29, STR_COMPANY_VIEW_VIEW_HQ_BUTTON,        STR_COMPANY_VIEW_BUILD_HQ_TOOLTIP},
 
{    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,   266,   355,    32,    43, STR_COMPANY_VIEW_RELOCATE_HQ,                        STR_COMPANY_VIEW_RELOCATE_COMPANY_HEADQUARTERS},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,     0,   179,   158,   169, STR_COMPANY_VIEW_BUY_SHARE_BUTTON,      STR_COMPANY_VIEW_BUY_SHARE_TOOLTIP},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   180,   359,   158,   169, STR_COMPANY_VIEW_SELL_SHARE_BUTTON,     STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   266,   355,   138,   149, STR_COMPANY_VIEW_PASSWORD,                   STR_COMPANY_VIEW_PASSWORD_TOOLTIP},
 
{ WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_GREY,   266,   355,   138,   149, STR_COMPANY_VIEW_JOIN,                       STR_COMPANY_VIEW_JOIN_TOOLTIP},
 
{   WIDGETS_END},
 
};
 

	
 
static const NWidgetPart _nested_company_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, CW_WIDGET_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, CW_WIDGET_CAPTION), SetDataTip(STR_COMPANY_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, CW_WIDGET_FACE),
 
		NWidget(NWID_SPACER), SetMinimalSize(360, 4),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(NWID_SPACER), SetFill(true, false),
 
			NWidget(WWT_TEXTBTN, COLOUR_GREY, CW_WIDGET_BUILD_VIEW_HQ), SetMinimalSize(90, 12), SetPadding(0, 4, 0, 0),
 
										SetDataTip(STR_COMPANY_VIEW_VIEW_HQ_BUTTON, STR_COMPANY_VIEW_BUILD_HQ_TOOLTIP),
 
		EndContainer(),
 
@@ -1775,25 +1758,25 @@ struct CompanyWindow : Window
 
			case CW_WIDGET_COMPANY_JOIN:
 
				NetworkClientRequestMove((CompanyID)this->window_number, str);
 
				break;
 
#endif /* ENABLE_NETWORK */
 
		}
 
	}
 
};
 

	
 
static const WindowDesc _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,
 
	_company_widgets, _nested_company_widgets,lengthof(_nested_company_widgets)
 
	_nested_company_widgets, lengthof(_nested_company_widgets)
 
);
 

	
 
void ShowCompany(CompanyID company)
 
{
 
	if (!Company::IsValidID(company)) return;
 

	
 
	AllocateWindowDescFront<CompanyWindow>(&_company_desc, company);
 
}
 

	
 
/** widget numbers of the #BuyCompanyWindow. */
 
enum BuyCompanyWidgets {
 
	BCW_CLOSEBOX,
 
@@ -1887,20 +1870,20 @@ static const NWidgetPart _nested_buy_com
 
			NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(100, 10, 100),
 
				NWidget(WWT_TEXTBTN, COLOUR_LIGHT_BLUE, BCW_NO), SetMinimalSize(60, 12), SetDataTip(STR_QUIT_NO, STR_NULL), SetFill(true, false),
 
				NWidget(WWT_TEXTBTN, COLOUR_LIGHT_BLUE, BCW_YES), SetMinimalSize(60, 12), SetDataTip(STR_QUIT_YES, STR_NULL), SetFill(true, false),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_buy_company_widgets, lengthof(_nested_buy_company_widgets)
 
	_nested_buy_company_widgets, lengthof(_nested_buy_company_widgets)
 
);
 

	
 

	
 
void ShowBuyCompanyDialog(CompanyID company)
 
{
 
	AllocateWindowDescFront<BuyCompanyWindow>(&_buy_company_desc, company);
 
}
src/console_gui.cpp
Show inline comments
 
@@ -152,25 +152,25 @@ static void IConsoleHistoryNavigate(int 
 
enum ConsoleWidgets {
 
	CW_BACKGROUND, ///< Background of the console
 
};
 

	
 
static const struct NWidgetPart _nested_console_window_widgets[] = {
 
	NWidget(WWT_EMPTY, INVALID_COLOUR, CW_BACKGROUND), SetResize(1, 1),
 
};
 

	
 
static const WindowDesc _console_window_desc(
 
	0, 0, 0, 0, 0, 0,
 
	WC_CONSOLE, WC_NONE,
 
	0,
 
	NULL, _nested_console_window_widgets, lengthof(_nested_console_window_widgets)
 
	_nested_console_window_widgets, lengthof(_nested_console_window_widgets)
 
);
 

	
 
struct IConsoleWindow : Window
 
{
 
	static int scroll;
 
	int line_height;
 
	int line_offset;
 

	
 
	IConsoleWindow() : Window()
 
	{
 
		_iconsole_mode = ICONSOLE_OPENED;
 
		this->line_height = FONT_HEIGHT_NORMAL + ICON_LINE_SPACING;
src/depot_gui.cpp
Show inline comments
 
@@ -86,46 +86,46 @@ static const NWidgetPart _nested_train_d
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, DEPOT_WIDGET_LOCATION), SetDataTip(STR_BUTTON_LOCATION, STR_NULL), SetFill(true, true), SetResize(1, 0),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, DEPOT_WIDGET_VEHICLE_LIST), SetDataTip(0x0, STR_NULL), SetFill(false, true),
 
		NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, DEPOT_WIDGET_STOP_ALL), SetDataTip(SPR_FLAG_VEH_STOPPED, STR_NULL), SetFill(false, true),
 
		NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, DEPOT_WIDGET_START_ALL), SetDataTip(SPR_FLAG_VEH_RUNNING, STR_NULL), SetFill(false, true),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, DEPOT_WIDGET_RESIZE), SetFill(false, true),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _train_depot_desc(
 
	WDP_AUTO, WDP_AUTO, 36, 27, 362, 123,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets)
 
	_nested_train_depot_widgets, lengthof(_nested_train_depot_widgets)
 
);
 

	
 
static const WindowDesc _road_depot_desc(
 
	WDP_AUTO, WDP_AUTO, 36, 27, 316, 97,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets)
 
	_nested_train_depot_widgets, lengthof(_nested_train_depot_widgets)
 
);
 

	
 
static const WindowDesc _ship_depot_desc(
 
	WDP_AUTO, WDP_AUTO, 36, 27, 306, 99,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets)
 
	_nested_train_depot_widgets, lengthof(_nested_train_depot_widgets)
 
);
 

	
 
static const WindowDesc _aircraft_depot_desc(
 
	WDP_AUTO, WDP_AUTO, 36, 27, 332, 99,
 
	WC_VEHICLE_DEPOT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_train_depot_widgets, lengthof(_nested_train_depot_widgets)
 
	_nested_train_depot_widgets, lengthof(_nested_train_depot_widgets)
 
);
 

	
 
extern void DepotSortList(VehicleList *list);
 

	
 
/**
 
 * This is the Callback method after the cloning attempt of a vehicle
 
 * @param success indicates completion (or not) of the operation
 
 * @param tile unused
 
 * @param p1 unused
 
 * @param p2 unused
 
 */
 
void CcCloneVehicle(bool success, TileIndex tile, uint32 p1, uint32 p2)
src/dock_gui.cpp
Show inline comments
 
@@ -279,25 +279,25 @@ static const NWidgetPart _nested_build_d
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, DTW_DEMOLISH), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, DTW_DEPOT), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_IMG_SHIP_DEPOT, STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, DTW_STATION), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_IMG_SHIP_DOCK, STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, DTW_BUOY), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_IMG_BOUY, STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, DTW_BUILD_AQUEDUCT), SetMinimalSize(23, 22), SetFill(false, true), SetDataTip(SPR_IMG_AQUEDUCT, STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _build_docks_toolbar_desc(
 
	WDP_ALIGN_TBR, 22, 160, 36, 160, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	NULL, _nested_build_docks_toolbar_widgets, lengthof(_nested_build_docks_toolbar_widgets)
 
	_nested_build_docks_toolbar_widgets, lengthof(_nested_build_docks_toolbar_widgets)
 
);
 

	
 
void ShowBuildDocksToolbar()
 
{
 
	if (!Company::IsValidID(_local_company)) return;
 

	
 
	DeleteWindowByClass(WC_BUILD_TOOLBAR);
 
	AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_toolbar_desc, TRANSPORT_WATER);
 
}
 

	
 
/**
 
 * Nested widget parts of docks toolbar, scenario editor version.
 
@@ -315,25 +315,25 @@ static const NWidgetPart _nested_build_d
 
		NWidget(WWT_PANEL, COLOUR_DARK_GREEN, DTW_SEPERATOR), SetMinimalSize(5, 22), SetFill(false, true), EndContainer(),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, DTW_DEMOLISH), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, DTW_RIVER), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_IMG_BUILD_RIVER, STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, DTW_BUILD_AQUEDUCT), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_IMG_AQUEDUCT, STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP),
 
	EndContainer(),
 
};
 

	
 
/** Window definition for the build docks in scenario editor window. */
 
static const WindowDesc _build_docks_scen_toolbar_desc(
 
	WDP_AUTO, WDP_AUTO, 115, 36, 115, 36,
 
	WC_SCEN_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	NULL, _nested_build_docks_scen_toolbar_widgets, lengthof(_nested_build_docks_scen_toolbar_widgets)
 
	_nested_build_docks_scen_toolbar_widgets, lengthof(_nested_build_docks_scen_toolbar_widgets)
 
);
 

	
 
void ShowBuildDocksScenToolbar()
 
{
 
	AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_scen_toolbar_desc, TRANSPORT_WATER);
 
}
 

	
 
/** Widget numbers of the build-dock GUI. */
 
enum BuildDockStationWidgets {
 
	BDSW_CLOSE,      ///< Closebox.
 
	BDSW_CAPTION,    ///< Titlebar.
 
	BDSW_BACKGROUND, ///< Background panel.
 
@@ -412,25 +412,25 @@ static const NWidgetPart _nested_build_d
 
		NWidget(NWID_HORIZONTAL), SetPIP(14, 0, 14),
 
			NWidget(WWT_TEXTBTN, COLOUR_GREY, BDSW_LT_OFF), SetMinimalSize(40, 12), SetFill(true, false), SetDataTip(STR_STATION_BUILD_COVERAGE_OFF, STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP),
 
			NWidget(WWT_TEXTBTN, COLOUR_GREY, BDSW_LT_ON), SetMinimalSize(40, 12), SetFill(true, false), SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 20), SetResize(0, 1),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_dock_station_widgets, lengthof(_nested_build_dock_station_widgets)
 
	_nested_build_dock_station_widgets, lengthof(_nested_build_dock_station_widgets)
 
);
 

	
 
static void ShowBuildDockStationPicker(Window *parent)
 
{
 
	new BuildDocksStationWindow(&_build_dock_station_desc, parent);
 
}
 

	
 
/** Widgets for the build ship depot window. */
 
enum BuildDockDepotWidgets {
 
	BDDW_CLOSE,
 
	BDDW_CAPTION,
 
	BDDW_BACKGROUND,
 
@@ -498,25 +498,25 @@ static const NWidgetPart _nested_build_d
 
			NWidget(WWT_PANEL, COLOUR_GREY, BDDW_Y), SetMinimalSize(98, 66), SetDataTip(0x0, STR_DEPOT_BUILD_SHIP_ORIENTATION_TOOLTIP),
 
			EndContainer(),
 
			NWidget(NWID_SPACER), SetMinimalSize(3, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 3),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_docks_depot_widgets, lengthof(_nested_build_docks_depot_widgets)
 
	_nested_build_docks_depot_widgets, lengthof(_nested_build_docks_depot_widgets)
 
);
 

	
 

	
 
static void ShowBuildDocksDepotPicker(Window *parent)
 
{
 
	new BuildDocksDepotWindow(&_build_docks_depot_desc, parent);
 
}
 

	
 

	
 
void InitializeDockGui()
 
{
 
	_ship_depot_direction = AXIS_X;
src/engine_gui.cpp
Show inline comments
 
@@ -118,25 +118,25 @@ struct EnginePreviewWindow : Window {
 
				/* Fallthrough */
 
			case EPW_NO:
 
				delete this;
 
				break;
 
		}
 
	}
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_engine_preview_widgets, lengthof(_nested_engine_preview_widgets)
 
	_nested_engine_preview_widgets, lengthof(_nested_engine_preview_widgets)
 
);
 

	
 

	
 
void ShowEnginePreviewWindow(EngineID engine)
 
{
 
	AllocateWindowDescFront<EnginePreviewWindow>(&_engine_preview_desc, engine);
 
}
 

	
 
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
 
{
 
	uint total = 0;
 

	
src/genworld_gui.cpp
Show inline comments
 
@@ -756,32 +756,32 @@ struct GenerateLandscapeWindow : public 
 
					break;
 
			}
 

	
 
			this->SetDirty();
 
		}
 
	}
 
};
 

	
 
static const WindowDesc _generate_landscape_desc(
 
	WDP_CENTER, WDP_CENTER, 338, 313, 338, 313,
 
	WC_GENERATE_LANDSCAPE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	NULL, _nested_generate_landscape_widgets, lengthof(_nested_generate_landscape_widgets)
 
	_nested_generate_landscape_widgets, lengthof(_nested_generate_landscape_widgets)
 
);
 

	
 
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,
 
	NULL, _nested_heightmap_load_widgets, lengthof(_nested_heightmap_load_widgets)
 
	_nested_heightmap_load_widgets, lengthof(_nested_heightmap_load_widgets)
 
);
 

	
 
static void _ShowGenerateLandscape(glwp_modes mode)
 
{
 
	uint x = 0;
 
	uint y = 0;
 

	
 
	DeleteWindowByClass(WC_GENERATE_LANDSCAPE);
 

	
 
	/* Always give a new seed if not editor */
 
	if (_game_mode != GM_EDITOR) _settings_newgame.game_creation.generation_seed = InteractiveRandom();
 

	
 
@@ -1065,25 +1065,25 @@ static const NWidgetPart _nested_create_
 
					NWidget(WWT_TEXTBTN, COLOUR_ORANGE, CSCEN_FLAT_LAND_HEIGHT_TEXT), SetDataTip(STR_BLACK_INT, STR_NULL),
 
					NWidget(WWT_IMGBTN, COLOUR_ORANGE, CSCEN_FLAT_LAND_HEIGHT_UP), SetFill(false, true), SetDataTip(SPR_ARROW_UP, STR_SE_MAPGEN_FLAT_WORLD_HEIGHT_UP),
 
				EndContainer(),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_create_scenario_widgets, lengthof(_nested_create_scenario_widgets)
 
	_nested_create_scenario_widgets, lengthof(_nested_create_scenario_widgets)
 
);
 

	
 
void ShowCreateScenario()
 
{
 
	DeleteWindowByClass(WC_GENERATE_LANDSCAPE);
 
	new CreateScenarioWindow(&_create_scenario_desc, GLWP_SCENARIO);
 
}
 

	
 
enum GenerationProgressWindowWidgets {
 
	GPWW_CAPTION,
 
	GPWW_BACKGROUND,
 
	GPWW_PROGRESS_BAR,
 
@@ -1100,25 +1100,25 @@ static const NWidgetPart _nested_generat
 
				NWidget(WWT_EMPTY, INVALID_COLOUR, GPWW_PROGRESS_TEXT), SetFill(true, false),
 
				NWidget(WWT_TEXTBTN, COLOUR_WHITE, GPWW_ABORT), SetDataTip(STR_GENERATION_ABORT, STR_NULL), SetFill(true, false),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 

	
 
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,
 
	NULL, _nested_generate_progress_widgets, lengthof(_nested_generate_progress_widgets)
 
	_nested_generate_progress_widgets, lengthof(_nested_generate_progress_widgets)
 
);
 

	
 
struct tp_info {
 
	uint percent;
 
	StringID cls;
 
	uint current;
 
	uint total;
 
	int timer;
 
};
 

	
 
static tp_info _tp;
 

	
src/graph_gui.cpp
Show inline comments
 
@@ -134,25 +134,25 @@ static const NWidgetPart _nested_graph_l
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(NWID_SPACER), SetMinimalSize(2, 0),
 
			NWidgetFunction(MakeNWidgetCompanyLines),
 
			NWidget(NWID_SPACER), SetMinimalSize(2, 0),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _graph_legend_desc(
 
	WDP_AUTO, WDP_AUTO, 250, 196, 250, 196,
 
	WC_GRAPH_LEGEND, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	NULL, _nested_graph_legend_widgets, lengthof(_nested_graph_legend_widgets)
 
	_nested_graph_legend_widgets, lengthof(_nested_graph_legend_widgets)
 
);
 

	
 
static void ShowGraphLegend()
 
{
 
	AllocateWindowDescFront<GraphLegendWindow>(&_graph_legend_desc, 0);
 
}
 

	
 
/******************/
 
/* BASE OF GRAPHS */
 
/*****************/
 

	
 
/** Widget numbers of a base graph window. */
 
@@ -520,25 +520,25 @@ static const NWidgetPart _nested_operati
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, BGW_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, BGW_CAPTION), SetDataTip(STR_GRAPH_OPERATING_PROFIT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BGW_KEY_BUTTON), SetMinimalSize(50, 14), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, BGW_BACKGROUND), SetMinimalSize(576, 160), EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_operating_profit_widgets, lengthof(_nested_operating_profit_widgets)
 
	_nested_operating_profit_widgets, lengthof(_nested_operating_profit_widgets)
 
);
 

	
 

	
 
void ShowOperatingProfitGraph()
 
{
 
	AllocateWindowDescFront<OperatingProfitGraphWindow>(&_operating_profit_desc, 0);
 
}
 

	
 

	
 
/****************/
 
/* INCOME GRAPH */
 
/****************/
 
@@ -561,25 +561,25 @@ static const NWidgetPart _nested_income_
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, BGW_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, BGW_CAPTION), SetDataTip(STR_GRAPH_INCOME_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BGW_KEY_BUTTON), SetMinimalSize(50, 14), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, BGW_BACKGROUND), SetMinimalSize(576, 128), EndContainer(),
 
};
 

	
 

	
 
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,
 
	NULL, _nested_income_graph_widgets, lengthof(_nested_income_graph_widgets)
 
	_nested_income_graph_widgets, lengthof(_nested_income_graph_widgets)
 
);
 

	
 
void ShowIncomeGraph()
 
{
 
	AllocateWindowDescFront<IncomeGraphWindow>(&_income_graph_desc, 0);
 
}
 

	
 
/*******************/
 
/* DELIVERED CARGO */
 
/*******************/
 

	
 
struct DeliveredCargoGraphWindow : BaseGraphWindow {
 
@@ -599,25 +599,25 @@ static const NWidgetPart _nested_deliver
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, BGW_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, BGW_CAPTION), SetDataTip(STR_GRAPH_CARGO_DELIVERED_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BGW_KEY_BUTTON), SetMinimalSize(50, 14), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, BGW_BACKGROUND), SetMinimalSize(576, 128), EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_delivered_cargo_graph_widgets, lengthof(_nested_delivered_cargo_graph_widgets)
 
	_nested_delivered_cargo_graph_widgets, lengthof(_nested_delivered_cargo_graph_widgets)
 
);
 

	
 
void ShowDeliveredCargoGraph()
 
{
 
	AllocateWindowDescFront<DeliveredCargoGraphWindow>(&_delivered_cargo_graph_desc, 0);
 
}
 

	
 
/***********************/
 
/* PERFORMANCE HISTORY */
 
/***********************/
 

	
 
/** Widget numbers of the performance history window. */
 
@@ -653,25 +653,25 @@ static const NWidgetPart _nested_perform
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, PHW_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, PHW_CAPTION), SetDataTip(STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, PHW_DETAILED_PERFORMANCE), SetMinimalSize(50, 14), SetDataTip(STR_PERFORMANCE_DETAIL_KEY, STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, PHW_KEY), SetMinimalSize(50, 14), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, PHW_BACKGROUND), SetMinimalSize(576, 224), EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_performance_history_widgets, lengthof(_nested_performance_history_widgets)
 
	_nested_performance_history_widgets, lengthof(_nested_performance_history_widgets)
 
);
 

	
 
void ShowPerformanceHistoryGraph()
 
{
 
	AllocateWindowDescFront<PerformanceHistoryGraphWindow>(&_performance_history_desc, 0);
 
}
 

	
 
/*****************/
 
/* COMPANY VALUE */
 
/*****************/
 

	
 
struct CompanyValueGraphWindow : BaseGraphWindow {
 
@@ -691,25 +691,25 @@ static const NWidgetPart _nested_company
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, BGW_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, BGW_CAPTION), SetDataTip(STR_GRAPH_COMPANY_VALUES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BGW_KEY_BUTTON), SetMinimalSize(50, 14), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, BGW_BACKGROUND), SetMinimalSize(576, 224), EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_company_value_graph_widgets, lengthof(_nested_company_value_graph_widgets)
 
	_nested_company_value_graph_widgets, lengthof(_nested_company_value_graph_widgets)
 
);
 

	
 
void ShowCompanyValueGraph()
 
{
 
	AllocateWindowDescFront<CompanyValueGraphWindow>(&_company_value_graph_desc, 0);
 
}
 

	
 
/*****************/
 
/* PAYMENT RATES */
 
/*****************/
 

	
 
/** Widget numbers of the cargo payment rates. */
 
@@ -853,25 +853,25 @@ static const NWidgetPart _nested_cargo_p
 
					NWidgetFunction(MakeCargoButtons),
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 24), SetFill(true, true),
 
			EndContainer(),
 
			NWidget(NWID_SPACER), SetMinimalSize(5, 0), SetFill(false, true),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_cargo_payment_rates_widgets, lengthof(_nested_cargo_payment_rates_widgets)
 
	_nested_cargo_payment_rates_widgets, lengthof(_nested_cargo_payment_rates_widgets)
 
);
 

	
 

	
 
void ShowCargoPaymentRates()
 
{
 
	AllocateWindowDescFront<PaymentRatesGraphWindow>(&_cargo_payment_rates_desc, 0);
 
}
 

	
 
/************************/
 
/* COMPANY LEAGUE TABLE */
 
/************************/
 

	
 
@@ -983,25 +983,25 @@ static const NWidgetPart _nested_company
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, CLW_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, CLW_CAPTION), SetDataTip(STR_COMPANY_LEAGUE_TABLE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY, CLW_STICKYBOX),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, CLW_BACKGROUND), SetMinimalSize(400, 153),
 
};
 

	
 
static const WindowDesc _company_league_desc(
 
	WDP_AUTO, WDP_AUTO, 400, 167, 400, 167,
 
	WC_COMPANY_LEAGUE, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	NULL, _nested_company_league_widgets, lengthof(_nested_company_league_widgets)
 
	_nested_company_league_widgets, lengthof(_nested_company_league_widgets)
 
);
 

	
 
void ShowCompanyLeagueTable()
 
{
 
	AllocateWindowDescFront<CompanyLeagueWindow>(&_company_league_desc, 0);
 
}
 

	
 
/*****************************/
 
/* PERFORMANCE RATING DETAIL */
 
/*****************************/
 

	
 
/** Widget numbers of the performance rating details window. */
 
@@ -1266,19 +1266,19 @@ static const NWidgetPart _nested_perform
 
		NWidget(WWT_CAPTION, COLOUR_GREY, PRW_CAPTION), SetDataTip(STR_PERFORMANCE_DETAIL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, PRW_BACKGROUND),
 
		NWidgetFunction(MakeCompanyButtonRows), SetPadding(0, 1, 1, 2),
 
	EndContainer(),
 
	NWidgetFunction(MakePerformanceDetailPanels),
 
};
 

	
 
static const WindowDesc _performance_rating_detail_desc(
 
	WDP_AUTO, WDP_AUTO, 299, 241, 299, 241,
 
	WC_PERFORMANCE_DETAIL, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	NULL, _nested_performance_rating_detail_widgets, lengthof(_nested_performance_rating_detail_widgets)
 
	_nested_performance_rating_detail_widgets, lengthof(_nested_performance_rating_detail_widgets)
 
);
 

	
 
void ShowPerformanceRatingDetail()
 
{
 
	AllocateWindowDescFront<PerformanceRatingDetailWindow>(&_performance_rating_detail_desc, 0);
 
}
src/group_gui.cpp
Show inline comments
 
@@ -677,32 +677,32 @@ public:
 
	 */
 
	void UnselectVehicle(VehicleID vehicle)
 
	{
 
		if (this->vehicle_sel == vehicle) ResetObjectToPlace();
 
	}
 
};
 

	
 

	
 
static WindowDesc _other_group_desc(
 
	WDP_AUTO, WDP_AUTO, 460, 194, 460, 246,
 
	WC_INVALID, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_group_widgets, lengthof(_nested_group_widgets)
 
	_nested_group_widgets, lengthof(_nested_group_widgets)
 
);
 

	
 
const static WindowDesc _train_group_desc(
 
	WDP_AUTO, WDP_AUTO, 525, 194, 525, 246,
 
	WC_TRAINS_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_group_widgets, lengthof(_nested_group_widgets)
 
	_nested_group_widgets, lengthof(_nested_group_widgets)
 
);
 

	
 
void ShowCompanyGroup(CompanyID company, VehicleType vehicle_type)
 
{
 
	if (!Company::IsValidID(company)) return;
 

	
 
	WindowNumber num = (vehicle_type << 11) | VLW_GROUP_LIST | company;
 
	if (vehicle_type == VEH_TRAIN) {
 
		AllocateWindowDescFront<VehicleGroupWindow>(&_train_group_desc, num);
 
	} else {
 
		_other_group_desc.cls = GetWindowClassForVehicleType(vehicle_type);
 
		AllocateWindowDescFront<VehicleGroupWindow>(&_other_group_desc, num);
src/highscore_gui.cpp
Show inline comments
 
@@ -173,32 +173,32 @@ struct HighScoreWindow : EndGameHighScor
 
		}
 
	}
 
};
 

	
 
static const NWidgetPart _nested_highscore_widgets[] = {
 
	NWidget(WWT_PANEL, COLOUR_END, HSW_BACKGROUND), SetMinimalSize(641, 481), SetResize(1, 1), EndContainer(),
 
};
 

	
 
static const WindowDesc _highscore_desc(
 
	0, 0, 641, 481, 641, 481,
 
	WC_HIGHSCORE, WC_NONE,
 
	0,
 
	NULL, _nested_highscore_widgets, lengthof(_nested_highscore_widgets)
 
	_nested_highscore_widgets, lengthof(_nested_highscore_widgets)
 
);
 

	
 
static const WindowDesc _endgame_desc(
 
	0, 0, 641, 481, 641, 481,
 
	WC_ENDSCREEN, WC_NONE,
 
	0,
 
	NULL, _nested_highscore_widgets, lengthof(_nested_highscore_widgets)
 
	_nested_highscore_widgets, lengthof(_nested_highscore_widgets)
 
);
 

	
 
/** 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)
 
{
 
	DeleteWindowByClass(WC_HIGHSCORE);
 
	new HighScoreWindow(&_highscore_desc, difficulty, ranking);
 
}
 

	
 
/** Show the endgame victory screen in 2050. Update the new highscore
src/industry_gui.cpp
Show inline comments
 
@@ -119,25 +119,25 @@ static const NWidgetPart _nested_build_i
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_TEXTBTN, COLOUR_DARK_GREEN, DPIW_FUND_WIDGET), SetResize(1, 0), SetDataTip(STR_JUST_STRING, STR_NULL),
 
		NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN, DPIW_RESIZE_WIDGET),
 
	EndContainer(),
 
};
 

	
 
/** 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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_industry_widgets, lengthof(_nested_build_industry_widgets)
 
	_nested_build_industry_widgets, lengthof(_nested_build_industry_widgets)
 
);
 

	
 
/** Build (fund or prospect) a new industry, */
 
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
 
	bool timer_enabled;                         ///< timer can be used
 
	uint16 count;                               ///< How many industries are loaded
 
	IndustryType index[NUM_INDUSTRYTYPES + 1];  ///< Type of industry, in the order it was loaded
 
	bool enabled[NUM_INDUSTRYTYPES + 1];        ///< availability state, coming from CBID_INDUSTRY_AVAILABLE (if ever)
 

	
 
@@ -814,25 +814,25 @@ static const NWidgetPart _nested_industr
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_CREAM, IVW_GOTO), SetMinimalSize(130, 12), SetDataTip(STR_BUTTON_LOCATION, STR_INDUSTRY_VIEW_LOCATION_TOOLTIP),
 
		NWidget(WWT_PANEL, COLOUR_CREAM, IVW_SPACER), /*SetMinimalSize(118, 12),*/ SetResize(1, 0), EndContainer(),
 
		NWidget(WWT_RESIZEBOX, COLOUR_CREAM, IVW_RESIZE),
 
	EndContainer(),
 
};
 

	
 
/** 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,
 
	NULL, _nested_industry_view_widgets, lengthof(_nested_industry_view_widgets)
 
	_nested_industry_view_widgets, lengthof(_nested_industry_view_widgets)
 
);
 

	
 
void ShowIndustryViewWindow(int industry)
 
{
 
	AllocateWindowDescFront<IndustryViewWindow>(&_industry_view_desc, industry);
 
}
 

	
 
/** Names of the widgets of the industry directory gui */
 
enum IndustryDirectoryWidgets {
 
	IDW_CLOSEBOX = 0,
 
	IDW_CAPTION,
 
	IDW_STICKY,
 
@@ -1191,19 +1191,19 @@ const StringID IndustryDirectoryWindow::
 
	STR_SORT_BY_TYPE,
 
	STR_SORT_BY_PRODUCTION,
 
	STR_SORT_BY_TRANSPORTED,
 
	INVALID_STRING_ID
 
};
 

	
 

	
 
/** Window definition of the industy directory gui */
 
static const WindowDesc _industry_directory_desc(
 
	WDP_AUTO, WDP_AUTO, 428, 190, 428, 190,
 
	WC_INDUSTRY_DIRECTORY, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_industry_directory_widgets, lengthof(_nested_industry_directory_widgets)
 
	_nested_industry_directory_widgets, lengthof(_nested_industry_directory_widgets)
 
);
 

	
 
void ShowIndustryDirectory()
 
{
 
	AllocateWindowDescFront<IndustryDirectoryWindow>(&_industry_directory_desc, 0);
 
}
src/intro_gui.cpp
Show inline comments
 
@@ -245,25 +245,24 @@ static const NWidgetPart _nested_select_
 
			NWidget(NWID_SPACER), SetMinimalSize(104, 0),
 
		EndContainer(),
 

	
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 8),
 

	
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _select_game_desc(
 
	WDP_CENTER, WDP_CENTER, 336, 213, 336, 213,
 
	WC_SELECT_GAME, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	NULL,
 
	_nested_select_game_widgets, lengthof(_nested_select_game_widgets)
 
);
 

	
 
void ShowSelectGameWindow()
 
{
 
	new SelectGameWindow(&_select_game_desc);
 
}
 

	
 
static void AskExitGameCallback(Window *w, bool confirmed)
 
{
 
	if (confirmed) _exit_game = true;
 
}
src/main_gui.cpp
Show inline comments
 
@@ -194,25 +194,25 @@ extern void UpdateAllStationVirtCoords()
 
enum MainWindowWidgets {
 
	MW_VIEWPORT, ///< Main window viewport.
 
};
 

	
 
static const struct NWidgetPart _nested_main_window_widgets[] = {
 
	NWidget(NWID_VIEWPORT, INVALID_COLOUR, MW_VIEWPORT), SetResize(1, 1),
 
};
 

	
 
static const WindowDesc _main_window_desc(
 
	0, 0, 0, 0, 0, 0,
 
	WC_MAIN_WINDOW, WC_NONE,
 
	0,
 
	NULL, _nested_main_window_widgets, lengthof(_nested_main_window_widgets)
 
	_nested_main_window_widgets, lengthof(_nested_main_window_widgets)
 
);
 

	
 
struct MainWindow : Window
 
{
 
	MainWindow() : Window()
 
	{
 
		this->InitNested(&_main_window_desc, 0);
 
		ResizeWindow(this, _screen.width, _screen.height);
 

	
 
		NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(MW_VIEWPORT);
 
		nvp->InitializeViewport(this, TileXY(32, 32), ZOOM_LVL_VIEWPORT);
 
	}
src/misc_gui.cpp
Show inline comments
 
@@ -66,25 +66,25 @@ enum LandInfoWidgets {
 
static const NWidgetPart _nested_land_info_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, LIW_CLOSE),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, LIW_CAPTION), SetDataTip(STR_LAND_AREA_INFORMATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, LIW_BACKGROUND), EndContainer(),
 
};
 

	
 
static const WindowDesc _land_info_desc(
 
	WDP_AUTO, WDP_AUTO, 0, 0, 0, 0,
 
	WC_LAND_INFO, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	NULL, _nested_land_info_widgets, lengthof(_nested_land_info_widgets)
 
	_nested_land_info_widgets, lengthof(_nested_land_info_widgets)
 
);
 

	
 
class LandInfoWindow : public Window {
 
	enum {
 
		LAND_INFO_CENTERED_LINES   = 12,                       ///< Up to 12 centered lines
 
		LAND_INFO_MULTICENTER_LINE = LAND_INFO_CENTERED_LINES, ///< One multicenter line
 
		LAND_INFO_LINE_END,
 

	
 
		LAND_INFO_LINE_BUFF_SIZE = 512,
 
	};
 

	
 
public:
 
@@ -340,25 +340,25 @@ static const NWidgetPart _nested_about_w
 
		NWidget(WWT_TEXT, COLOUR_GREY, AW_ABOUT_ORIG_COPYRIGHT), SetDataTip(STR_ABOUT_ORIGINAL_COPYRIGHT, STR_NULL),
 
		NWidget(WWT_TEXT, COLOUR_GREY, AW_ABOUT_VERSION), SetDataTip(STR_ABOUT_VERSION, STR_NULL),
 
		NWidget(WWT_FRAME, COLOUR_GREY, AW_FRAME), SetPadding(0, 5, 1, 5), EndContainer(),
 
		NWidget(WWT_TEXT, COLOUR_GREY, AW_WEBSITE), SetDataTip(STR_BLACK_RAW_STRING, STR_NULL),
 
		NWidget(WWT_TEXT, COLOUR_GREY, AW_ABOUT_COPYRIGHT), SetDataTip(STR_ABOUT_COPYRIGHT_OPENTTD, STR_NULL),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _about_desc(
 
	WDP_CENTER, WDP_CENTER, 0, 0, 0, 0,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	NULL, _nested_about_widgets, lengthof(_nested_about_widgets)
 
	_nested_about_widgets, lengthof(_nested_about_widgets)
 
);
 

	
 
static const char * const _credits[] = {
 
	"Original design by Chris Sawyer",
 
	"Original graphics by Simon Foster",
 
	"",
 
	"The OpenTTD team (in alphabetical order):",
 
	"  Jean-Francois Claeys (Belugas) - GUI, newindustries and more",
 
	"  Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles",
 
	"  Matthijs Kooijman (blathijs) - Pathfinder-guru, pool rework",
 
	"  Victor Fischer (Celestar) - Programming everywhere you need him to",
 
	"  Christoph Elsenhans (frosch) - General coding",
 
@@ -500,45 +500,45 @@ static const NWidgetPart _nested_errmsg_
 
		NWidget(WWT_CLOSEBOX, COLOUR_RED, EMW_CLOSE),
 
		NWidget(WWT_CAPTION, COLOUR_RED, EMW_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION, STR_NULL),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_RED, EMW_PANEL),
 
		NWidget(WWT_EMPTY, COLOUR_RED, EMW_MESSAGE), SetPadding(0, 2, 0, 2), SetMinimalSize(236, 32),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _errmsg_desc(
 
	0, 0, 240, 46, 240, 46, // x/y position is not used.
 
	WC_ERRMSG, WC_NONE,
 
	WDF_STD_BTN | WDF_DEF_WIDGET,
 
	NULL, _nested_errmsg_widgets, lengthof(_nested_errmsg_widgets)
 
	_nested_errmsg_widgets, lengthof(_nested_errmsg_widgets)
 
);
 

	
 
static const NWidgetPart _nested_errmsg_face_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_RED, EMW_CLOSE),
 
		NWidget(WWT_CAPTION, COLOUR_RED, EMW_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION_OTHER_COMPANY, STR_NULL),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_RED, EMW_PANEL),
 
		NWidget(NWID_HORIZONTAL), SetPIP(2, 1, 2),
 
			NWidget(WWT_EMPTY, COLOUR_RED, EMW_FACE), SetMinimalSize(91, 120), SetFill(false, true), SetPadding(2, 0, 1, 0),
 
			NWidget(WWT_EMPTY, COLOUR_RED, EMW_MESSAGE), SetFill(false, true), SetMinimalSize(238, 123),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _errmsg_face_desc(
 
	0, 0, 334, 137, 334, 137, // x/y position is not used.
 
	WC_ERRMSG, WC_NONE,
 
	WDF_STD_BTN | WDF_DEF_WIDGET,
 
	NULL, _nested_errmsg_face_widgets, lengthof(_nested_errmsg_face_widgets)
 
	_nested_errmsg_face_widgets, lengthof(_nested_errmsg_face_widgets)
 
);
 

	
 
/** Window class for displaying an error message window. */
 
struct ErrmsgWindow : public Window {
 
private:
 
	uint duration;                  ///< Length of display of the message. 0 means forever,
 
	uint64 decode_params[20];       ///< Parameters of the message strings.
 
	StringID summary_msg;           ///< General error message showed in first line. Must be valid.
 
	StringID detailed_msg;          ///< Detailed error message showed in second line. Can be #INVALID_STRING_ID.
 
	uint height_summary;            ///< Height of the #summary_msg string in pixels in the #EMW_MESSAGE widget.
 
	uint height_detailed;           ///< Height of the #detailed_msg string in pixels in the #EMW_MESSAGE widget.
 
	Point position;                 ///< Position of the error message window.
 
@@ -767,25 +767,25 @@ void HideFillingPercent(TextEffectID *te
 
	RemoveTextEffect(*te_id);
 
	*te_id = INVALID_TE_ID;
 
}
 

	
 
static const NWidgetPart _nested_tooltips_widgets[] = {
 
	NWidget(WWT_PANEL, COLOUR_GREY, 0), SetMinimalSize(200, 32), EndContainer(),
 
};
 

	
 
static const WindowDesc _tool_tips_desc(
 
	100, 100, 0, 0, 0, 0, // Coordinates and sizes are not used,
 
	WC_TOOLTIPS, WC_NONE,
 
	0,
 
	NULL, _nested_tooltips_widgets, lengthof(_nested_tooltips_widgets)
 
	_nested_tooltips_widgets, lengthof(_nested_tooltips_widgets)
 
);
 

	
 
/** Window for displaying a tooltip. */
 
struct TooltipsWindow : public Window
 
{
 
	StringID string_id;         ///< String to display as tooltip.
 
	byte paramcount;            ///< Number of string parameters in #string_id.
 
	uint64 params[5];           ///< The string parameters.
 
	bool use_left_mouse_button; ///< Wait for left mouse button to close window (else, wait for right button).
 

	
 
	TooltipsWindow(StringID str, uint paramcount, const uint64 params[], bool use_left_mouse_button) : Window()
 
	{
 
@@ -1450,25 +1450,25 @@ static const NWidgetPart _nested_query_s
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, QUERY_STR_WIDGET_DEFAULT), SetMinimalSize(87, 12), SetFill(true, true), SetDataTip(STR_BUTTON_DEFAULT, STR_NULL),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, QUERY_STR_WIDGET_CANCEL), SetMinimalSize(86, 12), SetFill(true, true), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, QUERY_STR_WIDGET_OK), SetMinimalSize(87, 12), SetFill(true, true), SetDataTip(STR_BUTTON_OK, STR_NULL),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_query_string_widgets, lengthof(_nested_query_string_widgets)
 
	_nested_query_string_widgets, lengthof(_nested_query_string_widgets)
 
);
 

	
 
/** 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 maxsize maximum size in bytes (including terminating '\0')
 
 * @param maxwidth maximum width in pixels allowed
 
 * @param parent pointer to a Window that will handle the events (ok/cancel) of this
 
 *        window. If NULL, results are handled by global function HandleOnEditText
 
 * @param afilter filters out unwanted character input
 
 * @param flags various flags, @see QueryStringFlags
 
 */
 
@@ -1605,25 +1605,25 @@ static const NWidgetPart _nested_query_w
 
		NWidget(WWT_TEXT, COLOUR_RED, QUERY_WIDGET_TEXT), SetMinimalSize(200, 12),
 
		NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(20, 29, 20),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, QUERY_WIDGET_NO), SetMinimalSize(71, 12), SetDataTip(STR_QUIT_NO, STR_NULL),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, QUERY_WIDGET_YES), SetMinimalSize(71, 12), SetDataTip(STR_QUIT_YES, STR_NULL),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_query_widgets, lengthof(_nested_query_widgets)
 
	_nested_query_widgets, lengthof(_nested_query_widgets)
 
);
 

	
 
/** Show a modal confirmation window with standard 'yes' and 'no' buttons
 
 * The window is aligned to the centre of its parent.
 
 * @param caption string shown as window caption
 
 * @param message string that will be shown for the window
 
 * @param parent pointer to parent window, if this pointer is NULL the parent becomes
 
 * the main window WC_MAIN_WINDOW
 
 * @param callback callback function pointer to set in the window descriptor
 
 */
 
void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallbackProc *callback)
 
{
 
@@ -2053,32 +2053,32 @@ public:
 
	}
 

	
 
	virtual void OnInvalidateData(int data)
 
	{
 
		BuildFileList();
 
	}
 
};
 

	
 
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,
 
	NULL, _nested_load_dialog_widgets, lengthof(_nested_load_dialog_widgets)
 
	_nested_load_dialog_widgets, lengthof(_nested_load_dialog_widgets)
 
);
 

	
 
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,
 
	NULL, _nested_save_dialog_widgets, lengthof(_nested_save_dialog_widgets)
 
	_nested_save_dialog_widgets, lengthof(_nested_save_dialog_widgets)
 
);
 

	
 
/** 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
 
	FT_SCENARIO,  ///< used for SLD_LOAD_SCENARIO
 
	FT_SAVEGAME,  ///< used for SLD_SAVE_GAME
 
	FT_SCENARIO,  ///< used for SLD_SAVE_SCENARIO
 
	FT_HEIGHTMAP, ///< used for SLD_LOAD_HEIGHTMAP
 
	FT_SAVEGAME,  ///< SLD_NEW_GAME
 
};
src/music_gui.cpp
Show inline comments
 
@@ -404,25 +404,25 @@ static const NWidgetPart _nested_music_t
 
				NWidget(WWT_LABEL, COLOUR_GREY, MTSW_PLAYLIST), SetDataTip(STR_PLAYLIST_PROGRAM, STR_NULL),
 
				NWidget(WWT_PANEL, COLOUR_GREY, MTSW_LIST_RIGHT), SetMinimalSize(180, 194), SetDataTip(0x0, STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK), EndContainer(),
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 2),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_music_track_selection_widgets, lengthof(_nested_music_track_selection_widgets)
 
	_nested_music_track_selection_widgets, lengthof(_nested_music_track_selection_widgets)
 
);
 

	
 
static void ShowMusicTrackSelection()
 
{
 
	AllocateWindowDescFront<MusicTrackSelectionWindow>(&_music_track_selection_desc, 0);
 
}
 

	
 
enum MusicWidgets {
 
	MW_CLOSE,
 
	MW_CAPTION,
 
	MW_PREV,
 
	MW_NEXT,
 
@@ -666,19 +666,19 @@ static const NWidgetPart _nested_music_w
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_OLD), SetFill(true, false), SetDataTip(STR_MUSIC_PLAYLIST_OLD_STYLE, STR_MUSIC_TOOLTIP_SELECT_OLD_STYLE_MUSIC),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_NEW), SetFill(true, false), SetDataTip(STR_MUSIC_PLAYLIST_NEW_STYLE, STR_MUSIC_TOOLTIP_SELECT_NEW_STYLE_MUSIC),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_EZY), SetFill(true, false), SetDataTip(STR_MUSIC_PLAYLIST_EZY_STREET, STR_MUSIC_TOOLTIP_SELECT_EZY_STREET_STYLE),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_CUSTOM1), SetFill(true, false), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_1, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_1_USER_DEFINED),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, MW_CUSTOM2), SetFill(true, false), SetDataTip(STR_MUSIC_PLAYLIST_CUSTOM_2, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_2_USER_DEFINED),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_music_window_widgets, lengthof(_nested_music_window_widgets)
 
	_nested_music_window_widgets, lengthof(_nested_music_window_widgets)
 
);
 

	
 
void ShowMusicWindow()
 
{
 
	AllocateWindowDescFront<MusicWindow>(&_music_window_desc, 0);
 
}
src/network/network_chat_gui.cpp
Show inline comments
 
@@ -537,22 +537,22 @@ static const NWidgetPart _nested_chat_wi
 
				NWidget(WWT_EDITBOX, COLOUR_GREY, NWCW_TEXTBOX), SetMinimalSize(100, 12), SetPadding(1, 0, 1, 0), SetResize(1, 0),
 
																	SetDataTip(STR_NETWORK_CHAT_OSKTITLE, STR_NULL),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, NWCW_SENDBUTTON), SetMinimalSize(62, 12), SetPadding(1, 0, 1, 0), SetDataTip(STR_NETWORK_CHAT_SEND, STR_NULL),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _chat_window_desc(
 
	WDP_CENTER, 0, 320, 14, 640, 14, // x, y, width, height
 
	WC_SEND_NETWORK_MSG, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
 
	NULL, _nested_chat_window_widgets, lengthof(_nested_chat_window_widgets)
 
	_nested_chat_window_widgets, lengthof(_nested_chat_window_widgets)
 
);
 

	
 
void ShowNetworkChatQueryWindow(DestType type, int dest)
 
{
 
	DeleteWindowByClass(WC_SEND_NETWORK_MSG);
 
	new NetworkChatWindow(&_chat_window_desc, type, dest);
 
}
 

	
 
#endif /* ENABLE_NETWORK */
src/network/network_content_gui.cpp
Show inline comments
 
@@ -41,25 +41,25 @@ static const NWidgetPart _nested_network
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCDSWW_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
 
			NWidget(NWID_SPACER), SetFill(true, false),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 4),
 
	EndContainer(),
 
};
 

	
 
/** Window description for the download window */
 
static const WindowDesc _network_content_download_status_window_desc(
 
	WDP_CENTER, WDP_CENTER, 350, 85, 350, 85,
 
	WC_NETWORK_STATUS_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_MODAL,
 
	NULL, _nested_network_content_download_status_window_widgets, lengthof(_nested_network_content_download_status_window_widgets)
 
	_nested_network_content_download_status_window_widgets, lengthof(_nested_network_content_download_status_window_widgets)
 
);
 

	
 
/** Window for showing the download status of content */
 
struct NetworkContentDownloadStatusWindow : public Window, ContentCallback {
 
private:
 
	ClientNetworkContentSocketHandler *connection; ///< Our connection with the content server
 
	SmallVector<ContentType, 4> receivedTypes;     ///< Types we received so we can update their cache
 

	
 
	uint total_files;      ///< Number of files to download
 
	uint downloaded_files; ///< Number of files downloaded
 
	uint total_bytes;      ///< Number of bytes to download
 
	uint downloaded_bytes; ///< Number of bytes downloaded
 
@@ -865,25 +865,25 @@ static const NWidgetPart _nested_network
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(NWID_SPACER), SetFill(true, false), SetResize(1, 0),
 
			NWidget(WWT_RESIZEBOX, COLOUR_LIGHT_BLUE, NCLWW_RESIZE),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
/** Window description of the content list */
 
static const WindowDesc _network_content_list_desc(
 
	WDP_CENTER, WDP_CENTER, 450, 278, 630, 460,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	NULL, _nested_network_content_list_widgets, lengthof(_nested_network_content_list_widgets)
 
	_nested_network_content_list_widgets, lengthof(_nested_network_content_list_widgets)
 
);
 

	
 
/**
 
 * Show the content list window with a given set of content
 
 * @param cv the content to show, or NULL when it has to search for itself
 
 * @param type the type to (only) show
 
 */
 
void ShowNetworkContentListWindow(ContentVector *cv, ContentType type)
 
{
 
#if defined(WITH_ZLIB)
 
	_network_content_client.Clear();
 
	if (cv == NULL) {
src/network/network_gui.cpp
Show inline comments
 
@@ -1005,25 +1005,25 @@ static const NWidgetPart _nested_network
 
					NWidget(NWID_SPACER), SetFill(false, true),
 
					NWidget(WWT_RESIZEBOX, COLOUR_LIGHT_BLUE, NGWW_RESIZE),
 
				EndContainer(),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _network_game_window_desc(
 
	WDP_CENTER, WDP_CENTER, 450, 264, 1000, 730,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	NULL, _nested_network_game_widgets, lengthof(_nested_network_game_widgets)
 
	_nested_network_game_widgets, lengthof(_nested_network_game_widgets)
 
);
 

	
 
void ShowNetworkGameWindow()
 
{
 
	static bool first = true;
 
	DeleteWindowById(WC_NETWORK_WINDOW, 0);
 

	
 
	/* Only show once */
 
	if (first) {
 
		first = false;
 
		/* add all servers from the config file to our list */
 
		for (char **iter = _network_host_list.Begin(); iter != _network_host_list.End(); iter++) {
 
@@ -1422,25 +1422,25 @@ static const NWidgetPart _nested_network
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NSSW_START), SetFill(true, false), SetDataTip(STR_NETWORK_START_SERVER_START_GAME, STR_NETWORK_START_SERVER_START_GAME_TOOLTIP),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NSSW_LOAD), SetFill(true, false), SetDataTip(STR_NETWORK_START_SERVER_LOAD_GAME, STR_NETWORK_START_SERVER_LOAD_GAME_TOOLTIP),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NSSW_CANCEL), SetFill(true, false), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 10),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_network_start_server_window_widgets, lengthof(_nested_network_start_server_window_widgets)
 
	_nested_network_start_server_window_widgets, lengthof(_nested_network_start_server_window_widgets)
 
);
 

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

	
 
	new NetworkStartServerWindow(&_network_start_server_window_desc);
 
}
 

	
 
/** Enum for NetworkLobbyWindow, referring to _network_lobby_window_widgets */
 
enum NetworkLobbyWindowWidgets {
 
	NLWW_CLOSE,      ///< Close 'X' button
 
@@ -1713,25 +1713,25 @@ static const NWidgetPart _nested_network
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NLWW_CANCEL), SetResize(1, 0), SetFill(true, false), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
 
				NWidget(NWID_SPACER), SetFill(true, true),
 
			EndContainer(),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 8),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _network_lobby_window_desc(
 
	WDP_CENTER, WDP_CENTER, 0, 0, 0, 0,
 
	WC_NETWORK_WINDOW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	NULL, _nested_network_lobby_window_widgets, lengthof(_nested_network_lobby_window_widgets)
 
	_nested_network_lobby_window_widgets, lengthof(_nested_network_lobby_window_widgets)
 
);
 

	
 
/* Show the networklobbywindow with the selected server
 
 * @param ngl Selected game pointer which is passed to the new window */
 
static void ShowNetworkLobbyWindow(NetworkGameList *ngl)
 
{
 
	DeleteWindowById(WC_NETWORK_WINDOW, 0);
 

	
 
	NetworkTCPQueryServer(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port)); // company info
 
	NetworkUDPQueryServer(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port)); // general data
 

	
 
	new NetworkLobbyWindow(&_network_lobby_window_desc, ngl);
 
@@ -1756,25 +1756,25 @@ extern void DrawCompanyIcon(CompanyID ci
 

	
 
/* Every action must be of this form */
 
typedef void ClientList_Action_Proc(byte client_no);
 

	
 
static const NWidgetPart _nested_client_list_popup_widgets[] = {
 
	NWidget(WWT_PANEL, COLOUR_GREY, 0), EndContainer(),
 
};
 

	
 
static const WindowDesc _client_list_popup_desc(
 
	WDP_AUTO, WDP_AUTO, 150, 1, 150, 1,
 
	WC_TOOLBAR_MENU, WC_CLIENT_LIST,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
 
	NULL, _nested_client_list_popup_widgets, lengthof(_nested_client_list_popup_widgets)
 
	_nested_client_list_popup_widgets, lengthof(_nested_client_list_popup_widgets)
 
);
 

	
 
/* Finds the Xth client-info that is active */
 
static NetworkClientInfo *NetworkFindClientInfo(byte client_no)
 
{
 
	NetworkClientInfo *ci;
 

	
 
	FOR_ALL_CLIENT_INFOS(ci) {
 
		if (client_no == 0) return ci;
 
		client_no--;
 
	}
 

	
 
@@ -1972,25 +1972,25 @@ static const NWidgetPart _nested_client_
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, CLW_CLOSE),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, CLW_CAPTION), SetDataTip(STR_NETWORK_COMPANY_LIST_CLIENT_LIST, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY, CLW_STICKY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, CLW_PANEL), SetMinimalSize(250, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), SetResize(1, 1), EndContainer(),
 
};
 

	
 
static const WindowDesc _client_list_desc(
 
	WDP_AUTO, WDP_AUTO, 250, 16, 250, 16,
 
	WC_CLIENT_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_client_list_widgets, lengthof(_nested_client_list_widgets)
 
	_nested_client_list_widgets, lengthof(_nested_client_list_widgets)
 
);
 

	
 
/**
 
 * Main handle for clientlist
 
 */
 
struct NetworkClientListWindow : Window {
 
	int selected_item;
 

	
 
	uint server_client_width;
 
	uint company_icon_width;
 

	
 
	NetworkClientListWindow(const WindowDesc *desc, WindowNumber window_number) :
 
@@ -2211,25 +2211,25 @@ struct NetworkJoinStatusWindow : Window 
 

	
 
static const NWidgetPart _nested_network_join_status_window_widgets[] = {
 
	NWidget(WWT_CAPTION, COLOUR_GREY, NJSW_CAPTION), SetDataTip(STR_NETWORK_CONNECTING_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
	NWidget(WWT_PANEL, COLOUR_GREY, NJSW_BACKGROUND),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NJSW_CANCELOK), SetMinimalSize(101, 12), SetPadding(55, 74, 4, 75), SetDataTip(STR_NETWORK_CONNECTION_DISCONNECT, STR_NULL),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_network_join_status_window_widgets, lengthof(_nested_network_join_status_window_widgets)
 
	_nested_network_join_status_window_widgets, lengthof(_nested_network_join_status_window_widgets)
 
);
 

	
 
void ShowJoinStatusWindow()
 
{
 
	DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
	new NetworkJoinStatusWindow(&_network_join_status_window_desc);
 
}
 

	
 

	
 
/** Enum for NetworkGameWindow, referring to _network_game_window_widgets */
 
enum NetworkCompanyPasswordWindowWidgets {
 
	NCPWW_CLOSE,                    ///< Close 'X' button
 
@@ -2336,23 +2336,23 @@ static const NWidgetPart _nested_network
 
		EndContainer(),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, NCPWW_CANCEL), SetFill(true, false), SetDataTip(STR_BUTTON_CANCEL, STR_COMPANY_PASSWORD_CANCEL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, NCPWW_OK), SetFill(true, false), SetDataTip(STR_BUTTON_OK, STR_COMPANY_PASSWORD_OK),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _network_company_password_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,
 
	NULL, _nested_network_company_password_window_widgets, lengthof(_nested_network_company_password_window_widgets)
 
	_nested_network_company_password_window_widgets, lengthof(_nested_network_company_password_window_widgets)
 
);
 

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

	
 
	new NetworkCompanyPasswordWindow(&_network_company_password_window_desc, parent);
 
}
 

	
 
#endif /* ENABLE_NETWORK */
src/newgrf_gui.cpp
Show inline comments
 
@@ -482,25 +482,25 @@ static const NWidgetPart _nested_newgrf_
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ANGRFW_ADD), SetMinimalSize(147, 12), SetResize(1, 0), SetDataTip(STR_NEWGRF_ADD_FILE, STR_NEWGRF_ADD_FILE_TOOLTIP),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ANGRFW_RESCAN), SetMinimalSize(147, 12), SetResize(1, 0), SetDataTip(STR_NEWGRF_ADD_RESCAN_FILES, STR_NEWGRF_ADD_RESCAN_FILES_TOOLTIP),
 
		EndContainer(),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, ANGRFW_RESIZE), SetFill(false, true),
 
	EndContainer(),
 
};
 

	
 
/* Window definition for the add a newgrf window */
 
static const WindowDesc _newgrf_add_dlg_desc(
 
	WDP_CENTER, WDP_CENTER, 0, 0, 306, 347,
 
	WC_SAVELOAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	NULL, _nested_newgrf_add_dlg_widgets, lengthof(_nested_newgrf_add_dlg_widgets)
 
	_nested_newgrf_add_dlg_widgets, lengthof(_nested_newgrf_add_dlg_widgets)
 
);
 

	
 
static GRFPresetList _grf_preset_list;
 

	
 
class DropDownListPresetItem : public DropDownListItem {
 
public:
 
	DropDownListPresetItem(int result) : DropDownListItem(result, false) {}
 

	
 
	virtual ~DropDownListPresetItem() {}
 

	
 
	bool Selectable() const
 
	{
 
@@ -1036,25 +1036,25 @@ static const NWidgetPart _nested_newgrf_
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, SNGRFS_CONTENT_DOWNLOAD), SetFill(true, false), SetResize(1, 0), SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT),
 
		NWidget(WWT_RESIZEBOX, COLOUR_MAUVE, SNGRFS_RESIZE),
 
	EndContainer(),
 
};
 

	
 
/* Window definition of the manage newgrfs window */
 
static const WindowDesc _newgrf_desc(
 
	WDP_CENTER, WDP_CENTER, 300, 263, 300, 263,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 
	NULL, _nested_newgrf_widgets, lengthof(_nested_newgrf_widgets)
 
	_nested_newgrf_widgets, lengthof(_nested_newgrf_widgets)
 
);
 

	
 
/** 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
 
 */
 
static void NewGRFConfirmationCallback(Window *w, bool confirmed)
 
{
 
	if (confirmed) {
 
		NewGRFWindow *nw = dynamic_cast<NewGRFWindow*>(w);
 
		GRFConfig *c;
 
		int i = 0;
src/news_gui.cpp
Show inline comments
 
@@ -100,25 +100,25 @@ static const NWidgetPart _nested_normal_
 
				NWidget(WWT_LABEL, COLOUR_WHITE, NTW_DATE), SetDataTip(STR_DATE_LONG_SMALL, STR_NULL),
 
				NWidget(NWID_SPACER), SetFill(false, true),
 
			EndContainer(),
 
		EndContainer(),
 
		NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_MESSAGE), SetMinimalSize(428, 154), SetPadding(0, 1, 1, 1),
 
	EndContainer(),
 
};
 

	
 
static WindowDesc _normal_news_desc(
 
	WDP_CENTER, 476, 430, 170, 430, 170,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	NULL, _nested_normal_news_widgets, lengthof(_nested_normal_news_widgets)
 
	_nested_normal_news_widgets, lengthof(_nested_normal_news_widgets)
 
);
 

	
 
/* New vehicles news items. */
 
static const NWidgetPart _nested_vehicle_news_widgets[] = {
 
	NWidget(WWT_PANEL, COLOUR_WHITE, NTW_PANEL),
 
		NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_TEXT, COLOUR_WHITE, NTW_CLOSEBOX), SetDataTip(STR_SILVER_CROSS, STR_NULL), SetPadding(0, 0, 0, 1),
 
				NWidget(NWID_SPACER), SetFill(false, true),
 
			EndContainer(),
 
			NWidget(WWT_LABEL, COLOUR_WHITE, NTW_VEH_TITLE), SetFill(true, true), SetMinimalSize(419, 55), SetDataTip(STR_EMPTY, STR_NULL),
 
		EndContainer(),
 
@@ -127,25 +127,25 @@ static const NWidgetPart _nested_vehicle
 
				NWidget(WWT_EMPTY, INVALID_COLOUR, NTW_VEH_NAME), SetMinimalSize(369, 33), SetFill(true, false),
 
				NWidget(WWT_EMPTY, INVALID_COLOUR, NTW_VEH_SPR),  SetMinimalSize(369, 32), SetFill(true, false),
 
				NWidget(WWT_EMPTY, INVALID_COLOUR, NTW_VEH_INFO), SetMinimalSize(369, 46), SetFill(true, false),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static WindowDesc _vehicle_news_desc(
 
	WDP_CENTER, 476, 430, 170, 430, 170,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	NULL, _nested_vehicle_news_widgets, lengthof(_nested_vehicle_news_widgets)
 
	_nested_vehicle_news_widgets, lengthof(_nested_vehicle_news_widgets)
 
);
 

	
 
/* Company news items. */
 
static const NWidgetPart _nested_company_news_widgets[] = {
 
	NWidget(WWT_PANEL, COLOUR_WHITE, NTW_PANEL),
 
		NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_TEXT, COLOUR_WHITE, NTW_CLOSEBOX), SetDataTip(STR_SILVER_CROSS, STR_NULL), SetPadding(0, 0, 0, 1),
 
				NWidget(NWID_SPACER), SetFill(false, true),
 
			EndContainer(),
 
			NWidget(WWT_LABEL, COLOUR_WHITE, NTW_TITLE), SetFill(true, true), SetMinimalSize(410, 20), SetDataTip(STR_EMPTY, STR_NULL),
 
		EndContainer(),
 
@@ -158,72 +158,72 @@ static const NWidgetPart _nested_company
 
				EndContainer(),
 
				NWidget(NWID_SPACER), SetFill(false, true),
 
			EndContainer(),
 
			NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_COMPANY_MSG), SetFill(true, true), SetMinimalSize(328, 150),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static WindowDesc _company_news_desc(
 
	WDP_CENTER, 476, 430, 170, 430, 170,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	NULL, _nested_company_news_widgets, lengthof(_nested_company_news_widgets)
 
	_nested_company_news_widgets, lengthof(_nested_company_news_widgets)
 
);
 

	
 
/* Thin news items. */
 
static const NWidgetPart _nested_thin_news_widgets[] = {
 
	NWidget(WWT_PANEL, COLOUR_WHITE, NTW_PANEL),
 
		NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1),
 
			NWidget(WWT_TEXT, COLOUR_WHITE, NTW_CLOSEBOX), SetDataTip(STR_SILVER_CROSS, STR_NULL), SetPadding(0, 0, 0, 1),
 
			NWidget(NWID_SPACER), SetFill(true, false),
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_LABEL, COLOUR_WHITE, NTW_DATE), SetDataTip(STR_DATE_LONG_SMALL, STR_NULL),
 
				NWidget(NWID_SPACER), SetFill(false, true),
 
			EndContainer(),
 
		EndContainer(),
 
		NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_MESSAGE), SetMinimalSize(428, 48), SetFill(true, false), SetPadding(0, 1, 0, 1),
 
		NWidget(NWID_VIEWPORT, INVALID_COLOUR, NTW_VIEWPORT), SetMinimalSize(426, 70), SetPadding(1, 2, 2, 2),
 
	EndContainer(),
 
};
 

	
 
static WindowDesc _thin_news_desc(
 
	WDP_CENTER, 476, 430, 130, 430, 130,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	NULL, _nested_thin_news_widgets, lengthof(_nested_thin_news_widgets)
 
	_nested_thin_news_widgets, lengthof(_nested_thin_news_widgets)
 
);
 

	
 
/* Small news items. */
 
static NWidgetPart _nested_small_news_widgets[] = {
 
	/* Caption + close box */
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE, NTW_CLOSEBOX), SetMinimalSize(11, 14), SetDataTip(STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW),
 
		NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, NTW_CAPTION), SetMinimalSize(269, 14), SetDataTip(STR_NEWS_MESSAGE_CAPTION, STR_NULL),
 
	EndContainer(),
 

	
 
	/* Main part */
 
	NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NTW_HEADLINE),
 
		NWidget(WWT_INSET, COLOUR_LIGHT_BLUE, NTW_INSET), SetPadding(2, 2, 2, 2),
 
			NWidget(NWID_VIEWPORT, INVALID_COLOUR, NTW_VIEWPORT), SetPadding(1, 1, 1, 1), SetMinimalSize(274, 47), SetFill(true, false),
 
		EndContainer(),
 
		NWidget(WWT_EMPTY, COLOUR_WHITE, NTW_MESSAGE), SetMinimalSize(275, 20), SetFill(true, false),
 
	EndContainer(),
 
};
 

	
 
static WindowDesc _small_news_desc(
 
	WDP_CENTER, 476, 280, 87, 280, 87,
 
	WC_NEWS_WINDOW, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	NULL, _nested_small_news_widgets, lengthof(_nested_small_news_widgets)
 
	_nested_small_news_widgets, lengthof(_nested_small_news_widgets)
 
);
 

	
 
/**
 
 * Data common to all news items of a given subtype (structure)
 
 */
 
struct NewsSubtypeData {
 
	NewsType type;         ///< News category @see NewsType
 
	NewsFlag flags;        ///< Initial NewsFlags bits @see NewsFlag
 
	WindowDesc *desc;      ///< Window description for displaying this news.
 
};
 

	
 
/**
 
@@ -1014,25 +1014,25 @@ static const NWidgetPart _nested_message
 
		EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_SCROLLBAR, COLOUR_BROWN, MHW_SCROLLBAR), SetFill(false, true), SetDataTip(0x0, STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST), SetResize(0, 1),
 
			NWidget(WWT_RESIZEBOX, COLOUR_BROWN, MHW_RESIZEBOX), SetMinimalSize(12, 12), SetDataTip(0x0, STR_TOOLTIP_RESIZE),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_message_history, lengthof(_nested_message_history)
 
	_nested_message_history, lengthof(_nested_message_history)
 
);
 

	
 
/** Display window with news messages history */
 
void ShowMessageHistory()
 
{
 
	DeleteWindowById(WC_MESSAGE_HISTORY, 0);
 
	new MessageHistoryWindow(&_message_history_desc);
 
}
 

	
 
/** Constants in the message options window. */
 
enum MessageOptionsSpace {
 
	MOS_WIDG_PER_SETTING      = 4,  ///< Number of widgets needed for each news category, starting at widget #WIDGET_NEWSOPT_START_OPTION.
 
@@ -1302,20 +1302,20 @@ static const NWidgetPart _nested_message
 
			NWidget(NWID_SPACER), SetMinimalSize(MOS_COLUMN_SPACING, 0),
 
			NWidgetFunction(MakeDescriptionColumn),
 
			NWidget(NWID_SPACER), SetMinimalSize(MOS_RIGHT_EDGE, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, MOS_BOTTOM_EDGE),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _message_options_desc(
 
	270,  22,  0, 0, 0, 0,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	NULL, _nested_message_options_widgets, lengthof(_nested_message_options_widgets)
 
	_nested_message_options_widgets, lengthof(_nested_message_options_widgets)
 
);
 

	
 
void ShowMessageOptions()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new MessageOptionsWindow(&_message_options_desc);
 
}
src/order_gui.cpp
Show inline comments
 
@@ -1336,25 +1336,25 @@ static const NWidgetPart _nested_orders_
 
													SetDataTip(STR_ORDERS_DELETE_BUTTON, STR_ORDERS_DELETE_TOOLTIP), SetResize(1, 0),
 
			NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_GOTO), SetMinimalSize(124, 12), SetFill(true, false),
 
													SetDataTip(STR_ORDERS_GO_TO_BUTTON, STR_ORDERS_GO_TO_TOOLTIP), SetResize(1, 0),
 
		EndContainer(),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, ORDER_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _orders_train_desc(
 
	WDP_AUTO, WDP_AUTO, 384, 100, 384, 100,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_orders_train_widgets, lengthof(_nested_orders_train_widgets)
 
	_nested_orders_train_widgets, lengthof(_nested_orders_train_widgets)
 
);
 

	
 
/** Nested widget definition for "your" orders (non-train). */
 
static const NWidgetPart _nested_orders_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY, ORDER_WIDGET_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, ORDER_WIDGET_CAPTION), SetDataTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_TIMETABLE_VIEW), SetMinimalSize(61, 14), SetDataTip(STR_ORDERS_TIMETABLE_VIEW, STR_ORDERS_TIMETABLE_VIEW_TOOLTIP),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY, ORDER_WIDGET_STICKY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_GREY, ORDER_WIDGET_ORDER_LIST), SetMinimalSize(372, 62), SetDataTip(0x0, STR_ORDERS_LIST_TOOLTIP), SetResize(1, 1), EndContainer(),
 
@@ -1400,25 +1400,25 @@ static const NWidgetPart _nested_orders_
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_DELETE), SetMinimalSize(124, 12), SetFill(true, false),
 
											SetDataTip(STR_ORDERS_DELETE_BUTTON, STR_ORDERS_DELETE_TOOLTIP), SetResize(1, 0),
 
		NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_GOTO), SetMinimalSize(124, 12), SetFill(true, false),
 
											SetDataTip(STR_ORDERS_GO_TO_BUTTON, STR_ORDERS_GO_TO_TOOLTIP), SetResize(1, 0),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, ORDER_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _orders_desc(
 
	WDP_AUTO, WDP_AUTO, 384, 100, 384, 100,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_orders_widgets, lengthof(_nested_orders_widgets)
 
	_nested_orders_widgets, lengthof(_nested_orders_widgets)
 
);
 

	
 
/** Nested widget definition for competitor orders. */
 
static const NWidgetPart _nested_other_orders_widgets[] = {
 
	NWidget(NWID_VERTICAL),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(WWT_CLOSEBOX, COLOUR_GREY, ORDER_WIDGET_CLOSEBOX),
 
			NWidget(WWT_CAPTION, COLOUR_GREY, ORDER_WIDGET_CAPTION), SetDataTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_TIMETABLE_VIEW), SetMinimalSize(61, 14), SetDataTip(STR_ORDERS_TIMETABLE_VIEW, STR_ORDERS_TIMETABLE_VIEW_TOOLTIP),
 
			NWidget(WWT_STICKYBOX, COLOUR_GREY, ORDER_WIDGET_STICKY),
 
		EndContainer(),
 
		NWidget(NWID_HORIZONTAL),
 
@@ -1426,25 +1426,25 @@ static const NWidgetPart _nested_other_o
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_SCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR),
 
				NWidget(WWT_RESIZEBOX, COLOUR_GREY, ORDER_WIDGET_RESIZE),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _other_orders_desc(
 
	WDP_AUTO, WDP_AUTO, 384, 86, 384, 86,
 
	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	NULL, _nested_other_orders_widgets, lengthof(_nested_other_orders_widgets)
 
	_nested_other_orders_widgets, lengthof(_nested_other_orders_widgets)
 
);
 

	
 
void ShowOrdersWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_DETAILS, v->index, false);
 
	DeleteWindowById(WC_VEHICLE_TIMETABLE, v->index, false);
 
	if (BringWindowToFrontById(WC_VEHICLE_ORDERS, v->index) != NULL) return;
 

	
 
	if (v->owner != _local_company) {
 
		new OrdersWindow(&_other_orders_desc, v);
 
	} else {
 
		new OrdersWindow((v->type == VEH_TRAIN || v->type == VEH_ROAD) ? &_orders_train_desc : &_orders_desc, v);
src/osk_gui.cpp
Show inline comments
 
@@ -385,25 +385,25 @@ static const NWidgetPart _nested_osk_wid
 
		NWidgetFunction(MakeNumberKeys), SetPadding(0, 3, 0, 3),
 
		NWidgetFunction(MakeQwertyKeys), SetPadding(0, 3, 0, 3),
 
		NWidgetFunction(MakeAsdfgKeys), SetPadding(0, 3, 0, 3),
 
		NWidgetFunction(MakeZxcvbKeys), SetPadding(0, 3, 0, 3),
 
		NWidgetFunction(MakeSpacebarKeys), SetPadding(0, 3, 0, 3),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_osk_widgets, lengthof(_nested_osk_widgets)
 
	_nested_osk_widgets, lengthof(_nested_osk_widgets)
 
);
 

	
 
/**
 
 * Retrieve keyboard layout from language string or (if set) config file.
 
 * Also check for invalid characters.
 
 */
 
void GetKeyboardLayout()
 
{
 
	char keyboard[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
 
	char errormark[2][OSK_KEYBOARD_ENTRIES + 1]; // used for marking invalid chars
 
	bool has_error = false; // true when an invalid char is detected
 

	
src/rail_gui.cpp
Show inline comments
 
@@ -853,25 +853,25 @@ static const NWidgetPart _nested_build_r
 
						SetFill(false, true), SetMinimalSize(20, 22), SetDataTip(SPR_IMG_TUNNEL_RAIL, STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_REMOVE),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_REMOVE, STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_CONVERT_RAIL),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_CONVERT_RAIL, STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_rail_widgets, lengthof(_nested_build_rail_widgets)
 
	_nested_build_rail_widgets, lengthof(_nested_build_rail_widgets)
 
);
 

	
 

	
 
/**
 
 * Open the build rail toolbar window for a specific rail type.
 
 * The window may be opened in the 'normal' way by clicking at the rail icon in
 
 * the main toolbar, or by means of selecting one of the functions of the
 
 * toolbar. In the latter case, the corresponding widget is also selected.
 
 *
 
 * If the terraform toolbar is linked to the toolbar, that window is also opened.
 
 *
 
 * @param railtype Rail type to open the window for
 
@@ -1463,33 +1463,33 @@ static const NWidgetPart _nested_newstat
 
										SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP),
 
			NWidget(NWID_SPACER), SetMinimalSize(2, 0), SetFill(true, false),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 20), SetResize(0, 1),
 
	EndContainer(),
 
};
 

	
 
/** 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 | WDF_CONSTRUCTION,
 
	NULL, _nested_station_builder_widgets, lengthof(_nested_station_builder_widgets)
 
	_nested_station_builder_widgets, lengthof(_nested_station_builder_widgets)
 
);
 

	
 
/** 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 | WDF_CONSTRUCTION,
 
	NULL, _nested_newstation_builder_widgets, lengthof(_nested_newstation_builder_widgets)
 
	_nested_newstation_builder_widgets, lengthof(_nested_newstation_builder_widgets)
 
);
 

	
 
/** Open station build window */
 
static void ShowStationBuilder(Window *parent)
 
{
 
	if (GetNumStationClasses() <= 2 && GetNumCustomStations(STAT_CLASS_DFLT) == 1) {
 
		new BuildRailStationWindow(&_station_builder_desc, parent, false);
 
	} else {
 
		new BuildRailStationWindow(&_newstation_builder_desc, parent, true);
 
	}
 
}
 

	
 
@@ -1678,25 +1678,25 @@ static const NWidgetPart _nested_signal_
 
				EndContainer(),
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 2), SetFill(true, false),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
/** Signal selection window description */
 
static const WindowDesc _signal_builder_desc(
 
	WDP_AUTO, WDP_AUTO, 154, 68, 154, 68,
 
	WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION,
 
	NULL, _nested_signal_builder_widgets, lengthof(_nested_signal_builder_widgets)
 
	_nested_signal_builder_widgets, lengthof(_nested_signal_builder_widgets)
 
);
 

	
 
/**
 
 * Open the signal selection window
 
 */
 
static void ShowSignalBuilder(Window *parent)
 
{
 
	new BuildSignalWindow(&_signal_builder_desc, parent);
 
}
 

	
 
/** Enum referring to the widgets of the build rail depot window */
 
enum BuildRailDepotWidgets {
 
@@ -1771,25 +1771,25 @@ static const NWidgetPart _nested_build_d
 
				EndContainer(),
 
			EndContainer(),
 
			NWidget(NWID_SPACER), SetMinimalSize(3, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 3),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_depot_widgets, lengthof(_nested_build_depot_widgets)
 
	_nested_build_depot_widgets, lengthof(_nested_build_depot_widgets)
 
);
 

	
 
static void ShowBuildTrainDepotPicker(Window *parent)
 
{
 
	new BuildRailDepotWindow(&_build_depot_desc, parent);
 
}
 

	
 
/** Enum referring to the widgets of the build NewGRF rail waypoint window */
 
enum BuildRailWaypointWidgets {
 
	BRWW_CLOSEBOX = 0,
 
	BRWW_CAPTION,
 
	BRWW_BACKGROUND,
 
@@ -1873,25 +1873,25 @@ static const NWidgetPart _nested_build_w
 
			NWidget(WWT_PANEL, COLOUR_DARK_GREEN, BRWW_WAYPOINT_4), SetMinimalSize(66, 60), SetDataTip(0x0, STR_WAYPOINT_GRAPHICS_TOOLTIP), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_DARK_GREEN, BRWW_WAYPOINT_5), SetMinimalSize(66, 60), SetDataTip(0x0, STR_WAYPOINT_GRAPHICS_TOOLTIP), EndContainer(),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 3),
 
		NWidget(WWT_HSCROLLBAR, COLOUR_DARK_GREEN, BRWW_SCROLL),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_waypoint_widgets, lengthof(_nested_build_waypoint_widgets)
 
	_nested_build_waypoint_widgets, lengthof(_nested_build_waypoint_widgets)
 
);
 

	
 
static void ShowBuildWaypointPicker(Window *parent)
 
{
 
	new BuildRailWaypointWindow(&_build_waypoint_desc, parent);
 
}
 

	
 
/**
 
 * Initialize rail building GUI settings
 
 */
 
void InitializeRailGui()
 
{
src/road_gui.cpp
Show inline comments
 
@@ -657,25 +657,25 @@ static const NWidgetPart _nested_build_r
 
						SetFill(false, true), SetMinimalSize(43, 22), SetDataTip(SPR_IMG_BRIDGE, STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_BUILD_TUNNEL),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_ROAD_TUNNEL, STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_TUNNEL),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_REMOVE),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_REMOVE, STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_ROAD),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_road_widgets, lengthof(_nested_build_road_widgets)
 
	_nested_build_road_widgets, lengthof(_nested_build_road_widgets)
 
);
 

	
 
static const NWidgetPart _nested_build_tramway_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN, RTW_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, RTW_CAPTION), SetDataTip(STR_ROAD_TOOLBAR_TRAM_CONSTRUCTION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN, RTW_STICKY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_ROAD_X),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_TRAMWAY_X_DIR, STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_SECTION),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_ROAD_Y),
 
@@ -695,25 +695,25 @@ static const NWidgetPart _nested_build_t
 
						SetFill(false, true), SetMinimalSize(43, 22), SetDataTip(SPR_IMG_BRIDGE, STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_BRIDGE),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_BUILD_TUNNEL),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_ROAD_TUNNEL, STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_REMOVE),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_REMOVE, STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_tramway_widgets, lengthof(_nested_build_tramway_widgets)
 
	_nested_build_tramway_widgets, lengthof(_nested_build_tramway_widgets)
 
);
 

	
 
void ShowBuildRoadToolbar(RoadType roadtype)
 
{
 
	if (!Company::IsValidID(_local_company)) return;
 
	_cur_roadtype = roadtype;
 

	
 
	DeleteWindowByClass(WC_BUILD_TOOLBAR);
 
	AllocateWindowDescFront<BuildRoadToolbarWindow>(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD);
 
}
 

	
 
static const NWidgetPart _nested_build_road_scen_widgets[] = {
 
@@ -737,25 +737,25 @@ static const NWidgetPart _nested_build_r
 
						SetFill(false, true), SetMinimalSize(43, 22), SetDataTip(SPR_IMG_BRIDGE, STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_BUILD_TUNNEL),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_ROAD_TUNNEL, STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_TUNNEL),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, RTW_REMOVE),
 
						SetFill(false, true), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_REMOVE, STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_ROAD),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _build_road_scen_desc(
 
	WDP_AUTO, WDP_AUTO, 197, 36, 197, 36,
 
	WC_SCEN_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	NULL, _nested_build_road_scen_widgets, lengthof(_nested_build_road_scen_widgets)
 
	_nested_build_road_scen_widgets, lengthof(_nested_build_road_scen_widgets)
 
);
 

	
 
void ShowBuildRoadScenToolbar()
 
{
 
	_cur_roadtype = ROADTYPE_ROAD;
 
	AllocateWindowDescFront<BuildRoadToolbarWindow>(&_build_road_scen_desc, 0);
 
}
 

	
 
/** Enum referring to the widgets of the build road depot window */
 
enum BuildRoadDepotWidgets {
 
	BRDW_CLOSEBOX = 0,
 
	BRDW_CAPTION,
 
@@ -837,25 +837,25 @@ static const NWidgetPart _nested_build_r
 
				EndContainer(),
 
			EndContainer(),
 
			NWidget(NWID_SPACER), SetMinimalSize(3, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 3),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_road_depot_widgets, lengthof(_nested_build_road_depot_widgets)
 
	_nested_build_road_depot_widgets, lengthof(_nested_build_road_depot_widgets)
 
);
 

	
 
static void ShowRoadDepotPicker(Window *parent)
 
{
 
	new BuildRoadDepotWindow(&_build_road_depot_desc, parent);
 
}
 

	
 
/** Enum referring to the widgets of the build road station window */
 
enum BuildRoadStationWidgets {
 
	BRSW_CLOSEBOX = 0,
 
	BRSW_CAPTION,
 
	BRSW_BACKGROUND,
 
@@ -1002,25 +1002,25 @@ static const NWidgetPart _nested_rv_stat
 
			NWidget(WWT_TEXTBTN, COLOUR_GREY, BRSW_LT_ON), SetMinimalSize(60, 12),
 
											SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP),
 
			NWidget(NWID_SPACER), SetFill(true, false),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 10), SetResize(0, 1),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _rv_station_picker_desc(
 
	WDP_AUTO, WDP_AUTO, 207, 178, 207, 178,
 
	WC_BUS_STATION, WC_BUILD_TOOLBAR,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_CONSTRUCTION,
 
	NULL, _nested_rv_station_picker_widgets, lengthof(_nested_rv_station_picker_widgets)
 
	_nested_rv_station_picker_widgets, lengthof(_nested_rv_station_picker_widgets)
 
);
 

	
 
static void ShowRVStationPicker(Window *parent, RoadStopType rs)
 
{
 
	new BuildRoadStationWindow(&_rv_station_picker_desc, parent, rs);
 
}
 

	
 
void InitializeRoadGui()
 
{
 
	_road_depot_orientation = DIAGDIR_NW;
 
	_road_station_picker_orientation = DIAGDIR_NW;
 
}
src/settings_gui.cpp
Show inline comments
 
@@ -483,25 +483,25 @@ static const NWidgetPart _nested_game_op
 
				NWidget(WWT_DROPDOWN, COLOUR_GREY, GOW_BASE_SFX_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_BASE_SFX_TOOLTIP), SetPadding(14, 0, 0, 0),
 
				NWidget(NWID_SPACER), SetFill(true, false),
 
			EndContainer(),
 
			NWidget(WWT_TEXT, COLOUR_GREY, GOW_BASE_SFX_DESCRIPTION), SetMinimalSize(330, 0), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_BASE_SFX_DESCRIPTION_TOOLTIP), SetPadding(6, 10, 10, 10), SetFill(true, false),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _game_options_desc(
 
	WDP_CENTER, WDP_CENTER, 370, 249, 370, 249,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	NULL, _nested_game_options_widgets, lengthof(_nested_game_options_widgets)
 
	_nested_game_options_widgets, lengthof(_nested_game_options_widgets)
 
);
 

	
 

	
 
void ShowGameOptions()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new GameOptionsWindow(&_game_options_desc);
 
}
 

	
 
extern void StartupEconomy();
 

	
 

	
 
@@ -761,25 +761,25 @@ static const NWidgetPart _nested_game_di
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, GDW_CANCEL), SetDataTip(STR_BUTTON_CANCEL, STR_NULL), SetFill(true, false),
 
				NWidget(NWID_SPACER), SetFill(true, false),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
/** 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 | WDF_UNCLICK_BUTTONS,
 
	NULL, _nested_game_difficulty_widgets, lengthof(_nested_game_difficulty_widgets)
 
	_nested_game_difficulty_widgets, lengthof(_nested_game_difficulty_widgets)
 
);
 

	
 
void ShowGameDifficulty()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new GameDifficultyWindow(&_game_difficulty_desc);
 
}
 

	
 
static int SETTING_HEIGHT = 11;    ///< Height of a single setting in the tree view in pixels
 
static const int LEVEL_WIDTH = 15; ///< Indenting width of a sub-page in pixels
 

	
 
/**
 
@@ -1647,25 +1647,25 @@ static const NWidgetPart _nested_setting
 
		NWidget(WWT_PANEL, COLOUR_MAUVE, SETTINGSEL_OPTIONSPANEL), SetMinimalSize(400, 174), EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_SCROLLBAR, COLOUR_MAUVE, SETTINGSEL_SCROLLBAR),
 
			NWidget(WWT_RESIZEBOX, COLOUR_MAUVE, SETTINGSEL_RESIZE),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _settings_selection_desc(
 
	WDP_CENTER, WDP_CENTER, 412, 188, 450, 397,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 
	NULL, _nested_settings_selection_widgets, lengthof(_nested_settings_selection_widgets)
 
	_nested_settings_selection_widgets, lengthof(_nested_settings_selection_widgets)
 
);
 

	
 
void ShowGameSettings()
 
{
 
	DeleteWindowById(WC_GAME_OPTIONS, 0);
 
	new GameSettingsWindow(&_settings_selection_desc);
 
}
 

	
 

	
 
/**
 
 * Draw [<][>] boxes.
 
 * @param x the x position to draw
 
@@ -1929,20 +1929,20 @@ static const NWidgetPart _nested_cust_cu
 
				NWidget(WWT_TEXT, COLOUR_BLUE, CUSTCURR_YEAR), SetDataTip(STR_JUST_STRING, STR_CURRENCY_SET_CUSTOM_CURRENCY_TO_EURO_TOOLTIP), SetFill(true, false),
 
			EndContainer(),
 
		EndContainer(),
 
		NWidget(WWT_LABEL, COLOUR_BLUE, CUSTCURR_PREVIEW),
 
								SetDataTip(STR_CURRENCY_PREVIEW, STR_CURRENCY_CUSTOM_CURRENCY_PREVIEW_TOOLTIP), SetPadding(15, 1, 18, 2),
 
	EndContainer(),
 
};
 

	
 
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,
 
	NULL, _nested_cust_currency_widgets, lengthof(_nested_cust_currency_widgets)
 
	_nested_cust_currency_widgets, lengthof(_nested_cust_currency_widgets)
 
);
 

	
 
static void ShowCustCurrency()
 
{
 
	DeleteWindowById(WC_CUSTOM_CURRENCY, 0);
 
	new CustomCurrencyWindow(&_cust_currency_desc);
 
}
src/signs_gui.cpp
Show inline comments
 
@@ -197,25 +197,25 @@ static const NWidgetPart _nested_sign_li
 
							SetResize(1, 10), SetFill(true, false), EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_SCROLLBAR, COLOUR_GREY, SLW_SCROLLBAR),
 
			NWidget(WWT_RESIZEBOX, COLOUR_GREY, SLW_RESIZE),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _sign_list_desc(
 
	WDP_AUTO, WDP_AUTO, 0, 0, 358, 138,
 
	WC_SIGN_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_sign_list_widgets, lengthof(_nested_sign_list_widgets)
 
	_nested_sign_list_widgets, lengthof(_nested_sign_list_widgets)
 
);
 

	
 

	
 
void ShowSignList()
 
{
 
	AllocateWindowDescFront<SignListWindow>(&_sign_list_desc, 0);
 
}
 

	
 
/**
 
 * Actually rename the sign.
 
 * @param index the sign to rename.
 
 * @param text  the new name.
 
@@ -395,25 +395,25 @@ static const NWidgetPart _nested_query_s
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_CANCEL), SetMinimalSize(60, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_DELETE), SetMinimalSize(60, 12), SetDataTip(STR_TOWN_VIEW_DELETE_BUTTON, STR_NULL),
 
		NWidget(WWT_PANEL, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_FILL), SetFill(true, true), EndContainer(),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_PREVIOUS), SetMinimalSize(11, 12), SetDataTip(STR_BLACK_SMALL_ARROW_LEFT, STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, QUERY_EDIT_SIGN_WIDGET_NEXT), SetMinimalSize(11, 12), SetDataTip(STR_BLACK_SMALL_ARROW_RIGHT, STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION | WDF_UNCLICK_BUTTONS,
 
	NULL, _nested_query_sign_edit_widgets, lengthof(_nested_query_sign_edit_widgets)
 
	_nested_query_sign_edit_widgets, lengthof(_nested_query_sign_edit_widgets)
 
);
 

	
 
void HandleClickOnSign(const Sign *si)
 
{
 
	if (_ctrl_pressed && si->owner == _local_company) {
 
		RenameSign(si->index, NULL);
 
		return;
 
	}
 
	ShowRenameSignWindow(si);
 
}
 

	
 
void ShowRenameSignWindow(const Sign *si)
src/smallmap_gui.cpp
Show inline comments
 
@@ -1142,25 +1142,25 @@ public:
 
		this->scroll_y = (x + y) & ~0xF;
 
		this->SetDirty();
 
	}
 
};
 

	
 
SmallMapWindow::SmallMapType SmallMapWindow::map_type = SMT_CONTOUR;
 
bool SmallMapWindow::show_towns = true;
 

	
 
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 | WDF_UNCLICK_BUTTONS,
 
	NULL, _nested_smallmap_widgets, lengthof(_nested_smallmap_widgets)
 
	_nested_smallmap_widgets, lengthof(_nested_smallmap_widgets)
 
);
 

	
 
void ShowSmallMap()
 
{
 
	AllocateWindowDescFront<SmallMapWindow>(&_smallmap_desc, 0);
 
}
 

	
 
/**
 
 * Scrolls the main window to given coordinates.
 
 * @param x x coordinate
 
 * @param y y coordinate
 
 * @param z z coordinate; -1 to scroll to terrain height
src/station_gui.cpp
Show inline comments
 
@@ -655,25 +655,25 @@ static const NWidgetPart _nested_company
 
		NWidget(WWT_PANEL, COLOUR_GREY, SLW_LIST), SetMinimalSize(346, 125), SetResize(1, 10), SetDataTip(0x0, STR_STATION_LIST_TOOLTIP), EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_SCROLLBAR, COLOUR_GREY, SLW_SCROLLBAR),
 
			NWidget(WWT_RESIZEBOX, COLOUR_GREY, SLW_RESIZE),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _company_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,
 
	NULL, _nested_company_stations_widgets, lengthof(_nested_company_stations_widgets)
 
	_nested_company_stations_widgets, lengthof(_nested_company_stations_widgets)
 
);
 

	
 
/**
 
 * Opens window with list of company's stations
 
 *
 
 * @param company whose stations' list show
 
 */
 
void ShowCompanyStations(CompanyID company)
 
{
 
	if (!Company::IsValidID(company)) return;
 

	
 
	AllocateWindowDescFront<CompanyStationsWindow>(&_company_stations_desc, company);
 
@@ -1104,25 +1104,25 @@ struct StationViewWindow : public Window
 

	
 
	virtual void OnResize()
 
	{
 
		this->vscroll.SetCapacity((this->GetWidget<NWidgetBase>(SVW_WAITING)->current_y - WD_FRAMERECT_TOP - WD_FRAMERECT_BOTTOM) / this->resize.step_height);
 
	}
 
};
 

	
 

	
 
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,
 
	NULL, _nested_station_view_widgets, lengthof(_nested_station_view_widgets)
 
	_nested_station_view_widgets, lengthof(_nested_station_view_widgets)
 
);
 

	
 
/**
 
 * Opens StationViewWindow for given station
 
 *
 
 * @param station station which window should be opened
 
 */
 
void ShowStationViewWindow(StationID station)
 
{
 
	AllocateWindowDescFront<StationViewWindow>(&_station_view_desc, station);
 
}
 

	
 
@@ -1354,25 +1354,25 @@ struct SelectStationWindow : Window {
 
	virtual void OnInvalidateData(int data)
 
	{
 
		FindStationsNearby<T>(this->area, true);
 
		this->vscroll.SetCount(_stations_nearby_list.Length() + 1);
 
		this->SetDirty();
 
	}
 
};
 

	
 
static const WindowDesc _select_station_desc(
 
	WDP_AUTO, WDP_AUTO, 200, 80, 200, 180,
 
	WC_SELECT_STATION, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE | WDF_CONSTRUCTION,
 
	NULL, _nested_select_station_widgets, lengthof(_nested_select_station_widgets)
 
	_nested_select_station_widgets, lengthof(_nested_select_station_widgets)
 
);
 

	
 

	
 
/**
 
 * Check whether we need to show the station selection window.
 
 * @param cmd Command to build the station.
 
 * @param ta Tile area of the to-be-built station
 
 * @tparam T the type of station
 
 * @return whether we need to show the station selection window.
 
 */
 
template <class T>
 
static bool StationJoinerNeeded(CommandContainer cmd, TileArea ta)
src/statusbar_gui.cpp
Show inline comments
 
@@ -208,25 +208,25 @@ struct StatusBarWindow : Window {
 
static const NWidgetPart _nested_main_status_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_GREY, SBW_LEFT), SetMinimalSize(140, 12), EndContainer(),
 
		NWidget(WWT_PUSHBTN, COLOUR_GREY, SBW_MIDDLE), SetMinimalSize(40, 12), SetDataTip(0x0, STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS), SetResize(1, 0),
 
		NWidget(WWT_PUSHBTN, COLOUR_GREY, SBW_RIGHT), SetMinimalSize(140, 12),
 
	EndContainer(),
 
};
 

	
 
static const 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 | WDF_NO_FOCUS,
 
	NULL, _nested_main_status_widgets, lengthof(_nested_main_status_widgets)
 
	_nested_main_status_widgets, lengthof(_nested_main_status_widgets)
 
);
 

	
 
/**
 
 * Checks whether the news ticker is currently being used.
 
 */
 
bool IsNewsTickerShown()
 
{
 
	const StatusBarWindow *w = dynamic_cast<StatusBarWindow*>(FindWindowById(WC_STATUS_BAR, 0));
 
	return w != NULL && w->ticker_scroll < StatusBarWindow::TICKER_STOP;
 
}
 

	
 
void ShowStatusBar()
src/subsidy_gui.cpp
Show inline comments
 
@@ -241,20 +241,20 @@ static const NWidgetPart _nested_subsidi
 
		NWidget(WWT_PANEL, COLOUR_BROWN, SLW_PANEL), SetDataTip(0x0, STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER), SetResize(1, 1), EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_SCROLLBAR, COLOUR_BROWN, SLW_SCROLLBAR),
 
			NWidget(WWT_RESIZEBOX, COLOUR_BROWN, SLW_RESIZEBOX),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _subsidies_list_desc(
 
	WDP_AUTO, WDP_AUTO, 320, 127, 500, 127,
 
	WC_SUBSIDIES_LIST, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_subsidies_list_widgets, lengthof(_nested_subsidies_list_widgets)
 
	_nested_subsidies_list_widgets, lengthof(_nested_subsidies_list_widgets)
 
);
 

	
 

	
 
void ShowSubsidiesList()
 
{
 
	AllocateWindowDescFront<SubsidyListWindow>(&_subsidies_list_desc, 0);
 
}
src/terraform_gui.cpp
Show inline comments
 
@@ -335,25 +335,25 @@ static const NWidgetPart _nested_terrafo
 
								SetFill(false, true), SetDataTip(SPR_IMG_BUY_LAND, STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, TTW_PLANT_TREES), SetMinimalSize(22,22),
 
								SetFill(false, true), SetDataTip(SPR_IMG_PLANTTREES, STR_SCENEDIT_TOOLBAR_PLANT_TREES),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, TTW_PLACE_SIGN), SetMinimalSize(22,22),
 
								SetFill(false, true), SetDataTip(SPR_IMG_SIGN, STR_SCENEDIT_TOOLBAR_PLACE_SIGN),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_terraform_widgets, lengthof(_nested_terraform_widgets)
 
	_nested_terraform_widgets, lengthof(_nested_terraform_widgets)
 
);
 

	
 
Window *ShowTerraformToolbar(Window *link)
 
{
 
	if (!Company::IsValidID(_local_company)) return NULL;
 

	
 
	Window *w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
 
	if (link == NULL) return w;
 

	
 
	if (w == NULL) {
 
		w = FindWindowById(WC_SCEN_LAND_GEN, 0);
 
		if (w == NULL) return NULL;
 
@@ -768,25 +768,25 @@ struct ScenarioEditorLandscapeGeneration
 

	
 
	virtual void OnPlaceObjectAbort()
 
	{
 
		this->RaiseButtons();
 
		this->SetDirty();
 
	}
 
};
 

	
 
static const WindowDesc _scen_edit_land_gen_desc(
 
	WDP_AUTO, WDP_AUTO, 163, 103, 163, 103,
 
	WC_SCEN_LAND_GEN, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	NULL, _nested_scen_edit_land_gen_widgets, lengthof(_nested_scen_edit_land_gen_widgets)
 
	_nested_scen_edit_land_gen_widgets, lengthof(_nested_scen_edit_land_gen_widgets)
 
);
 

	
 
Window *ShowEditorTerraformToolbar()
 
{
 
	return AllocateWindowDescFront<ScenarioEditorLandscapeGenerationWindow>(&_scen_edit_land_gen_desc, 0);
 
}
 

	
 
void ShowEditorTerraformToolbarWithTool(uint16 key, uint16 keycode)
 
{
 
	Window *w = FindWindowById(WC_SCEN_LAND_GEN, 0);
 

	
 
	if (w == NULL) w = ShowEditorTerraformToolbar();
src/timetable_gui.cpp
Show inline comments
 
@@ -376,21 +376,21 @@ static const NWidgetPart _nested_timetab
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, TTV_CLEAR_TIME), SetMinimalSize(110, 12), SetDataTip(STR_TIMETABLE_CLEAR_TIME, STR_TIMETABLE_CLEAR_TIME_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, TTV_RESET_LATENESS), SetMinimalSize(118, 12), SetDataTip(STR_TIMETABLE_RESET_LATENESS, STR_TIMETABLE_RESET_LATENESS_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, TTV_AUTOFILL), SetMinimalSize(50, 12), SetDataTip(STR_TIMETABLE_AUTOFILL, STR_TIMETABLE_AUTOFILL_TOOLTIP),
 
		NWidget(WWT_PANEL, COLOUR_GREY, TTV_EMPTY), SetMinimalSize(0, 12), SetResize(1, 0), EndContainer(),
 
		NWidget(WWT_RESIZEBOX,COLOUR_GREY, TTV_RESIZE),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_timetable_widgets, lengthof(_nested_timetable_widgets)
 
	_nested_timetable_widgets, lengthof(_nested_timetable_widgets)
 
);
 

	
 
void ShowTimetableWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_DETAILS, v->index, false);
 
	DeleteWindowById(WC_VEHICLE_ORDERS, v->index, false);
 
	AllocateWindowDescFront<TimetableWindow>(&_timetable_desc, v->index);
 
}
src/toolbar_gui.cpp
Show inline comments
 
@@ -1357,25 +1357,25 @@ static NWidgetBase *MakeMainToolbar(int 
 
	*biggest_index = max<int>(*biggest_index, TBN_SWITCHBAR);
 
	return hor;
 
}
 

	
 
static const NWidgetPart _nested_toolbar_normal_widgets[] = {
 
	NWidgetFunction(MakeMainToolbar),
 
};
 

	
 
static const WindowDesc _toolb_normal_desc(
 
	0, 0, 0, 22, 640, 22,
 
	WC_MAIN_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_NO_FOCUS,
 
	NULL, _nested_toolbar_normal_widgets, lengthof(_nested_toolbar_normal_widgets)
 
	_nested_toolbar_normal_widgets, lengthof(_nested_toolbar_normal_widgets)
 
);
 

	
 

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

	
 
static ToolbarButtonProc * const _scen_toolbar_button_procs[] = {
 
	ToolbarPauseClick,
 
	ToolbarFastForwardClick,
 
	ToolbarOptionsClick,
 
	ToolbarScenSaveOrLoad,
 
	ToolbarBtn_NULL,
 
	ToolbarBtn_NULL,
 
@@ -1580,25 +1580,25 @@ static NWidgetBase *MakeScenarioToolbar(
 
{
 
	return MakeNWidgets(_nested_toolb_scen_inner_widgets, lengthof(_nested_toolb_scen_inner_widgets), biggest_index, new NWidgetScenarioToolbarContainer());
 
}
 

	
 
static const NWidgetPart _nested_toolb_scen_widgets[] = {
 
	NWidgetFunction(MakeScenarioToolbar),
 
};
 

	
 
static const WindowDesc _toolb_scen_desc(
 
	0, 0, 0, 22, 640, 22,
 
	WC_MAIN_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_NO_FOCUS,
 
	NULL, _nested_toolb_scen_widgets, lengthof(_nested_toolb_scen_widgets)
 
	_nested_toolb_scen_widgets, lengthof(_nested_toolb_scen_widgets)
 
);
 

	
 
/* --- Allocating the toolbar --- */
 

	
 
void AllocateToolbar()
 
{
 
	/* Clean old GUI values; railtype is (re)set by rail_gui.cpp */
 
	_last_built_roadtype = ROADTYPE_ROAD;
 

	
 
	if (_game_mode == GM_EDITOR) {
 
		new ScenarioEditorToolbarWindow(&_toolb_scen_desc);;
 
	} else {
src/town_gui.cpp
Show inline comments
 
@@ -261,25 +261,25 @@ public:
 
	}
 

	
 
	virtual void OnHundredthTick()
 
	{
 
		this->SetDirty();
 
	}
 
};
 

	
 
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,
 
	NULL, _nested_town_authority_widgets, lengthof(_nested_town_authority_widgets)
 
	_nested_town_authority_widgets, lengthof(_nested_town_authority_widgets)
 
);
 

	
 
static void ShowTownAuthorityWindow(uint town)
 
{
 
	AllocateWindowDescFront<TownAuthorityWindow>(&_town_authority_desc, town);
 
}
 

	
 
/** Widget numbers of the town view window. */
 
enum TownViewWidgets {
 
	TVW_CLOSEBOX,
 
	TVW_CAPTION,
 
	TVW_STICKY,
 
@@ -503,25 +503,25 @@ static const NWidgetPart _nested_town_ga
 
	NWidget(WWT_PANEL, COLOUR_BROWN, TVW_INFOPANEL), SetMinimalSize(260, 32), SetResize(0, 1), SetFill(true, false), EndContainer(),
 
	NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TVW_CENTERVIEW), SetMinimalSize(80, 12), SetFill(true, true), SetDataTip(STR_BUTTON_LOCATION, STR_TOWN_VIEW_CENTER_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TVW_SHOWAUTHORITY), SetMinimalSize(80, 12), SetFill(true, true), SetDataTip(STR_TOWN_VIEW_LOCAL_AUTHORITY_BUTTON, STR_TOWN_VIEW_LOCAL_AUTHORITY_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TVW_CHANGENAME), SetMinimalSize(80, 12), SetFill(true, true), SetDataTip(STR_BUTTON_RENAME, STR_TOWN_VIEW_RENAME_TOOLTIP),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _town_game_view_desc(
 
	WDP_AUTO, WDP_AUTO, 260, TownViewWindow::TVW_HEIGHT_NORMAL, 260, TownViewWindow::TVW_HEIGHT_NORMAL,
 
	WC_TOWN_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	NULL, _nested_town_game_view_widgets, lengthof(_nested_town_game_view_widgets)
 
	_nested_town_game_view_widgets, lengthof(_nested_town_game_view_widgets)
 
);
 

	
 
static const NWidgetPart _nested_town_editor_view_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN, TVW_CLOSEBOX),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN, TVW_CAPTION), SetDataTip(STR_TOWN_VIEW_TOWN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TVW_CHANGENAME), SetMinimalSize(76, 14), SetDataTip(STR_BUTTON_RENAME, STR_TOWN_VIEW_RENAME_TOOLTIP),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN, TVW_STICKY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_BROWN, TVW_VIEWPORTPANEL),
 
		NWidget(WWT_INSET, COLOUR_BROWN, TVW_VIEWPORTINSET), SetPadding(2, 2, 2, 2),
 
			NWidget(NWID_VIEWPORT, INVALID_COLOUR, TVW_VIEWPORT), SetMinimalSize(254, 86), SetFill(true, false), SetPadding(1, 1, 1, 1),
 
@@ -530,25 +530,25 @@ static const NWidgetPart _nested_town_ed
 
	NWidget(WWT_PANEL, COLOUR_BROWN, TVW_INFOPANEL), SetMinimalSize(260, 32), SetResize(0, 1), SetFill(true, false), EndContainer(),
 
	NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TVW_CENTERVIEW), SetMinimalSize(80, 12), SetFill(true, true), SetDataTip(STR_BUTTON_LOCATION, STR_TOWN_VIEW_CENTER_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TVW_EXPAND), SetMinimalSize(80, 12), SetFill(true, true), SetDataTip(STR_TOWN_VIEW_EXPAND_BUTTON, STR_TOWN_VIEW_EXPAND_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TVW_DELETE), SetMinimalSize(80, 12), SetFill(true, true), SetDataTip(STR_TOWN_VIEW_DELETE_BUTTON, STR_TOWN_VIEW_DELETE_TOOLTIP),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _town_editor_view_desc(
 
	WDP_AUTO, WDP_AUTO, 260, TownViewWindow::TVW_HEIGHT_NORMAL, 260, TownViewWindow::TVW_HEIGHT_NORMAL,
 
	WC_TOWN_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	NULL, _nested_town_editor_view_widgets, lengthof(_nested_town_editor_view_widgets)
 
	_nested_town_editor_view_widgets, lengthof(_nested_town_editor_view_widgets)
 
);
 

	
 
void ShowTownViewWindow(TownID town)
 
{
 
	if (_game_mode == GM_EDITOR) {
 
		AllocateWindowDescFront<TownViewWindow>(&_town_editor_view_desc, town);
 
	} else {
 
		AllocateWindowDescFront<TownViewWindow>(&_town_game_view_desc, town);
 
	}
 
}
 

	
 
/** Widget numbers of town directory window. */
 
@@ -821,25 +821,25 @@ Listing TownDirectoryWindow::last_sortin
 
const Town *TownDirectoryWindow::last_town = NULL;
 

	
 
/* Available town directory sorting functions */
 
GUITownList::SortFunction * const TownDirectoryWindow::sorter_funcs[] = {
 
	&TownNameSorter,
 
	&TownPopulationSorter,
 
};
 

	
 
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,
 
	NULL, _nested_town_directory_widgets, lengthof(_nested_town_directory_widgets)
 
	_nested_town_directory_widgets, lengthof(_nested_town_directory_widgets)
 
);
 

	
 
void ShowTownDirectory()
 
{
 
	if (BringWindowToFrontById(WC_TOWN_DIRECTORY, 0)) return;
 
	new TownDirectoryWindow(&_town_directory_desc);
 
}
 

	
 
void CcFoundTown(bool success, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (success) {
 
		SndPlayTileFx(SND_1F_SPLAT, tile);
 
@@ -1097,20 +1097,20 @@ public:
 

	
 
	virtual void OnPlaceObjectAbort()
 
	{
 
		this->RaiseButtons();
 
		this->UpdateButtons();
 
	}
 
};
 

	
 
static const WindowDesc _found_town_desc(
 
	WDP_AUTO, WDP_AUTO, 160, 162, 160, 162,
 
	WC_FOUND_TOWN, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_CONSTRUCTION,
 
	NULL, _nested_found_town_widgets, lengthof(_nested_found_town_widgets)
 
	_nested_found_town_widgets, lengthof(_nested_found_town_widgets)
 
);
 

	
 
void ShowFoundTownWindow()
 
{
 
	if (_game_mode != GM_EDITOR && !Company::IsValidID(_local_company)) return;
 
	AllocateWindowDescFront<FoundTownWindow>(&_found_town_desc, 0);
 
}
src/transparency_gui.cpp
Show inline comments
 
@@ -146,19 +146,19 @@ static const NWidgetPart _nested_transpa
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, TTW_WIDGET_CATENARY), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_BUILD_X_ELRAIL, STR_TRANSPARENT_CATENARY_TOOLTIP),
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, TTW_WIDGET_LOADING), SetMinimalSize(22, 22), SetFill(false, true), SetDataTip(SPR_IMG_TRAINLIST, STR_TRANSPARENT_LOADING_TOOLTIP),
 
	EndContainer(),
 
	/* Panel with 'inivisibility' buttons. */
 
	NWidget(WWT_PANEL, COLOUR_DARK_GREEN, TTW_WIDGET_END), SetMinimalSize(219, 13), SetDataTip(0x0, STR_TRANSPARENT_INVISIBLE_TOOLTIP),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _transparency_desc(
 
	WDP_ALIGN_TBR, 94, 219, 49, 219, 49,
 
	WC_TRANSPARENCY_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	NULL, _nested_transparency_widgets, lengthof(_nested_transparency_widgets)
 
	_nested_transparency_widgets, lengthof(_nested_transparency_widgets)
 
);
 

	
 
void ShowTransparencyToolbar()
 
{
 
	AllocateWindowDescFront<TransparenciesWindow>(&_transparency_desc, 0);
 
}
src/tree_gui.cpp
Show inline comments
 
@@ -222,20 +222,20 @@ static const NWidgetPart _nested_build_t
 
				NWidget(WWT_TEXTBTN, COLOUR_GREY, BTW_MANY_RANDOM), SetMinimalSize(139, 12), SetDataTip(STR_TREES_RANDOM_TREES_BUTTON, STR_TREES_RANDOM_TREES_TOOLTIP),
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 2),
 
			EndContainer(),
 
			NWidget(NWID_SPACER), SetMinimalSize(2, 0),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_build_trees_widgets, lengthof(_nested_build_trees_widgets)
 
	_nested_build_trees_widgets, lengthof(_nested_build_trees_widgets)
 
);
 

	
 
void ShowBuildTreesToolbar()
 
{
 
	if (_game_mode != GM_EDITOR && !Company::IsValidID(_local_company)) return;
 
	AllocateWindowDescFront<BuildTreesWindow>(&_build_trees_desc, 0);
 
}
src/vehicle_gui.cpp
Show inline comments
 
@@ -424,25 +424,25 @@ static const NWidgetPart _nested_vehicle
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, VRW_INFOPANEL), SetMinimalSize(240, 22), EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, VRW_REFITBUTTON), SetMinimalSize(228, 12),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, VRW_RESIZEBOX),
 
	EndContainer(),
 
};
 

	
 
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 | WDF_CONSTRUCTION,
 
	NULL, _nested_vehicle_refit_widgets, lengthof(_nested_vehicle_refit_widgets)
 
	_nested_vehicle_refit_widgets, lengthof(_nested_vehicle_refit_widgets)
 
);
 

	
 
/** Show the refit window for a vehicle
 
 * @param *v The vehicle to show the refit window for
 
 * @param order of the vehicle ( ? )
 
 * @param parent the parent window of the refit window
 
 */
 
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent)
 
{
 
	DeleteWindowById(WC_VEHICLE_REFIT, v->index);
 
	RefitWindow *w = new RefitWindow(&_vehicle_refit_desc, v, order);
 
	w->parent = parent;
 
@@ -1135,25 +1135,25 @@ public:
 
		if (data == 0) {
 
			this->vehicles.ForceRebuild();
 
		} else {
 
			this->vehicles.ForceResort();
 
		}
 
	}
 
};
 

	
 
static WindowDesc _vehicle_list_desc(
 
	WDP_AUTO, WDP_AUTO, 260, 194, 260, 246,
 
	WC_INVALID, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_vehicle_list, lengthof(_nested_vehicle_list)
 
	_nested_vehicle_list, lengthof(_nested_vehicle_list)
 
);
 

	
 
static void ShowVehicleListWindowLocal(CompanyID company, uint16 VLW_flag, VehicleType vehicle_type, uint16 unique_number)
 
{
 
	if (!Company::IsValidID(company)) return;
 

	
 
	_vehicle_list_desc.cls = GetWindowClassForVehicleType(vehicle_type);
 
	WindowNumber num = (unique_number << 16) | (vehicle_type << 11) | VLW_flag | company;
 
	AllocateWindowDescFront<VehicleListWindow>(&_vehicle_list_desc, num);
 
}
 

	
 
void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type)
 
@@ -1546,33 +1546,33 @@ struct VehicleDetailsWindow : Window {
 
		if (nwi != NULL) {
 
			this->vscroll.SetCapacity(nwi->current_y / this->resize.step_height);
 
			nwi->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
 
		}
 
	}
 
};
 

	
 
/** Vehicle details window descriptor. */
 
static const WindowDesc _train_vehicle_details_desc(
 
	WDP_AUTO, WDP_AUTO, 405, 113, 405, 178,
 
	WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_train_vehicle_details_widgets, lengthof(_nested_train_vehicle_details_widgets)
 
	_nested_train_vehicle_details_widgets, lengthof(_nested_train_vehicle_details_widgets)
 
);
 

	
 
/** Vehicle details window descriptor for other vehicles than a train. */
 
static const WindowDesc _nontrain_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_STICKY_BUTTON | WDF_RESIZABLE,
 
	NULL, _nested_nontrain_vehicle_details_widgets, lengthof(_nested_nontrain_vehicle_details_widgets)
 
	_nested_nontrain_vehicle_details_widgets, lengthof(_nested_nontrain_vehicle_details_widgets)
 
);
 

	
 
/** Shows the vehicle details window of the given vehicle. */
 
static void ShowVehicleDetailsWindow(const Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_ORDERS, v->index, false);
 
	DeleteWindowById(WC_VEHICLE_TIMETABLE, v->index, false);
 
	AllocateWindowDescFront<VehicleDetailsWindow>((v->type == VEH_TRAIN) ? &_train_vehicle_details_desc : &_nontrain_vehicle_details_desc, v->index);
 
}
 

	
 

	
 
/* Unified vehicle GUI - Vehicle View Window */
 
@@ -1611,35 +1611,35 @@ static const NWidgetPart _nested_vehicle
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHBTN, COLOUR_GREY, VVW_WIDGET_START_STOP_VEH), SetMinimalSize(0, 12), SetResize(1, 0), SetFill(true, false),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, VVW_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
/** 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,
 
	NULL, _nested_vehicle_view_widgets, lengthof(_nested_vehicle_view_widgets)
 
	_nested_vehicle_view_widgets, lengthof(_nested_vehicle_view_widgets)
 
);
 

	
 
/** 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,
 
	NULL, _nested_vehicle_view_widgets, lengthof(_nested_vehicle_view_widgets)
 
	_nested_vehicle_view_widgets, lengthof(_nested_vehicle_view_widgets)
 
);
 

	
 

	
 
/* 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);
 
assert_compile(VEH_ROAD == 1);
 
assert_compile(VEH_SHIP == 2);
 
assert_compile(VEH_AIRCRAFT == 3);
 

	
 
/** Zoom levels for vehicle views indexed by vehicle type. */
 
static const ZoomLevel _vehicle_view_zoom_levels[] = {
src/viewport_gui.cpp
Show inline comments
 
@@ -159,24 +159,24 @@ public:
 

	
 
	virtual void OnInvalidateData(int data = 0)
 
	{
 
		/* Only handle zoom message if intended for us (msg ZOOM_IN/ZOOM_OUT) */
 
		HandleZoomMessage(this, this->viewport, EVW_ZOOMIN, EVW_ZOOMOUT);
 
	}
 
};
 

	
 
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,
 
	NULL, _nested_extra_view_port_widgets, lengthof(_nested_extra_view_port_widgets)
 
	_nested_extra_view_port_widgets, lengthof(_nested_extra_view_port_widgets)
 
);
 

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

	
 
	/* find next free window number for extra viewport */
 
	while (FindWindowById(WC_EXTRA_VIEW_PORT, i) != NULL) i++;
 

	
 
	new ExtraViewportWindow(&_extra_view_port_desc, i, tile);
 
}
src/waypoint_gui.cpp
Show inline comments
 
@@ -136,19 +136,19 @@ static const NWidgetPart _nested_waypoin
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WAYPVW_CENTERVIEW), SetMinimalSize(100, 12), SetFill(true, false), SetDataTip(STR_BUTTON_LOCATION, STR_BUOY_VIEW_CENTER_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WAYPVW_RENAME), SetMinimalSize(100, 12), SetFill(true, false), SetDataTip(STR_BUTTON_RENAME, STR_BUOY_VIEW_CHANGE_BUOY_NAME),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WAYPVW_SHOW_VEHICLES), SetMinimalSize(15, 12), SetDataTip(STR_SHIP, STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _waypoint_view_desc(
 
	WDP_AUTO, WDP_AUTO, 260, 118, 260, 118,
 
	WC_WAYPOINT_VIEW, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
 
	NULL, _nested_waypoint_view_widgets, lengthof(_nested_waypoint_view_widgets)
 
	_nested_waypoint_view_widgets, lengthof(_nested_waypoint_view_widgets)
 
);
 

	
 
void ShowWaypointWindow(const Waypoint *wp)
 
{
 
	AllocateWindowDescFront<WaypointWindow>(&_waypoint_view_desc, wp->index);
 
}
src/widgets/dropdown.cpp
Show inline comments
 
@@ -77,25 +77,25 @@ enum DropdownMenuWidgets {
 

	
 
static const NWidgetPart _nested_dropdown_menu_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_END, DDM_ITEMS), SetMinimalSize(1, 1), EndContainer(),
 
		NWidget(WWT_SCROLLBAR, COLOUR_END, DDM_SCROLL),
 
	EndContainer(),
 
};
 

	
 
const WindowDesc _dropdown_desc(
 
	0, 0, 0, 0, 0, 0, // x/y position not used.
 
	WC_DROPDOWN_MENU, WC_NONE,
 
	WDF_DEF_WIDGET,
 
	NULL, _nested_dropdown_menu_widgets, lengthof(_nested_dropdown_menu_widgets)
 
	_nested_dropdown_menu_widgets, lengthof(_nested_dropdown_menu_widgets)
 
);
 

	
 
/** Drop-down menu window */
 
struct DropdownWindow : Window {
 
	WindowClass parent_wnd_class; ///< Parent window class.
 
	WindowNumber parent_wnd_num;  ///< Parent window number.
 
	byte parent_button;           ///< Parent widget number where the window is dropped from.
 
	DropDownList *list;           ///< List with dropdown menu items.
 
	int selected_index;           ///< Index of the selected item in the list.
 
	byte click_delay;             ///< Timer to delay selection.
 
	bool drag_mode;
 
	bool instant_close;           ///< Close the window when the mouse button is raised.
src/window.cpp
Show inline comments
 
@@ -51,49 +51,48 @@ Point _cursorpos_drag_start;
 

	
 
int _scrollbar_start_pos;
 
int _scrollbar_size;
 
byte _scroller_click_timeout;
 

	
 
bool _scrolling_scrollbar;
 
bool _scrolling_viewport;
 

	
 
byte _special_mouse_mode;
 

	
 
/** Window description constructor. */
 
WindowDesc::WindowDesc(int16 left, int16 top, int16 min_width, int16 min_height, int16 def_width, int16 def_height,
 
			WindowClass window_class, WindowClass parent_class, uint32 flags, const Widget *widgets,
 
			WindowClass window_class, WindowClass parent_class, uint32 flags,
 
			const NWidgetPart *nwid_parts, int16 nwid_length)
 
{
 
	this->left = left;
 
	this->top = top;
 
	this->minimum_width = min_width;
 
	this->minimum_height = min_height;
 
	this->default_width = def_width;
 
	this->default_height = def_height;
 
	this->cls = window_class;
 
	this->parent_cls = parent_class;
 
	this->flags = flags;
 
	this->widgets = widgets;
 
	this->nwid_parts = nwid_parts;
 
	this->nwid_length = nwid_length;
 
	this->new_widgets = NULL;
 
}
 

	
 
/** Get widget array of the window description. */
 
const Widget *WindowDesc::GetWidgets() const
 
{
 
	if (this->nwid_parts != NULL) {
 
		InitializeWidgetArrayFromNestedWidgets(this->nwid_parts, this->nwid_length, this->widgets, &this->new_widgets);
 
		InitializeWidgetArrayFromNestedWidgets(this->nwid_parts, this->nwid_length, NULL, &this->new_widgets);
 
	}
 
	const Widget *wids = (this->new_widgets != NULL) ? this->new_widgets : this->widgets;
 
	const Widget *wids = this->new_widgets;
 
	assert(wids != NULL);
 
	return wids;
 
}
 

	
 
WindowDesc::~WindowDesc()
 
{
 
	free(this->new_widgets);
 
}
 

	
 
/**
 
 * Set the window that has the focus
 
 * @param w The window to set the focus on
src/window_gui.h
Show inline comments
 
@@ -118,39 +118,38 @@ void DrawFrameRect(int left, int top, in
 

	
 
/* window.cpp */
 
extern Window *_z_front_window;
 
extern Window *_z_back_window;
 
extern Window *_focused_window;
 

	
 
/**
 
 * High level window description
 
 */
 
struct WindowDesc : ZeroedMemoryAllocator {
 

	
 
	WindowDesc(int16 left, int16 top, int16 min_width, int16 min_height, int16 def_width, int16 def_height,
 
			WindowClass window_class, WindowClass parent_class, uint32 flags, const Widget *widgets,
 
			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()
 
	int16 minimum_width;           ///< Minimal width of the window.
 
	int16 minimum_height;          ///< Minimal height of the window.
 
	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.
 
	const NWidgetPart *nwid_parts; ///< Nested widget parts describing the window.
 
	int16 nwid_length;             ///< Length of the #nwid_parts array.
 
	mutable Widget *new_widgets;   ///< Widgets generated from #nwid_parts.
 

	
 
	const Widget *GetWidgets() const;
 
};
 

	
 
/**
 
 * Window default widget/window handling flags
 
 */
 
enum WindowDefaultFlag {
 
	WDF_STD_TOOLTIPS    =   1 << 0, ///< use standard routine when displaying tooltips
0 comments (0 inline, 0 general)