Changeset - r14035:4f06488d5a62
[Not reviewed]
master
0 22 0
alberth - 15 years ago 2009-12-21 16:24:29
alberth@openttd.org
(svn r18588) -Feature [FS#2943]: Add shading and unshading of windows.
22 files changed with 125 insertions and 72 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_gui.cpp
Show inline comments
 
@@ -746,12 +746,14 @@ struct AIDebugWindow : public Window {
 
		/* Update "Reload AI" button */
 
		this->SetWidgetDisabledState(AID_WIDGET_RELOAD_TOGGLE, ai_debug_company == INVALID_COMPANY);
 

	
 
		/* Draw standard stuff */
 
		this->DrawWidgets();
 

	
 
		if (this->IsShaded()) return; // Don't draw anything when the window is shaded.
 

	
 
		/* If there are no active companies, don't display anything else. */
 
		if (ai_debug_company == INVALID_COMPANY) return;
 

	
 
		/* Paint the company icons */
 
		for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) {
 
			NWidgetCore *button = this->GetWidget<NWidgetCore>(i + AID_WIDGET_COMPANY_BUTTON_START);
 
@@ -915,12 +917,13 @@ const int AIDebugWindow::bottom_offset =
 
CompanyID AIDebugWindow::ai_debug_company = INVALID_COMPANY;
 

	
 
static const NWidgetPart _nested_ai_debug_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_AI_DEBUG, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_VIEW),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(NWID_SPACER), SetMinimalSize(2, 0),
 
			NWidget(WWT_PANEL, COLOUR_GREY, AID_WIDGET_COMPANY_BUTTON_START), SetMinimalSize(37, 13), SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP),
src/autoreplace_gui.cpp
Show inline comments
 
@@ -389,13 +389,13 @@ public:
 
				NWidgetBase *nwi = this->GetWidget<NWidgetBase>(side == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS);
 
				int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
 
						nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side]);
 
				needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
 
			}
 
		}
 
		if (needed_height != this->details_height) { // Details window are not high enough, enlarge them.
 
		if (!this->IsShaded() && needed_height != this->details_height) { // Details window are not high enough, enlarge them.
 
			this->details_height = needed_height;
 
			this->ReInit();
 
			return;
 
		}
 
	}
 

	
 
@@ -498,12 +498,13 @@ public:
 
};
 

	
 
static const NWidgetPart _nested_replace_rail_vehicle_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, RVW_WIDGET_CAPTION), SetDataTip(STR_REPLACE_VEHICLES_WHITE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
		NWidget(WWT_MATRIX, COLOUR_GREY, RVW_WIDGET_LEFT_MATRIX), SetMinimalSize(216, 0), SetFill(1, 1), 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), SetFill(1, 1), SetDataTip(0x1, STR_REPLACE_HELP_RIGHT_ARRAY), SetResize(1, 1),
 
@@ -537,12 +538,13 @@ static const WindowDesc _replace_rail_ve
 
);
 

	
 
static const NWidgetPart _nested_replace_vehicle_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, RVW_WIDGET_CAPTION), SetMinimalSize(433, 14), SetDataTip(STR_REPLACE_VEHICLES_WHITE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
		NWidget(WWT_MATRIX, COLOUR_GREY, RVW_WIDGET_LEFT_MATRIX), SetMinimalSize(216, 0), SetFill(1, 1), 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), SetFill(1, 1), SetDataTip(0x1, STR_REPLACE_HELP_RIGHT_ARRAY), SetResize(1, 1),
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -60,12 +60,13 @@ enum BuildVehicleWidgets {
 
};
 

	
 
static const NWidgetPart _nested_build_vehicle_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, BUILD_VEHICLE_WIDGET_CAPTION), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER), SetFill(1, 0),
 
@@ -1125,13 +1126,13 @@ struct BuildVehicleWindow : Window {
 
				NWidgetBase *nwi = this->GetWidget<NWidgetBase>(BUILD_VEHICLE_WIDGET_PANEL);
 
				int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
 
						nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine);
 
				needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
 
			}
 
		}
 
		if (needed_height != this->details_height) { // Details window are not high enough, enlarge them.
 
		if (!this->IsShaded() && needed_height != this->details_height) { // Details window are not high enough, enlarge them.
 
			this->details_height = needed_height;
 
			this->ReInit();
 
			return;
 
		}
 
	}
 

	
src/cheat_gui.cpp
Show inline comments
 
@@ -137,12 +137,14 @@ enum CheatWidgets {
 
};
 

	
 
static const NWidgetPart _nested_cheat_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CHEATS, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, CW_PANEL), SetDataTip(0x0, STR_CHEATS_TOOLTIP), EndContainer(),
 
};
 

	
 
struct CheatWindow : Window {
 
	int clicked;
src/company_gui.cpp
Show inline comments
 
@@ -227,12 +227,13 @@ static void DrawYearColumn(const Rect &r
 

	
 
static const NWidgetPart _nested_company_finances_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, CFW_CAPTION), SetDataTip(STR_FINANCES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_IMGBTN, COLOUR_GREY, CFW_TOGGLE_SIZE), SetDataTip(SPR_LARGE_SMALL_WINDOW, STR_TOOLTIP_TOGGLE_LARGE_SMALL_WINDOW),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_SELECTION, INVALID_COLOUR, CFW_SEL_PANEL),
 
		NWidget(WWT_PANEL, COLOUR_GREY),
 
			NWidget(NWID_HORIZONTAL), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT), SetPIP(0, 9, 0),
 
				NWidget(WWT_EMPTY, COLOUR_GREY, CFW_EXPS_CATEGORY), SetMinimalSize(120, 0), SetFill(0, 0),
 
@@ -399,35 +400,37 @@ struct CompanyFinancesWindow : Window {
 
		plane = (company != _local_company) ? STACKED_SELECTION_ZERO_SIZE : 0;
 
		this->GetWidget<NWidgetStacked>(CFW_SEL_BUTTONS)->SetDisplayedPlane(plane);
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		if (!small) {
 
			/* Check that the expenses panel height matches the height needed for the layout. */
 
			int type = _settings_client.gui.expenses_layout;
 
			if (_expenses_list_types[type].GetHeight() != this->GetWidget<NWidgetBase>(CFW_EXPS_CATEGORY)->current_y) {
 
		if (!this->IsShaded()) {
 
			if (!small) {
 
				/* Check that the expenses panel height matches the height needed for the layout. */
 
				int type = _settings_client.gui.expenses_layout;
 
				if (_expenses_list_types[type].GetHeight() != this->GetWidget<NWidgetBase>(CFW_EXPS_CATEGORY)->current_y) {
 
					this->SetupWidgets();
 
					this->ReInit();
 
					return;
 
				}
 
			}
 

	
 
			/* Check that the loan buttons are shown only when the user owns the company. */
 
			CompanyID company = (CompanyID)this->window_number;
 
			int req_plane = (company != _local_company) ? STACKED_SELECTION_ZERO_SIZE : 0;
 
			if (req_plane != this->GetWidget<NWidgetStacked>(CFW_SEL_BUTTONS)->shown_plane) {
 
				this->SetupWidgets();
 
				this->ReInit();
 
				return;
 
			}
 

	
 
			const Company *c = Company::Get(company);
 
			this->SetWidgetDisabledState(CFW_INCREASE_LOAN, c->current_loan == _economy.max_loan); // Borrow button only shows when there is any more money to loan.
 
			this->SetWidgetDisabledState(CFW_REPAY_LOAN, company != _local_company || c->current_loan == 0); // Repay button only shows when there is any more money to repay.
 
		}
 

	
 
		/* Check that the loan buttons are shown only when the user owns the company. */
 
		CompanyID company = (CompanyID)this->window_number;
 
		int req_plane = (company != _local_company) ? STACKED_SELECTION_ZERO_SIZE : 0;
 
		if (req_plane != this->GetWidget<NWidgetStacked>(CFW_SEL_BUTTONS)->shown_plane) {
 
			this->SetupWidgets();
 
			this->ReInit();
 
			return;
 
		}
 

	
 
		const Company *c = Company::Get(company);
 
		this->SetWidgetDisabledState(CFW_INCREASE_LOAN, c->current_loan == _economy.max_loan); // Borrow button only shows when there is any more money to loan.
 
		this->SetWidgetDisabledState(CFW_REPAY_LOAN, company != _local_company || c->current_loan == 0); // Repay button only shows when there is any more money to repay.
 

	
 
		this->DrawWidgets();
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
		switch (widget) {
 
@@ -1587,12 +1590,13 @@ enum CompanyWindowWidgets {
 
};
 

	
 
static const NWidgetPart _nested_company_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, CW_WIDGET_CAPTION), SetDataTip(STR_COMPANY_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY),
 
		NWidget(NWID_HORIZONTAL), SetPIP(4, 6, 4),
 
			NWidget(NWID_VERTICAL), SetPIP(4, 2, 4),
 
				NWidget(WWT_EMPTY, INVALID_COLOUR, CW_WIDGET_FACE), SetMinimalSize(91, 120), SetFill(1, 0),
 
@@ -1710,51 +1714,53 @@ struct CompanyWindow : Window
 

	
 
	virtual void OnPaint()
 
	{
 
		const Company *c = Company::Get((CompanyID)this->window_number);
 
		bool local = this->window_number == _local_company;
 

	
 
		/* Button bar selection. */
 
		int plane = local ? CWP_BUTTONS_LOCAL : CWP_BUTTONS_OTHER;
 
		NWidgetStacked *wi = this->GetWidget<NWidgetStacked>(CW_WIDGET_SELECT_BUTTONS);
 
		if (plane != wi->shown_plane) {
 
			wi->SetDisplayedPlane(plane);
 
			this->SetDirty();
 
			return;
 
		}
 
		if (!this->IsShaded()) {
 
			/* Button bar selection. */
 
			int plane = local ? CWP_BUTTONS_LOCAL : CWP_BUTTONS_OTHER;
 
			NWidgetStacked *wi = this->GetWidget<NWidgetStacked>(CW_WIDGET_SELECT_BUTTONS);
 
			if (plane != wi->shown_plane) {
 
				wi->SetDisplayedPlane(plane);
 
				this->SetDirty();
 
				return;
 
			}
 

	
 
		/* Build HQ button handling. */
 
		plane = (local && c->location_of_HQ == INVALID_TILE) ? CWP_VB_BUILD : CWP_VB_VIEW;
 
		wi = this->GetWidget<NWidgetStacked>(CW_WIDGET_SELECT_VIEW_BUILD_HQ);
 
		if (plane != wi->shown_plane) {
 
			wi->SetDisplayedPlane(plane);
 
			this->SetDirty();
 
			return;
 
		}
 
			/* Build HQ button handling. */
 
			plane = (local && c->location_of_HQ == INVALID_TILE) ? CWP_VB_BUILD : CWP_VB_VIEW;
 
			wi = this->GetWidget<NWidgetStacked>(CW_WIDGET_SELECT_VIEW_BUILD_HQ);
 
			if (plane != wi->shown_plane) {
 
				wi->SetDisplayedPlane(plane);
 
				this->SetDirty();
 
				return;
 
			}
 

	
 
		this->SetWidgetDisabledState(CW_WIDGET_VIEW_HQ, c->location_of_HQ == INVALID_TILE);
 
			this->SetWidgetDisabledState(CW_WIDGET_VIEW_HQ, c->location_of_HQ == INVALID_TILE);
 

	
 
		/* Enable/disable 'Relocate HQ' button. */
 
		plane = (!local || c->location_of_HQ == INVALID_TILE) ? CWP_RELOCATE_HIDE : CWP_RELOCATE_SHOW;
 
		wi = this->GetWidget<NWidgetStacked>(CW_WIDGET_SELECT_RELOCATE);
 
		if (plane != wi->shown_plane) {
 
			wi->SetDisplayedPlane(plane);
 
			this->SetDirty();
 
			return;
 
			/* Enable/disable 'Relocate HQ' button. */
 
			plane = (!local || c->location_of_HQ == INVALID_TILE) ? CWP_RELOCATE_HIDE : CWP_RELOCATE_SHOW;
 
			wi = this->GetWidget<NWidgetStacked>(CW_WIDGET_SELECT_RELOCATE);
 
			if (plane != wi->shown_plane) {
 
				wi->SetDisplayedPlane(plane);
 
				this->SetDirty();
 
				return;
 
			}
 

	
 
			/* Multiplayer buttons. */
 
			plane = ((!_networking) ? CWP_MP_EMPTY : (local ? CWP_MP_C_PWD : CWP_MP_C_JOIN));
 
			wi = this->GetWidget<NWidgetStacked>(CW_WIDGET_SELECT_MULTIPLAYER);
 
			if (plane != wi->shown_plane) {
 
				wi->SetDisplayedPlane(plane);
 
				this->SetDirty();
 
				return;
 
			}
 
			this->SetWidgetDisabledState(CW_WIDGET_COMPANY_JOIN,   c->is_ai);
 
		}
 

	
 
		/* Multiplayer buttons. */
 
		plane = ((!_networking) ? CWP_MP_EMPTY : (local ? CWP_MP_C_PWD : CWP_MP_C_JOIN));
 
		wi = this->GetWidget<NWidgetStacked>(CW_WIDGET_SELECT_MULTIPLAYER);
 
		if (plane != wi->shown_plane) {
 
			wi->SetDisplayedPlane(plane);
 
			this->SetDirty();
 
			return;
 
		}
 
		this->SetWidgetDisabledState(CW_WIDGET_COMPANY_JOIN,   c->is_ai);
 

	
 
		if (!local) {
 
			if (_settings_game.economy.allow_shares) { // Shares are allowed
 
				/* If all shares are owned by someone (none by nobody), disable buy button */
 
				this->SetWidgetDisabledState(CW_WIDGET_BUY_SHARE, GetAmountOwnedBy(c, INVALID_OWNER) == 0 ||
 
						/* Only 25% left to buy. If the company is human, disable buying it up.. TODO issues! */
 
						(GetAmountOwnedBy(c, INVALID_OWNER) == 1 && !c->is_ai) ||
src/depot_gui.cpp
Show inline comments
 
@@ -59,12 +59,13 @@ enum DepotWindowWidgets {
 

	
 
/** Nested widget definition for train depots. */
 
static const NWidgetPart _nested_train_depot_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, DEPOT_WIDGET_CAPTION),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_MATRIX, COLOUR_GREY, DEPOT_WIDGET_MATRIX), SetDataTip(0x0, STR_NULL), SetResize(1, 1),
 
			NWidget(WWT_HSCROLLBAR, COLOUR_GREY, DEPOT_WIDGET_H_SCROLL),
src/graph_gui.cpp
Show inline comments
 
@@ -125,12 +125,13 @@ static NWidgetBase *MakeNWidgetCompanyLi
 
}
 

	
 
static const NWidgetPart _nested_graph_legend_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_KEY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, GLW_BACKGROUND),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 2),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(NWID_SPACER), SetMinimalSize(2, 0),
 
@@ -596,12 +597,13 @@ struct OperatingProfitGraphWindow : Base
 

	
 
static const NWidgetPart _nested_operating_profit_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_OPERATING_PROFIT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BGW_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, BGW_BACKGROUND), SetMinimalSize(576, 160), EndContainer(),
 
};
 

	
 
static const WindowDesc _operating_profit_desc(
 
@@ -637,12 +639,13 @@ struct IncomeGraphWindow : BaseGraphWind
 

	
 
static const NWidgetPart _nested_income_graph_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_INCOME_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BGW_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, BGW_BACKGROUND), SetMinimalSize(576, 128), EndContainer(),
 
};
 

	
 

	
 
@@ -677,12 +680,13 @@ struct DeliveredCargoGraphWindow : BaseG
 

	
 
static const NWidgetPart _nested_delivered_cargo_graph_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_CARGO_DELIVERED_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BGW_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, BGW_BACKGROUND), SetMinimalSize(576, 128), EndContainer(),
 
};
 

	
 
static const WindowDesc _delivered_cargo_graph_desc(
 
@@ -730,12 +734,13 @@ struct PerformanceHistoryGraphWindow : B
 
static const NWidgetPart _nested_performance_history_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, PHW_DETAILED_PERFORMANCE), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_PERFORMANCE_DETAIL_KEY, STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, PHW_KEY), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, PHW_BACKGROUND), SetMinimalSize(576, 224), EndContainer(),
 
};
 

	
 
static const WindowDesc _performance_history_desc(
 
@@ -769,12 +774,13 @@ struct CompanyValueGraphWindow : BaseGra
 

	
 
static const NWidgetPart _nested_company_value_graph_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_COMPANY_VALUES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, BGW_KEY_BUTTON), SetMinimalSize(50, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_GRAPH_KEY_BUTTON, STR_GRAPH_KEY_TOOLTIP),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, BGW_BACKGROUND), SetMinimalSize(576, 224), EndContainer(),
 
};
 

	
 
static const WindowDesc _company_value_graph_desc(
 
@@ -919,12 +925,13 @@ static NWidgetBase *MakeCargoButtons(int
 

	
 

	
 
static const NWidgetPart _nested_cargo_payment_rates_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, CPW_BACKGROUND), SetMinimalSize(568, 128), SetResize(0, 1),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(NWID_HORIZONTAL),
 
				NWidget(NWID_SPACER), SetFill(1, 0),
 
@@ -1121,12 +1128,13 @@ public:
 
};
 

	
 
static const NWidgetPart _nested_company_league_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_COMPANY_LEAGUE_TABLE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, CLW_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM),
 
};
 

	
 
static const WindowDesc _company_league_desc(
 
@@ -1457,12 +1465,13 @@ static NWidgetBase *MakeCompanyButtonRow
 
}
 

	
 
static const NWidgetPart _nested_performance_rating_detail_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_PERFORMANCE_DETAIL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY),
 
		NWidgetFunction(MakeCompanyButtonRows), SetPadding(0, 1, 1, 2),
 
	EndContainer(),
 
	NWidgetFunction(MakePerformanceDetailPanels),
src/group_gui.cpp
Show inline comments
 
@@ -84,12 +84,13 @@ static void ShowGroupActionDropdown(Wind
 
}
 

	
 
static const NWidgetPart _nested_group_widgets[] = {
 
	NWidget(NWID_HORIZONTAL), // Window header
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, GRP_WIDGET_CAPTION),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		/* left part */
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_PANEL, COLOUR_GREY), SetMinimalTextLines(1, WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM), SetFill(1, 0), EndContainer(),
src/industry_gui.cpp
Show inline comments
 
@@ -104,12 +104,13 @@ enum DynamicPlaceIndustriesWidgets {
 
};
 

	
 
static const NWidgetPart _nested_build_industry_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_FUND_INDUSTRY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_MATRIX, COLOUR_DARK_GREEN, DPIW_MATRIX_WIDGET), SetDataTip(0x801, STR_FUND_INDUSTRY_SELECTION_TOOLTIP), SetFill(1, 0), SetResize(1, 1),
 
		NWidget(WWT_SCROLLBAR, COLOUR_DARK_GREEN, DPIW_SCROLLBAR),
 
	EndContainer(),
 
@@ -583,12 +584,14 @@ public:
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		this->DrawWidgets();
 

	
 
		if (this->IsShaded()) return; // Don't draw anything when the window is shaded.
 

	
 
		NWidgetBase *nwi = this->GetWidget<NWidgetBase>(IVW_INFO);
 
		uint expected = this->DrawInfo(nwi->pos_x, nwi->pos_x + nwi->current_x - 1, nwi->pos_y) - nwi->pos_y;
 
		if (expected > nwi->current_y - 1) {
 
			this->info_height = expected + 1;
 
			this->ReInit();
 
			return;
 
@@ -791,12 +794,13 @@ static void UpdateIndustryProduction(Ind
 

	
 
/** Widget definition of the view industy gui */
 
static const NWidgetPart _nested_industry_view_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_CREAM),
 
		NWidget(WWT_CAPTION, COLOUR_CREAM, IVW_CAPTION), SetDataTip(STR_INDUSTRY_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_CREAM),
 
		NWidget(WWT_STICKYBOX, COLOUR_CREAM),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_CREAM),
 
		NWidget(WWT_INSET, COLOUR_CREAM), SetPadding(2, 2, 2, 2),
 
			NWidget(NWID_VIEWPORT, INVALID_COLOUR, IVW_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 0), SetPadding(1, 1, 1, 1), SetResize(1, 1),
 
		EndContainer(),
 
@@ -833,12 +837,13 @@ enum IndustryDirectoryWidgets {
 

	
 
/** Widget definition of the industy directory gui */
 
static const NWidgetPart _nested_industry_directory_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_INDUSTRY_DIRECTORY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(NWID_HORIZONTAL),
 
				NWidget(WWT_TEXTBTN, COLOUR_BROWN, IDW_DROPDOWN_ORDER), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER),
src/news_gui.cpp
Show inline comments
 
@@ -1013,12 +1013,13 @@ const int MessageHistoryWindow::top_spac
 
const int MessageHistoryWindow::bottom_spacing = WD_FRAMERECT_BOTTOM;
 

	
 
static const NWidgetPart _nested_message_history[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_MESSAGE_HISTORY, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 

	
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_BROWN, MHW_BACKGROUND), SetMinimalSize(200, 125), SetDataTip(0x0, STR_MESSAGE_HISTORY_TOOLTIP), SetResize(1, 12),
 
		EndContainer(),
src/order_gui.cpp
Show inline comments
 
@@ -1309,12 +1309,13 @@ public:
 
/** Nested widget definition for "your" train orders. */
 
static const NWidgetPart _nested_orders_train_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		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_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	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(),
 
		NWidget(WWT_SCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR),
 
	EndContainer(),
 
@@ -1372,12 +1373,13 @@ static const WindowDesc _orders_train_de
 
/** Nested widget definition for "your" orders (non-train). */
 
static const NWidgetPart _nested_orders_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		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_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	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(),
 
		NWidget(WWT_SCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR),
 
	EndContainer(),
 
@@ -1432,25 +1434,24 @@ static const WindowDesc _orders_desc(
 
	0,
 
	_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),
 
			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),
 
		EndContainer(),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(WWT_PANEL, COLOUR_GREY, ORDER_WIDGET_ORDER_LIST), SetMinimalSize(372, 72), SetDataTip(0x0, STR_ORDERS_LIST_TOOLTIP), SetResize(1, 1), EndContainer(),
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_SCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR),
 
				NWidget(WWT_RESIZEBOX, COLOUR_GREY),
 
			EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		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_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_GREY, ORDER_WIDGET_ORDER_LIST), SetMinimalSize(372, 72), SetDataTip(0x0, STR_ORDERS_LIST_TOOLTIP), SetResize(1, 1), EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(WWT_SCROLLBAR, COLOUR_GREY, ORDER_WIDGET_SCROLLBAR),
 
			NWidget(WWT_RESIZEBOX, COLOUR_GREY),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _other_orders_desc(
 
	WDP_AUTO, 384, 86,
src/signs_gui.cpp
Show inline comments
 
@@ -197,12 +197,13 @@ struct SignListWindow : Window, SignList
 
};
 

	
 
static const NWidgetPart _nested_sign_list_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, SLW_CAPTION), SetDataTip(STR_SIGN_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_GREY, SLW_LIST), SetMinimalSize(WD_FRAMETEXT_LEFT + 16 + MAX_LENGTH_SIGN_NAME_PIXELS + WD_FRAMETEXT_RIGHT, 50),
 
							SetResize(1, 10), SetFill(1, 0), EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
@@ -320,13 +321,13 @@ struct SignWindow : QueryStringBaseWindo
 
		}
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		this->DrawWidgets();
 
		this->DrawEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
 
		if (!this->IsShaded()) this->DrawEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
		switch (widget) {
 
			case QUERY_EDIT_SIGN_WIDGET_PREVIOUS:
src/smallmap_gui.cpp
Show inline comments
 
@@ -1247,12 +1247,13 @@ static NWidgetBase *SmallMapDisplay(int 
 

	
 

	
 
static const NWidgetPart _nested_smallmap_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN, SM_WIDGET_CAPTION), SetDataTip(STR_SMALLMAP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 
	NWidgetFunction(SmallMapDisplay), // Smallmap display and legend bar + image buttons.
 
	/* Bottom button row and resize box. */
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_BROWN),
src/station_gui.cpp
Show inline comments
 
@@ -673,12 +673,13 @@ static NWidgetBase *CargoWidgets(int *bi
 
}
 

	
 
static const NWidgetPart _nested_company_stations_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, SLW_CAPTION), SetDataTip(STR_STATION_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, SLW_TRAIN), SetMinimalSize(14, 11), SetDataTip(STR_TRAIN, STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE), SetFill(0, 1),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, SLW_TRUCK), SetMinimalSize(14, 11), SetDataTip(STR_LORRY, STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE), SetFill(0, 1),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, SLW_BUS), SetMinimalSize(14, 11), SetDataTip(STR_BUS, STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE), SetFill(0, 1),
 
@@ -725,12 +726,13 @@ void ShowCompanyStations(CompanyID compa
 
}
 

	
 
static const NWidgetPart _nested_station_view_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, SVW_CAPTION), SetDataTip(STR_STATION_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_GREY, SVW_WAITING), SetMinimalSize(237, 52), SetResize(1, 10), EndContainer(),
 
		NWidget(WWT_SCROLLBAR, COLOUR_GREY, SVW_SCROLLBAR),
 
	EndContainer(),
 
@@ -852,15 +854,17 @@ struct StationViewWindow : public Window
 
		this->SetWidgetDisabledState(SVW_ROADVEHS, !(st->facilities & FACIL_TRUCK_STOP) && !(st->facilities & FACIL_BUS_STOP));
 
		this->SetWidgetDisabledState(SVW_PLANES,   !(st->facilities & FACIL_AIRPORT));
 
		this->SetWidgetDisabledState(SVW_SHIPS,    !(st->facilities & FACIL_DOCK));
 

	
 
		this->DrawWidgets();
 

	
 
		NWidgetBase *nwi = this->GetWidget<NWidgetBase>(SVW_WAITING);
 
		Rect waiting_rect = {nwi->pos_x, nwi->pos_y, nwi->pos_x + nwi->current_x - 1, nwi->pos_y + nwi->current_y - 1};
 
		this->DrawWaitingCargo(waiting_rect, cargolist, transfers);
 
		if (!this->IsShaded()) {
 
			NWidgetBase *nwi = this->GetWidget<NWidgetBase>(SVW_WAITING);
 
			Rect waiting_rect = {nwi->pos_x, nwi->pos_y, nwi->pos_x + nwi->current_x - 1, nwi->pos_y + nwi->current_y - 1};
 
			this->DrawWaitingCargo(waiting_rect, cargolist, transfers);
 
		}
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		if (widget != SVW_ACCEPTLIST) return;
 

	
src/subsidy_gui.cpp
Show inline comments
 
@@ -227,12 +227,13 @@ struct SubsidyListWindow : Window {
 
};
 

	
 
static const NWidgetPart _nested_subsidies_list_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_SUBSIDIES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		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),
src/terraform_gui.cpp
Show inline comments
 
@@ -513,12 +513,13 @@ enum EditorTerraformToolbarWidgets {
 
};
 

	
 
static const NWidgetPart _nested_scen_edit_land_gen_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
 
		NWidget(NWID_HORIZONTAL), SetPadding(2, 2, 7, 2),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
			NWidget(WWT_IMGBTN, COLOUR_GREY, ETTW_DEMOLISH), SetMinimalSize(22, 22),
src/timetable_gui.cpp
Show inline comments
 
@@ -600,12 +600,13 @@ struct TimetableWindow : Window {
 

	
 
static const NWidgetPart _nested_timetable_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, TTV_CAPTION), SetDataTip(STR_TIMETABLE_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, TTV_ORDER_VIEW), SetMinimalSize(61, 14), SetDataTip( STR_TIMETABLE_ORDER_VIEW, STR_TIMETABLE_ORDER_VIEW_TOOLTIP),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_GREY, TTV_TIMETABLE_PANEL), SetMinimalSize(388, 82), SetResize(1, 10), SetDataTip(STR_NULL, STR_TIMETABLE_TOOLTIP), EndContainer(),
 
		NWidget(WWT_SCROLLBAR, COLOUR_GREY, TTV_FAKE_SCROLLBAR), SetMinimalSize(0, 0), // Hack so the timetable panel can 'use' the scrollbar too
 
		NWidget(NWID_SELECTION, INVALID_COLOUR, TTV_ARRIVAL_DEPARTURE_SELECTION),
src/town_gui.cpp
Show inline comments
 
@@ -50,12 +50,13 @@ enum TownAuthorityWidgets {
 
};
 

	
 
static const NWidgetPart _nested_town_authority_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN, TWA_CAPTION), SetDataTip(STR_LOCAL_AUTHORITY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_BROWN, TWA_RATING_INFO), SetMinimalSize(317, 92), SetResize(1, 1), EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_BROWN, TWA_COMMAND_LIST), SetMinimalSize(305, 52), SetResize(1, 0), SetDataTip(0x0, STR_LOCAL_AUTHORITY_ACTIONS_TOOLTIP), EndContainer(),
 
		NWidget(WWT_SCROLLBAR, COLOUR_BROWN, TWA_SCROLLBAR),
 
@@ -113,13 +114,13 @@ public:
 
			this->sel_index = -1;
 
		}
 

	
 
		this->SetWidgetDisabledState(TWA_EXECUTE, this->sel_index == -1);
 

	
 
		this->DrawWidgets();
 
		this->DrawRatings();
 
		if (!this->IsShaded()) this->DrawRatings();
 
	}
 

	
 
	/** Draw the contents of the ratings panel. May request a resize of the window if the contents does not fit. */
 
	void DrawRatings()
 
	{
 
		NWidgetBase *nwid = this->GetWidget<NWidgetBase>(TWA_RATING_INFO);
 
@@ -531,12 +532,13 @@ public:
 
};
 

	
 
static const NWidgetPart _nested_town_game_view_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN, TVW_CAPTION), SetDataTip(STR_TOWN_VIEW_TOWN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_BROWN),
 
		NWidget(WWT_INSET, COLOUR_BROWN), SetPadding(2, 2, 2, 2),
 
			NWidget(NWID_VIEWPORT, INVALID_COLOUR, TVW_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 0), SetResize(1, 1), SetPadding(1, 1, 1, 1),
 
		EndContainer(),
 
@@ -561,12 +563,13 @@ static const WindowDesc _town_game_view_
 

	
 
static const NWidgetPart _nested_town_editor_view_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		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_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_BROWN),
 
		NWidget(WWT_INSET, COLOUR_BROWN), SetPadding(2, 2, 2, 2),
 
			NWidget(NWID_VIEWPORT, INVALID_COLOUR, TVW_VIEWPORT), SetMinimalSize(254, 86), SetFill(1, 1), SetResize(1, 1), SetPadding(1, 1, 1, 1),
 
		EndContainer(),
 
@@ -609,12 +612,13 @@ enum TownDirectoryWidgets {
 
};
 

	
 
static const NWidgetPart _nested_town_directory_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
 
		NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_TOWN_DIRECTORY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_BROWN),
 
		NWidget(WWT_STICKYBOX, COLOUR_BROWN),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(NWID_HORIZONTAL),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TDW_SORTNAME), SetMinimalSize(99, 12), SetDataTip(STR_SORT_BY_CAPTION_NAME, STR_TOOLTIP_SORT_ORDER), SetFill(1, 0),
 
@@ -918,12 +922,13 @@ enum TownScenarioEditorWidgets {
 
};
 

	
 
static const NWidgetPart _nested_found_town_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_FOUND_TOWN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
 
	EndContainer(),
 
	/* Construct new town(s) buttons. */
 
	NWidget(WWT_PANEL, COLOUR_DARK_GREEN, TSEW_BACKGROUND),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 2),
 
		NWidget(WWT_TEXTBTN, COLOUR_GREY, TSEW_NEWTOWN), SetMinimalSize(156, 12), SetFill(1, 0),
 
@@ -1064,13 +1069,13 @@ public:
 
		if (success) this->RandomTownName();
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		this->DrawWidgets();
 
		this->DrawEditBox(TSEW_TOWNNAME_EDITBOX);
 
		if (!this->IsShaded()) this->DrawEditBox(TSEW_TOWNNAME_EDITBOX);
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
		switch (widget) {
 
			case TSEW_NEWTOWN:
src/tree_gui.cpp
Show inline comments
 
@@ -163,12 +163,13 @@ public:
 
};
 

	
 
static const NWidgetPart _nested_build_trees_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_PLANT_TREE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 2),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(NWID_SPACER), SetMinimalSize(2, 0),
src/vehicle_gui.cpp
Show inline comments
 
@@ -788,12 +788,13 @@ enum VehicleListWindowWidgets {
 
};
 

	
 
static const NWidgetPart _nested_vehicle_list[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, VLW_WIDGET_CAPTION),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 

	
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, VLW_WIDGET_SORT_ORDER), SetMinimalSize(81, 12), SetFill(0, 1), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER),
 
		NWidget(WWT_DROPDOWN, COLOUR_GREY, VLW_WIDGET_SORT_BY_PULLDOWN), SetMinimalSize(167, 12), SetFill(0, 1), SetDataTip(0x0, STR_TOOLTIP_SORT_CRITERIAP),
 
@@ -1348,12 +1349,13 @@ assert_compile(VLD_WIDGET_DETAILS_TOTAL_
 
/** Vehicle details widgets (other than train). */
 
static const NWidgetPart _nested_nontrain_vehicle_details_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, VLD_WIDGET_CAPTION), SetDataTip(STR_VEHICLE_DETAILS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, VLD_WIDGET_RENAME_VEHICLE), SetMinimalSize(40, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_VEHICLE_NAME_BUTTON, STR_NULL /* filled in later */),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, VLD_WIDGET_TOP_DETAILS), SetMinimalSize(405, 42), SetResize(1, 0), EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, VLD_WIDGET_MIDDLE_DETAILS), SetMinimalSize(405, 45), SetResize(1, 0), EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_BUTTON_ARROW, COLOUR_GREY, VLD_WIDGET_DECREASE_SERVICING_INTERVAL), SetFill(0, 1),
 
@@ -1368,12 +1370,13 @@ static const NWidgetPart _nested_nontrai
 
/** Train details widgets. */
 
static const NWidgetPart _nested_train_vehicle_details_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, VLD_WIDGET_CAPTION), SetDataTip(STR_VEHICLE_DETAILS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, VLD_WIDGET_RENAME_VEHICLE), SetMinimalSize(40, 0), SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 2), SetDataTip(STR_VEHICLE_NAME_BUTTON, STR_NULL /* filled in later */),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, VLD_WIDGET_TOP_DETAILS), SetResize(1, 0), SetMinimalSize(405, 42), EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_MATRIX, COLOUR_GREY, VLD_WIDGET_MATRIX), SetResize(1, 1), SetMinimalSize(393, 45), SetDataTip(0x701, STR_NULL), SetFill(1, 0),
 
		NWidget(WWT_SCROLLBAR, COLOUR_GREY, VLD_WIDGET_SCROLLBAR),
 
@@ -1717,12 +1720,13 @@ static void ShowVehicleDetailsWindow(con
 

	
 
/** Vehicle view widgets. */
 
static const NWidgetPart _nested_vehicle_view_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, VVW_WIDGET_CAPTION), SetDataTip(STR_VEHICLE_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_GREY),
 
			NWidget(WWT_INSET, COLOUR_GREY), SetPadding(2, 2, 2, 2),
 
				NWidget(NWID_VIEWPORT, INVALID_COLOUR, VVW_WIDGET_VIEWPORT), SetMinimalSize(226, 84), SetResize(1, 1), SetPadding(1, 1, 1, 1),
src/viewport_gui.cpp
Show inline comments
 
@@ -33,12 +33,13 @@ enum ExtraViewportWindowWidgets {
 

	
 
/* Extra ViewPort Window Stuff */
 
static const NWidgetPart _nested_extra_view_port_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, EVW_CAPTION), SetDataTip(STR_EXTRA_VIEW_PORT_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY),
 
		NWidget(NWID_VIEWPORT, INVALID_COLOUR, EVW_VIEWPORT), SetPadding(2, 2, 2, 2), SetResize(1, 1), SetFill(1, 1),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
src/waypoint_gui.cpp
Show inline comments
 
@@ -128,12 +128,13 @@ public:
 
};
 

	
 
static const NWidgetPart _nested_waypoint_view_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, WAYPVW_CAPTION), SetDataTip(STR_WAYPOINT_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_SHADEBOX, COLOUR_GREY),
 
		NWidget(WWT_STICKYBOX, COLOUR_GREY),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY),
 
		NWidget(WWT_INSET, COLOUR_GREY), SetPadding(2, 2, 2, 2),
 
			NWidget(NWID_VIEWPORT, COLOUR_GREY, WAYPVW_VIEWPORT), SetMinimalSize(256, 88), SetPadding(1, 1, 1, 1), SetResize(1, 1),
 
		EndContainer(),
0 comments (0 inline, 0 general)