Changeset - r9273:0df9c11598cc
[Not reviewed]
src/airport_gui.cpp
Show inline comments
 
@@ -69,7 +69,7 @@ static void BuildAirToolbWndProc(Window 
 
{
 
	switch (e->event) {
 
		case WE_PAINT:
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 
			break;
 

	
 
		case WE_CLICK:
 
@@ -197,7 +197,7 @@ public:
 

	
 
		if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		/* strings such as 'Size' and 'Coverage Area' */
 
		int text_end = DrawStationCoverageAreaText(2, 206, SCT_ALL, rad, false);
 
		text_end = DrawStationCoverageAreaText(2, text_end + 4, SCT_ALL, rad, true) + 4;
src/autoreplace_gui.cpp
Show inline comments
 
@@ -360,7 +360,7 @@ public:
 
			this->widget[RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN].data = _rail_types_list[sel_railtype];
 
		}
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* sets up the string for the vehicle that is being replaced to */
 
		if (selected_id[0] != INVALID_ENGINE) {
src/bridge_gui.cpp
Show inline comments
 
@@ -75,7 +75,7 @@ static void BuildBridgeWndProc(Window *w
 
			break;
 

	
 
		case WE_PAINT: {
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			uint y = 15;
 
			for (uint i = 0; (i < w->vscroll.cap) && ((i + w->vscroll.pos) < _bridgedata.count); i++) {
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1114,7 +1114,7 @@ struct BuildVehicleWindow : Window {
 
		/* Set text of sort by dropdown */
 
		this->widget[BUILD_VEHICLE_WIDGET_SORT_DROPDOWN].data = _sort_listing[this->vehicle_type][this->sort_criteria];
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		DrawEngineList(this->vehicle_type, this->widget[BUILD_VEHICLE_WIDGET_LIST].left + 2, this->widget[BUILD_VEHICLE_WIDGET_LIST].top + 1, this->eng_list, this->vscroll.pos, max, this->sel_engine, 0, DEFAULT_GROUP);
 

	
 
@@ -1129,7 +1129,7 @@ struct BuildVehicleWindow : Window {
 
			}
 
		}
 

	
 
		DrawSortButtonState(this, BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING, this->descending_sort_order ? SBS_DOWN : SBS_UP);
 
		this->DrawSortButtonState(BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING, this->descending_sort_order ? SBS_DOWN : SBS_UP);
 
	}
 

	
 
	virtual void OnDoubleClick(Point pt, int widget)
src/cheat_gui.cpp
Show inline comments
 
@@ -129,7 +129,7 @@ struct CheatWindow : Window {
 

	
 
	virtual void OnPaint()
 
	{
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		DrawStringMultiCenter(200, 25, STR_CHEATS_WARNING, width - 50);
 

	
 
		for (int i = 0, x = 0, y = 45; i != lengthof(_cheats_ui); i++) {
src/depot_gui.cpp
Show inline comments
 
@@ -365,7 +365,7 @@ struct DepotWindow : Window {
 
			SetDParam(0, depot->town_index);
 
		}
 

	
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		num = this->vscroll.pos * boxes_in_each_row;
 
		maxval = min(this->engine_count, num + (rows_in_display * boxes_in_each_row));
src/dock_gui.cpp
Show inline comments
 
@@ -129,7 +129,7 @@ static void BuildDocksToolbWndProc(Windo
 
{
 
	switch (e->event) {
 
	case WE_PAINT:
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 
		w->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_SHIP), 7, 8, 9, WIDGET_LIST_END);
 
		break;
 

	
 
@@ -238,7 +238,7 @@ static void BuildDockStationWndProc(Wind
 
	case WE_PAINT: {
 
		int rad = (_patches.modified_catchment) ? CA_DOCK : CA_UNMODIFIED;
 

	
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		if (_station_show_coverage) {
 
			SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
 
@@ -318,7 +318,7 @@ static void BuildDocksDepotWndProc(Windo
 
	case WE_CREATE: w->LowerWidget(_ship_depot_direction + 3); break;
 

	
 
	case WE_PAINT:
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		DrawShipDepotSprite(67, 35, 0);
 
		DrawShipDepotSprite(35, 51, 1);
src/engine_gui.cpp
Show inline comments
 
@@ -74,7 +74,7 @@ static void EnginePreviewWndProc(Window 
 
		const DrawEngineInfo* dei;
 
		int width;
 

	
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		SetDParam(0, GetEngineCategoryName(engine));
 
		DrawStringMultiCenter(150, 44, STR_8101_WE_HAVE_JUST_DESIGNED_A, 296);
src/genworld_gui.cpp
Show inline comments
 
@@ -315,7 +315,7 @@ struct GenerateLandscapeWindow : public 
 
		SetDParam(2, 1 << _patches_newgame.map_y); // GLAND_MAPSIZE_Y_PULLDOWN
 
		SetDParam(3, _patches_newgame.snow_line_height); // GLAND_SNOW_LEVEL_TEXT
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		this->DrawEditBox(GLAND_RANDOM_EDITBOX);
 

	
 
@@ -667,7 +667,7 @@ struct CreateScenarioWindow : public Win
 
		SetDParam(2, 1 << _patches_newgame.map_y); // CSCEN_MAPSIZE_Y_PULLDOWN
 
		SetDParam(3, _patches_newgame.se_flat_world_height); // CSCEN_FLAT_LAND_HEIGHT_TEXT
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
@@ -873,7 +873,7 @@ public:
 

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

	
 
		/* Draw the % complete with a bar and a text */
 
		DrawFrameRect(19, 20, (this->width - 18), 37, 14, FR_BORDERONLY);
src/graph_gui.cpp
Show inline comments
 
@@ -285,7 +285,7 @@ static void GraphLegendWndProc(Window *w
 
				w->RaiseWidget(p->index + 3);
 
			}
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			FOR_ALL_PLAYERS(p) {
 
				if (!p->is_active) continue;
 
@@ -384,7 +384,7 @@ static void OperatingProfitWndProc(Windo
 
			GraphDrawer gd;
 
			const Player* p;
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			gd.left = 2;
 
			gd.top = 18;
 
@@ -455,7 +455,7 @@ static void IncomeGraphWndProc(Window *w
 
			GraphDrawer gd;
 
			const Player* p;
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			gd.left = 2;
 
			gd.top = 18;
 
@@ -522,7 +522,7 @@ static void DeliveredCargoGraphWndProc(W
 
			GraphDrawer gd;
 
			const Player* p;
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			gd.left = 2;
 
			gd.top = 18;
 
@@ -589,7 +589,7 @@ static void PerformanceHistoryWndProc(Wi
 
			GraphDrawer gd;
 
			const Player* p;
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			gd.left = 2;
 
			gd.top = 18;
 
@@ -658,7 +658,7 @@ static void CompanyValueGraphWndProc(Win
 
			GraphDrawer gd;
 
			const Player* p;
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			gd.left = 2;
 
			gd.top = 18;
 
@@ -724,7 +724,7 @@ static void CargoPaymentRatesWndProc(Win
 
		case WE_PAINT: {
 
			GraphDrawer gd;
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			int x = 495;
 
			int y = 24;
 
@@ -886,7 +886,7 @@ static void CompanyLeagueWndProc(Window 
 
			const Player* plist[MAX_PLAYERS];
 
			const Player* p;
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			uint pl_num = 0;
 
			FOR_ALL_PLAYERS(p) if (p->is_active) plist[pl_num++] = p;
 
@@ -973,7 +973,7 @@ struct PerformanceRatingDetailWindow : W
 
		int color_done, color_notdone;
 

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

	
 
		/* Check if the currently selected player is still active. */
 
		if (player == INVALID_PLAYER || !GetPlayer(player)->is_active) {
src/group_gui.cpp
Show inline comments
 
@@ -403,7 +403,7 @@ struct VehicleGroupWindow : public Windo
 
		/* Set text of sort by dropdown */
 
		this->widget[GRP_WIDGET_SORT_BY_DROPDOWN].data = _vehicle_sort_listing[this->vehicles.sort_type];
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Draw Matrix Group
 
			* The selected group is drawn in white */
 
@@ -451,7 +451,7 @@ struct VehicleGroupWindow : public Windo
 
			DrawStringRightAligned(187, y1 + 1, STR_GROUP_TINY_NUM, (this->group_sel == g->index) ? TC_WHITE : TC_BLACK);
 
		}
 

	
 
		DrawSortButtonState(this, GRP_WIDGET_SORT_BY_ORDER, this->vehicles.flags & VL_DESC ? SBS_DOWN : SBS_UP);
 
		this->DrawSortButtonState(GRP_WIDGET_SORT_BY_ORDER, this->vehicles.flags & VL_DESC ? SBS_DOWN : SBS_UP);
 

	
 
		/* Draw Matrix Vehicle according to the vehicle list built before */
 
		max = min(this->vscroll2.pos + this->vscroll2.cap, this->vehicles.list_length);
src/industry_gui.cpp
Show inline comments
 
@@ -204,7 +204,7 @@ public:
 

	
 
		SetVScrollCount(this, this->count);
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* and now with the matrix painting */
 
		for (byte i = 0; i < this->vscroll.cap && ((i + this->vscroll.pos) < this->count); i++) {
 
@@ -481,7 +481,7 @@ public:
 
		bool has_accept = false;
 

	
 
		SetDParam(0, this->window_number);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		if (HasBit(ind->callback_flags, CBM_IND_PRODUCTION_CARGO_ARRIVAL) || HasBit(ind->callback_flags, CBM_IND_PRODUCTION_256_TICKS)) {
 
			for (byte j = 0; j < lengthof(i->accepts_cargo); j++) {
 
@@ -564,7 +564,7 @@ public:
 
			return;
 
		}
 

	
 
		DrawWindowViewport(this);
 
		this->DrawViewport();
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
@@ -840,8 +840,8 @@ static void IndustryDirectoryWndProc(Win
 

	
 
			SetVScrollCount(w, _num_industry_sort);
 

	
 
			DrawWindowWidgets(w);
 
			DrawSortButtonState(w, IDW_SORTBYNAME + (_industry_sort_order >> 1), _industry_sort_order & 1 ? SBS_DOWN : SBS_UP);
 
			w->DrawWidgets();
 
			w->DrawSortButtonState(IDW_SORTBYNAME + (_industry_sort_order >> 1), _industry_sort_order & 1 ? SBS_DOWN : SBS_UP);
 

	
 
			uint pos = w->vscroll.pos;
 
			int n = 0;
src/intro_gui.cpp
Show inline comments
 
@@ -82,7 +82,7 @@ static void SelectGameWndProc(Window *w,
 
			w->SetWidgetLoweredState(SGI_TROPIC_LANDSCAPE, _opt_newgame.landscape == LT_TROPIC);
 
			w->SetWidgetLoweredState(SGI_TOYLAND_LANDSCAPE, _opt_newgame.landscape == LT_TOYLAND);
 
			SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level);
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 
			break;
 

	
 
		case WE_CLICK:
src/main_gui.cpp
Show inline comments
 
@@ -224,7 +224,7 @@ struct MainWindow : Window
 

	
 
	virtual void OnPaint()
 
	{
 
		DrawWindowViewport(this);
 
		this->DrawViewport();
 
		if (_game_mode == GM_MENU) {
 
			int off_x = _screen.width / 2;
 

	
src/misc_gui.cpp
Show inline comments
 
@@ -83,7 +83,7 @@ public:
 

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

	
 
		DoDrawStringCentered(140, 16, this->landinfo_data[0], TC_LIGHT_BLUE);
 
		DoDrawStringCentered(140, 27, this->landinfo_data[1], TC_FROMSTRING);
 
@@ -289,7 +289,7 @@ struct AboutWindow : public Window {
 
			"  Chris Sawyer - For an amazing game!"
 
		};
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Show original copyright and revision version */
 
		DrawStringCentered(210, 17, STR_00B6_ORIGINAL_COPYRIGHT, TC_FROMSTRING);
 
@@ -371,7 +371,7 @@ public:
 
		};
 

	
 
		CopyInDParam(0, this->decode_params, lengthof(this->decode_params));
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		CopyInDParam(0, this->decode_params, lengthof(this->decode_params));
 

	
 
		/* If the error message comes from a NewGRF, we must use the text ref. stack reserved for error messages.
 
@@ -998,7 +998,7 @@ struct QueryStringWindow : public QueryS
 
	virtual void OnPaint()
 
	{
 
		SetDParam(0, this->caption);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		this->DrawEditBox(QUERY_STR_WIDGET_TEXT);
 
	}
 
@@ -1153,7 +1153,7 @@ struct QueryWindow : public Window {
 
	virtual void OnPaint()
 
	{
 
		CopyInDParam(0, this->params, lengthof(this->params));
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		CopyInDParam(0, this->params, lengthof(this->params));
 

	
 
		DrawStringMultiCenter(this->width / 2, (this->height / 2) - 10, this->message, this->width - 2);
 
@@ -1419,7 +1419,7 @@ struct SaveLoadWindow : public QueryStri
 
		int y;
 

	
 
		SetVScrollCount(this, _fios_num);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		DrawFiosTexts(this->width);
 

	
 
		if (_savegame_sort_dirty) {
 
@@ -1428,7 +1428,7 @@ struct SaveLoadWindow : public QueryStri
 
		}
 

	
 
		GfxFillRect(this->widget[7].left + 1, this->widget[7].top + 1, this->widget[7].right, this->widget[7].bottom, 0xD7);
 
		DrawSortButtonState(this, _savegame_sort_order & SORT_BY_NAME ? 2 : 3, _savegame_sort_order & SORT_DESCENDING ? SBS_DOWN : SBS_UP);
 
		this->DrawSortButtonState(_savegame_sort_order & SORT_BY_NAME ? 2 : 3, _savegame_sort_order & SORT_DESCENDING ? SBS_DOWN : SBS_UP);
 

	
 
		y = this->widget[7].top + 1;
 
		for (pos = this->vscroll.pos; pos < _fios_num; pos++) {
src/music_gui.cpp
Show inline comments
 
@@ -204,7 +204,7 @@ static void MusicTrackSelectionWndProc(W
 
		w->SetWidgetDisabledState(11, msf.playlist <= 3);
 
		w->LowerWidget(3);
 
		w->LowerWidget(4);
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		GfxFillRect(3, 23, 3 + 177, 23 + 191, 0);
 
		GfxFillRect(251, 23, 251 + 177, 23 + 191, 0);
 
@@ -346,7 +346,7 @@ static void MusicWindowWndProc(Window *w
 

	
 
		w->RaiseWidget(7);
 
		w->RaiseWidget(9);
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		GfxFillRect(187, 16, 200, 33, 0);
 

	
src/network/network_gui.cpp
Show inline comments
 
@@ -318,7 +318,7 @@ struct NetworkGameWindow : public QueryS
 

	
 
		SetDParam(0, 0x00);
 
		SetDParam(1, _lan_internet_types_dropdown[_network_lan_internet]);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Edit box to set player name */
 
		this->DrawEditBox(NGWW_PLAYER);
 
@@ -327,9 +327,9 @@ struct NetworkGameWindow : public QueryS
 

	
 
		/* Sort based on widgets: name, clients, compatibility */
 
		switch (this->servers.sort_type) {
 
			case NGWW_NAME    - NGWW_NAME: DrawSortButtonState(this, NGWW_NAME,    arrow); break;
 
			case NGWW_CLIENTS - NGWW_NAME: DrawSortButtonState(this, NGWW_CLIENTS, arrow); break;
 
			case NGWW_INFO    - NGWW_NAME: DrawSortButtonState(this, NGWW_INFO,    arrow); break;
 
			case NGWW_NAME    - NGWW_NAME: this->DrawSortButtonState(NGWW_NAME,    arrow); break;
 
			case NGWW_CLIENTS - NGWW_NAME: this->DrawSortButtonState(NGWW_CLIENTS, arrow); break;
 
			case NGWW_INFO    - NGWW_NAME: this->DrawSortButtonState(NGWW_INFO,    arrow); break;
 
		}
 

	
 
		uint16 y = NET_PRC__OFFSET_TOP_WIDGET + 3;
 
@@ -727,7 +727,7 @@ struct NetworkStartServerWindow : public
 
		SetDParam(3, _network_game_info.companies_max);
 
		SetDParam(4, _network_game_info.spectators_max);
 
		SetDParam(5, STR_NETWORK_LANG_ANY + _network_game_info.server_lang);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* editbox to set game name */
 
		this->DrawEditBox(NSSW_GAMENAME);
 
@@ -1036,7 +1036,7 @@ struct NetworkLobbyWindow : public Windo
 

	
 
		/* Draw window widgets */
 
		SetDParamStr(0, gi->server_name);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Draw company list */
 
		pos = this->vscroll.pos;
 
@@ -1410,7 +1410,7 @@ struct NetworkClientListPopupWindow : Wi
 

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

	
 
		/* Draw the actions */
 
		int sel = this->sel_index;
 
@@ -1514,7 +1514,7 @@ struct NetworkClientListWindow : Window
 
		/* Check if we need to reset the height */
 
		if (!this->CheckClientListHeight()) return;
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		int y = CLNWND_OFFSET;
 

	
 
@@ -1606,7 +1606,7 @@ struct NetworkJoinStatusWindow : Window 
 
	virtual void OnPaint()
 
	{
 
		uint8 progress; // used for progress bar
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		DrawStringCentered(125, 35, STR_NETWORK_CONNECTING_1 + _network_join_status, TC_GREY);
 
		switch (_network_join_status) {
 
@@ -1851,7 +1851,7 @@ struct NetworkChatWindow : public QueryS
 
			STR_NETWORK_CHAT_CLIENT_CAPTION
 
		};
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		assert((uint)this->dtype < lengthof(chat_captions));
 
		DrawStringRightAligned(this->widget[2].left - 2, this->widget[2].top + 1, chat_captions[this->dtype], TC_BLACK);
 
@@ -1953,7 +1953,7 @@ struct NetworkCompanyPasswordWindow : pu
 

	
 
	virtual void OnPaint()
 
	{
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		this->DrawEditBox(4);
 
	}
 

	
src/newgrf_gui.cpp
Show inline comments
 
@@ -150,7 +150,7 @@ struct NewGRFAddWindow : public Window {
 
		SetVScrollCount(this, n);
 

	
 
		this->SetWidgetDisabledState(ANGRFW_ADD, this->sel == NULL || this->sel->IsOpenTTDBaseGRF());
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		GfxFillRect(wl->left + 1, wl->top + 1, wl->right, wl->bottom, 0xD7);
 

	
 
@@ -345,7 +345,7 @@ struct NewGRFWindow : public Window {
 
			if (this->sel->IsOpenTTDBaseGRF()) this->DisableWidget(SNGRFS_REMOVE);
 
		}
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Draw NewGRF list */
 
		int y = this->widget[SNGRFS_FILE_LIST].top;
src/news_gui.cpp
Show inline comments
 
@@ -182,7 +182,7 @@ struct NewsWindow : Window {
 
					/* Back up transparency options to draw news view */
 
					TransparencyOptionBits to_backup = _transparency_opt;
 
					_transparency_opt = 0;
 
					DrawWindowViewport(this);
 
					this->DrawViewport();
 
					_transparency_opt = to_backup;
 

	
 
					/* Shade the viewport into gray, or color*/
 
@@ -204,12 +204,12 @@ struct NewsWindow : Window {
 
				break;
 

	
 
			default:
 
				DrawWindowWidgets(this);
 
				this->DrawWidgets();
 
				if (!(this->ni->flags & NF_VIEWPORT)) {
 
					CopyInDParam(0, this->ni->params, lengthof(this->ni->params));
 
					DrawStringMultiCenter(140, 38, this->ni->string_id, 276);
 
				} else {
 
					DrawWindowViewport(this);
 
					this->DrawViewport();
 
					CopyInDParam(0, this->ni->params, lengthof(this->ni->params));
 
					DrawStringMultiCenter(this->width / 2, this->height - 16, this->ni->string_id, this->width - 4);
 
				}
 
@@ -647,7 +647,7 @@ static void MessageHistoryWndProc(Window
 
			int y = 19;
 

	
 
			SetVScrollCount(w, _total_news);
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			if (_total_news == 0) break;
 
			NewsID show = min(_total_news, w->vscroll.cap);
 
@@ -764,7 +764,7 @@ struct MessageOptionsWindow : Window {
 
		if (_news_ticker_sound) this->LowerWidget(WIDGET_NEWSOPT_SOUNDTICKER);
 

	
 
		this->widget[WIDGET_NEWSOPT_DROP_SUMMARY].data = _message_opt[this->state];
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Draw the string of each setting on each button. */
 
		for (int i = 0, y = 26; i < NT_END; i++, y += 12) {
src/order_gui.cpp
Show inline comments
 
@@ -709,7 +709,7 @@ public:
 
		}
 

	
 
		SetDParam(0, this->vehicle->index);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		int y = 15;
 

	
src/osk_gui.cpp
Show inline comments
 
@@ -98,7 +98,7 @@ struct OskWindow : public Window {
 
		this->ChangeOskDiabledState(shift);
 

	
 
		SetDParam(0, this->caption);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		for (uint i = 0; i < OSK_KEYBOARD_ENTRIES; i++) {
 
			DrawCharCentered(_keyboard[shift][i],
src/player_gui.cpp
Show inline comments
 
@@ -193,7 +193,7 @@ struct PlayerFinancesWindow : Window {
 
		SetDParam(0, p->index);
 
		SetDParam(1, p->index);
 
		SetDParam(2, LOAN_INTERVAL);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		DrawPlayerEconomyStats(p, this->small);
 
	}
 
@@ -398,7 +398,7 @@ public:
 
		SetDParam(0, STR_00D1_DARK_BLUE + p->livery[scheme].colour1);
 
		SetDParam(1, STR_00D1_DARK_BLUE + p->livery[scheme].colour2);
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		for (scheme = LS_DEFAULT; scheme < LS_END; scheme++) {
 
			if (_livery_class[scheme] == this->livery_class) {
 
@@ -834,7 +834,7 @@ public:
 
				PFW_WIDGET_GLASSES, PFW_WIDGET_GLASSES_L, PFW_WIDGET_GLASSES_R, WIDGET_LIST_END);
 
		}
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Draw dynamic button value and labels for the advanced player face selection window */
 
		if (this->advanced) {
 
@@ -1213,7 +1213,7 @@ struct PlayerCompanyWindow : Window
 
		SetDParam(0, p->index);
 
		SetDParam(1, p->index);
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Player face */
 
		DrawPlayerFace(p->face, p->player_color, 2, 16);
 
@@ -1367,7 +1367,7 @@ static void BuyCompanyWndProc(Window *w,
 
			Player *p = GetPlayer((PlayerID)w->window_number);
 
			SetDParam(0, STR_COMPANY_NAME);
 
			SetDParam(1, p->index);
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			DrawPlayerFace(p->face, p->player_color, 2, 16);
 

	
 
@@ -1436,7 +1436,7 @@ struct EndGameHighScoreBaseWindow : Wind
 
		this->widget[0].right = this->width - 1;
 
		this->widget[0].bottom = this->height - 1;
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Center Highscore/Endscreen background */
 
		*x = max(0, (_screen.width  / 2) - (640 / 2));
src/rail_gui.cpp
Show inline comments
 
@@ -567,7 +567,7 @@ static void BuildRailToolbWndProc(Window
 
	switch (e->event) {
 
	case WE_CREATE: w->DisableWidget(RTW_REMOVE); break;
 

	
 
	case WE_PAINT: DrawWindowWidgets(w); break;
 
	case WE_PAINT: w->DrawWidgets(); break;
 

	
 
	case WE_CLICK:
 
		if (e->we.click.widget >= RTW_BUILD_NS) {
 
@@ -899,7 +899,7 @@ static void StationBuildWndProc(Window *
 
		}
 

	
 
		SetDParam(0, GetStationClassName(_railstation.station_class));
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		int y_offset = newstations ? 90 : 0;
 

	
 
@@ -1277,7 +1277,7 @@ static void SignalBuildWndProc(Window *w
 
			w->SetWidgetDisabledState(BSW_DRAG_SIGNALS_DENSITY_DECREASE, _patches.drag_signals_density == 1);
 
			w->SetWidgetDisabledState(BSW_DRAG_SIGNALS_DENSITY_INCREASE, _patches.drag_signals_density == 20);
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			/* The 'hardcoded' off sets are needed because they are reused sprites. */
 
			DrawSignalSprite(w, BSW_SEMAPHORE_NORM,  SPR_IMG_SIGNAL_SEMAPHORE_NORM,   0, 12); // xsize of sprite + 1 ==  9
 
@@ -1399,7 +1399,7 @@ static void BuildTrainDepotWndProc(Windo
 
	case WE_CREATE: w->LowerWidget(_build_depot_direction + BRDW_DEPOT_NE); break;
 

	
 
	case WE_PAINT: {
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		DrawTrainDepotSprite(70, 17, DIAGDIR_NE, _cur_railtype);
 
		DrawTrainDepotSprite(70, 69, DIAGDIR_SE, _cur_railtype);
 
@@ -1477,7 +1477,7 @@ static void BuildWaypointWndProc(Window 
 
			w->SetWidgetLoweredState(i + BRWW_WAYPOINT_1, (w->hscroll.pos + i) == _cur_waypoint_type);
 
		}
 

	
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 

	
 
		for (i = 0; i < w->hscroll.cap; i++) {
 
			if (w->hscroll.pos + i < w->hscroll.count) {
src/road_gui.cpp
Show inline comments
 
@@ -468,7 +468,7 @@ static void BuildRoadToolbWndProc(Window
 
				RTW_BUS_STATION,
 
				RTW_TRUCK_STATION,
 
				WIDGET_LIST_END);
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 
			break;
 

	
 
		case WE_CLICK:
 
@@ -733,7 +733,7 @@ static void BuildRoadDepotWndProc(Window
 
			break;
 

	
 
		case WE_PAINT:
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			DrawRoadDepotSprite(70, 17, DIAGDIR_NE, _cur_roadtype);
 
			DrawRoadDepotSprite(70, 69, DIAGDIR_SE, _cur_roadtype);
 
@@ -849,7 +849,7 @@ static void RoadStationPickerWndProc(Win
 
			break;
 

	
 
		case WE_PAINT: {
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			if (_station_show_coverage) {
 
				int rad = _patches.modified_catchment ? CA_TRUCK /* = CA_BUS */ : CA_UNMODIFIED;
src/settings_gui.cpp
Show inline comments
 
@@ -194,7 +194,7 @@ static void GameOptionsWndProc(Window *w
 
			SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format);
 
			w->SetWidgetLoweredState(GAMEOPT_FULLSCREEN, _fullscreen);
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 
			DrawString(20, 175, STR_OPTIONS_FULLSCREEN, TC_FROMSTRING); // fullscreen
 
		} break;
 

	
 
@@ -565,7 +565,7 @@ public:
 

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

	
 
		/* XXX - Disabled buttons in normal gameplay or during muliplayer as non server.
 
		 *       Bitshifted for each button to see if that bit is set. If it is set, the
 
@@ -903,7 +903,7 @@ struct PatchesSelectionWindow : Window {
 
		uint i;
 

	
 
		/* Set up selected category */
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		x = 5;
 
		y = 47;
 
@@ -1159,7 +1159,7 @@ struct CustomCurrencyWindow : Window {
 
	{
 
		int x;
 
		int y = 20;
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* exchange rate */
 
		DrawArrowButtons(10, y, 3, GB(this->click, 0, 2), true, true);
src/signs_gui.cpp
Show inline comments
 
@@ -75,7 +75,7 @@ static void SignListWndProc(Window *w, W
 
			SetVScrollCount(w, _num_sign_sort);
 

	
 
			SetDParam(0, w->vscroll.count);
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			/* No signs? */
 
			int y = 16; // offset from top of widget
 
@@ -197,7 +197,7 @@ struct SignWindow : QueryStringBaseWindo
 
	virtual void OnPaint()
 
	{
 
		SetDParam(0, this->caption);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		this->DrawEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
 
	}
 

	
src/smallmap_gui.cpp
Show inline comments
 
@@ -847,7 +847,7 @@ public:
 

	
 
		/* draw the window */
 
		SetDParam(0, STR_00E5_CONTOURS + _smallmap_type);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		tbl = _legend_table[_smallmap_type];
 

	
 
@@ -1153,8 +1153,8 @@ public:
 
		/* set the number in the title bar */
 
		SetDParam(0, this->window_number + 1);
 

	
 
		DrawWindowWidgets(this);
 
		DrawWindowViewport(this);
 
		this->DrawWidgets();
 
		this->DrawViewport();
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
src/station_gui.cpp
Show inline comments
 
@@ -369,10 +369,10 @@ struct PlayerStationsWindow : public Win
 
		/* Set text of sort by dropdown */
 
		this->widget[SLW_SORTDROPBTN].data = _station_sort_listing[this->sort_type];
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* draw arrow pointing up/down for ascending/descending sorting */
 
		DrawSortButtonState(this, SLW_SORTBY, this->flags & VL_DESC ? SBS_DOWN : SBS_UP);
 
		this->DrawSortButtonState(SLW_SORTBY, this->flags & VL_DESC ? SBS_DOWN : SBS_UP);
 

	
 
		int cg_ofst;
 
		int x = 89;
 
@@ -813,7 +813,7 @@ struct StationViewWindow : public Window
 

	
 
		SetDParam(0, st->index);
 
		SetDParam(1, st->facilities);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		int x = 2;  ///< coordinates used for printing waiting/accepted/rating of cargo
 
		int y = 15;
src/statusbar_gui.cpp
Show inline comments
 
@@ -80,7 +80,7 @@ struct StatusBarWindow : Window {
 
	{
 
		const Player *p = (_local_player == PLAYER_SPECTATOR) ? NULL : GetPlayer(_local_player);
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		SetDParam(0, _date);
 
		DrawStringCentered(70, 1, (_pause_game || _patches.status_long_date) ? STR_00AF : STR_00AE, TC_FROMSTRING);
 

	
src/subsidy_gui.cpp
Show inline comments
 
@@ -96,7 +96,7 @@ static void DrawSubsidiesWindow(const Wi
 
	int x;
 
	int y;
 

	
 
	DrawWindowWidgets(w);
 
	w->DrawWidgets();
 

	
 
	ConvertDateToYMD(_date, &ymd);
 

	
src/terraform_gui.cpp
Show inline comments
 
@@ -236,7 +236,7 @@ static void TerraformToolbWndProc(Window
 
{
 
	switch (e->event) {
 
	case WE_PAINT:
 
		DrawWindowWidgets(w);
 
		w->DrawWidgets();
 
		break;
 

	
 
	case WE_CLICK:
 
@@ -578,7 +578,7 @@ static void ScenEditLandGenWndProc(Windo
 
			break;
 

	
 
		case WE_PAINT: {
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			int n = _terraform_size * _terraform_size;
 
			const int8 *coords = &_multi_terraform_coords[0][0];
src/timetable_gui.cpp
Show inline comments
 
@@ -108,7 +108,7 @@ struct TimetableWindow : Window {
 
		this->SetWidgetLoweredState(TTV_AUTOFILL, HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE));
 

	
 
		SetDParam(0, v->index);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		int y = 15;
 
		int i = this->vscroll.pos;
src/toolbar_gui.cpp
Show inline comments
 
@@ -684,7 +684,7 @@ static void MainToolbarWndProc(Window *w
 
			w->SetWidgetDisabledState(19, !CanBuildVehicleInfrastructure(VEH_TRAIN));
 
			w->SetWidgetDisabledState(22, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT));
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 
			break;
 

	
 
		case WE_CLICK:
 
@@ -887,7 +887,7 @@ static void ScenEditToolbarWndProc(Windo
 
			GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB2);
 
			GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
 

	
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			SetDParam(0, ConvertYMDToDate(_patches_newgame.starting_year, 0, 1));
 
			DrawStringCenteredTruncated(w->widget[6].right, w->widget[7].left, 6, STR_00AF, TC_FROMSTRING);
 
@@ -1146,7 +1146,7 @@ struct ToolbarMenuWindow : Window {
 

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

	
 
		for (int i = 0, x = 1, y = 1; i != this->item_count; i++, y += 10) {
 
			TextColour color = HasBit(this->disabled_items, i) ? TC_GREY : (this->sel_index == i) ? TC_WHITE : TC_BLACK;
 
@@ -1323,7 +1323,7 @@ struct ToolbarPlayerMenuWindow : Window 
 
	virtual void OnPaint()
 
	{
 
		this->UpdatePlayerMenuHeight();
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		int x = 1;
 
		int y = 1;
src/town_gui.cpp
Show inline comments
 
@@ -167,7 +167,7 @@ struct TownAuthorityWindow : Window {
 
		this->SetWidgetDisabledState(6, this->sel_index == -1);
 

	
 
		SetDParam(0, this->window_number);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		DrawString(2, 15, STR_2023_TRANSPORT_COMPANY_RATINGS, TC_FROMSTRING);
 

	
 
@@ -310,7 +310,7 @@ static void TownViewWndProc(Window *w, W
 
			w->SetWidgetDisabledState(TVW_CHANGENAME, _networking && !_network_server);
 

	
 
			SetDParam(0, t->index);
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 

	
 
			SetDParam(0, t->population);
 
			SetDParam(1, t->num_houses);
 
@@ -324,7 +324,7 @@ static void TownViewWndProc(Window *w, W
 
			SetDParam(1, t->max_mail);
 
			DrawString(2, 127, STR_200E_MAIL_LAST_MONTH_MAX, TC_FROMSTRING);
 

	
 
			DrawWindowViewport(w);
 
			w->DrawViewport();
 
			break;
 

	
 
		case WE_CLICK:
 
@@ -489,8 +489,8 @@ static void TownDirectoryWndProc(Window 
 

	
 
			SetVScrollCount(w, _num_town_sort);
 

	
 
			DrawWindowWidgets(w);
 
			DrawSortButtonState(w, (_town_sort_order <= 1) ? TDW_SORTNAME : TDW_SORTPOPULATION, _town_sort_order & 1 ? SBS_DOWN : SBS_UP);
 
			w->DrawWidgets();
 
			w->DrawSortButtonState((_town_sort_order <= 1) ? TDW_SORTNAME : TDW_SORTPOPULATION, _town_sort_order & 1 ? SBS_DOWN : SBS_UP);
 

	
 
			{
 
				int n = 0;
 
@@ -626,7 +626,7 @@ static void ScenEditTownGenWndProc(Windo
 
{
 
	switch (e->event) {
 
		case WE_PAINT:
 
			DrawWindowWidgets(w);
 
			w->DrawWidgets();
 
			break;
 

	
 
		case WE_CREATE:
src/transparency_gui.cpp
Show inline comments
 
@@ -49,7 +49,7 @@ public:
 
			this->SetWidgetLoweredState(i, IsTransparencySet((TransparencyOption)(i - TTW_WIDGET_SIGNS)));
 
		}
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 
		for (uint i = TO_SIGNS; i < TO_END; i++) {
 
			if (HasBit(_transparency_lock, i)) DrawSprite(SPR_LOCK, PAL_NONE, this->widget[TTW_WIDGET_SIGNS + i].left + 1, this->widget[TTW_WIDGET_SIGNS + i].top + 1);
 
		}
src/tree_gui.cpp
Show inline comments
 
@@ -72,7 +72,7 @@ public:
 
			{ 0x7BA, PAL_NONE }, { 0x7C1, PALETTE_TO_RED, }, { 0x7C8, PALETTE_TO_PALE_GREEN }, { 0x7CF, PALETTE_TO_YELLOW }, { 0x7D6, PALETTE_TO_RED }
 
		};
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		int i = this->base = _tree_base_by_landscape[_opt.landscape];
 
		int count = this->count = _tree_count_by_landscape[_opt.landscape];
src/vehicle_gui.cpp
Show inline comments
 
@@ -394,7 +394,7 @@ struct RefitWindow : public Window {
 
		SetVScrollCount(this, this->list->num_lines);
 

	
 
		SetDParam(0, v->index);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		this->cargo = DrawVehicleRefitWindow(this->list, this->sel, this->vscroll.pos, this->vscroll.cap, this->resize.step_height);
 

	
 
@@ -1028,12 +1028,12 @@ struct VehicleListWindow : public Window
 
			VLW_WIDGET_START_ALL,
 
			WIDGET_LIST_END);
 

	
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* draw sorting criteria string */
 
		DrawString(85, 15, _vehicle_sort_listing[this->vehicles.sort_type], TC_BLACK);
 
		/* draw arrow pointing up/down for ascending/descending sorting */
 
		DrawSortButtonState(this, VLW_WIDGET_SORT_ORDER, this->vehicles.flags & VL_DESC ? SBS_DOWN : SBS_UP);
 
		this->DrawSortButtonState(VLW_WIDGET_SORT_ORDER, this->vehicles.flags & VL_DESC ? SBS_DOWN : SBS_UP);
 

	
 
		max = min(this->vscroll.pos + this->vscroll.cap, this->vehicles.list_length);
 
		for (i = this->vscroll.pos; i < max; ++i) {
 
@@ -1508,7 +1508,7 @@ struct VehicleDetailsWindow : Window {
 

	
 

	
 
		SetDParam(0, v->index);
 
		DrawWindowWidgets(this);
 
		this->DrawWidgets();
 

	
 
		/* Draw running cost */
 
		SetDParam(1, v->age / 366);
 
@@ -1942,7 +1942,7 @@ static void DrawVehicleViewWindow(Window
 

	
 
	/* draw widgets & caption */
 
	SetDParam(0, v->index);
 
	DrawWindowWidgets(w);
 
	w->DrawWidgets();
 

	
 
	if (v->vehstatus & VS_CRASHED) {
 
		str = STR_8863_CRASHED;
 
@@ -2021,7 +2021,7 @@ static void DrawVehicleViewWindow(Window
 
	/* draw the flag plus orders */
 
	DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, 2, w->widget[VVW_WIDGET_START_STOP_VEH].top + 1);
 
	DrawStringCenteredTruncated(w->widget[VVW_WIDGET_START_STOP_VEH].left + 8, w->widget[VVW_WIDGET_START_STOP_VEH].right, w->widget[VVW_WIDGET_START_STOP_VEH].top + 1, str, TC_FROMSTRING);
 
	DrawWindowViewport(w);
 
	w->DrawViewport();
 
}
 

	
 
/** Command indices for the _vehicle_command_translation_table. */
src/viewport.cpp
Show inline comments
 
@@ -1536,17 +1536,17 @@ static inline void ViewportDraw(const Vi
 
	ViewportDrawChk(vp, left, top, right, bottom);
 
}
 

	
 
void DrawWindowViewport(const Window *w)
 
void Window::DrawViewport() const
 
{
 
	DrawPixelInfo *dpi = _cur_dpi;
 

	
 
	dpi->left += w->left;
 
	dpi->top += w->top;
 

	
 
	ViewportDraw(w->viewport, dpi->left, dpi->top, dpi->left + dpi->width, dpi->top + dpi->height);
 

	
 
	dpi->left -= w->left;
 
	dpi->top -= w->top;
 
	dpi->left += this->left;
 
	dpi->top += this->top;
 

	
 
	ViewportDraw(this->viewport, dpi->left, dpi->top, dpi->left + dpi->width, dpi->top + dpi->height);
 

	
 
	dpi->left -= this->left;
 
	dpi->top -= this->top;
 
}
 

	
 
static inline void ClampViewportToMap(const ViewPort *vp, int &x, int &y)
src/widget.cpp
Show inline comments
 
@@ -190,20 +190,20 @@ void DrawFrameRect(int left, int top, in
 
 * Paint all widgets of a window.
 
 * @param w Window
 
 */
 
void DrawWindowWidgets(const Window *w)
 
void Window::DrawWidgets() const
 
{
 
	const DrawPixelInfo* dpi = _cur_dpi;
 

	
 
	for (uint i = 0; i < w->widget_count; i++) {
 
		const Widget *wi = &w->widget[i];
 
		bool clicked = w->IsWidgetLowered(i);
 
	for (uint i = 0; i < this->widget_count; i++) {
 
		const Widget *wi = &this->widget[i];
 
		bool clicked = this->IsWidgetLowered(i);
 
		Rect r;
 

	
 
		if (dpi->left > (r.right = wi->right) ||
 
				dpi->left + dpi->width <= (r.left = wi->left) ||
 
				dpi->top > (r.bottom = wi->bottom) ||
 
				dpi->top + dpi->height <= (r.top = wi->top) ||
 
				w->IsWidgetHidden(i)) {
 
				this->IsWidgetHidden(i)) {
 
			continue;
 
		}
 

	
 
@@ -304,11 +304,11 @@ void DrawWindowWidgets(const Window *w)
 
			assert(r.right - r.left == 11); // To ensure the same sizes are used everywhere!
 

	
 
			/* draw up/down buttons */
 
			clicked = ((w->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_UP);
 
			clicked = ((this->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_UP);
 
			DrawFrameRect(r.left, r.top, r.right, r.top + 9, wi->color, (clicked) ? FR_LOWERED : FR_NONE);
 
			DoDrawString(UPARROW, r.left + 2 + clicked, r.top + clicked, TC_BLACK);
 

	
 
			clicked = (((w->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_DOWN));
 
			clicked = (((this->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_DOWN));
 
			DrawFrameRect(r.left, r.bottom - 9, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : FR_NONE);
 
			DoDrawString(DOWNARROW, r.left + 2 + clicked, r.bottom - 9 + clicked, TC_BLACK);
 

	
 
@@ -325,8 +325,8 @@ void DrawWindowWidgets(const Window *w)
 
			GfxFillRect(r.left + 7, r.top + 10, r.left + 7, r.bottom - 10, c1);
 
			GfxFillRect(r.left + 8, r.top + 10, r.left + 8, r.bottom - 10, c2);
 

	
 
			Point pt = HandleScrollbarHittest(&w->vscroll, r.top, r.bottom);
 
			DrawFrameRect(r.left, pt.x, r.right, pt.y, wi->color, (w->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_MIDDLE ? FR_LOWERED : FR_NONE);
 
			Point pt = HandleScrollbarHittest(&this->vscroll, r.top, r.bottom);
 
			DrawFrameRect(r.left, pt.x, r.right, pt.y, wi->color, (this->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_MIDDLE ? FR_LOWERED : FR_NONE);
 
			break;
 
		}
 

	
 
@@ -335,11 +335,11 @@ void DrawWindowWidgets(const Window *w)
 
			assert(r.right - r.left == 11); // To ensure the same sizes are used everywhere!
 

	
 
			/* draw up/down buttons */
 
			clicked = ((w->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_UP | WF_SCROLL2));
 
			clicked = ((this->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_UP | WF_SCROLL2));
 
			DrawFrameRect(r.left, r.top, r.right, r.top + 9, wi->color,  (clicked) ? FR_LOWERED : FR_NONE);
 
			DoDrawString(UPARROW, r.left + 2 + clicked, r.top + clicked, TC_BLACK);
 

	
 
			clicked = ((w->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_DOWN | WF_SCROLL2));
 
			clicked = ((this->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_DOWN | WF_SCROLL2));
 
			DrawFrameRect(r.left, r.bottom - 9, r.right, r.bottom, wi->color,  (clicked) ? FR_LOWERED : FR_NONE);
 
			DoDrawString(DOWNARROW, r.left + 2 + clicked, r.bottom - 9 + clicked, TC_BLACK);
 

	
 
@@ -356,8 +356,8 @@ void DrawWindowWidgets(const Window *w)
 
			GfxFillRect(r.left + 7, r.top + 10, r.left + 7, r.bottom - 10, c1);
 
			GfxFillRect(r.left + 8, r.top + 10, r.left + 8, r.bottom - 10, c2);
 

	
 
			Point pt = HandleScrollbarHittest(&w->vscroll2, r.top, r.bottom);
 
			DrawFrameRect(r.left, pt.x, r.right, pt.y, wi->color, (w->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_MIDDLE | WF_SCROLL2) ? FR_LOWERED : FR_NONE);
 
			Point pt = HandleScrollbarHittest(&this->vscroll2, r.top, r.bottom);
 
			DrawFrameRect(r.left, pt.x, r.right, pt.y, wi->color, (this->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_MIDDLE | WF_SCROLL2) ? FR_LOWERED : FR_NONE);
 
			break;
 
		}
 

	
 
@@ -366,11 +366,11 @@ void DrawWindowWidgets(const Window *w)
 
			assert(wi->data == 0);
 
			assert(r.bottom - r.top == 11); // To ensure the same sizes are used everywhere!
 

	
 
			clicked = ((w->flags4 & (WF_SCROLL_UP | WF_HSCROLL)) == (WF_SCROLL_UP | WF_HSCROLL));
 
			clicked = ((this->flags4 & (WF_SCROLL_UP | WF_HSCROLL)) == (WF_SCROLL_UP | WF_HSCROLL));
 
			DrawFrameRect(r.left, r.top, r.left + 9, r.bottom, wi->color, (clicked) ? FR_LOWERED : FR_NONE);
 
			DrawSprite(SPR_ARROW_LEFT, PAL_NONE, r.left + 1 + clicked, r.top + 1 + clicked);
 

	
 
			clicked = ((w->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL)) == (WF_SCROLL_DOWN | WF_HSCROLL));
 
			clicked = ((this->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL)) == (WF_SCROLL_DOWN | WF_HSCROLL));
 
			DrawFrameRect(r.right - 9, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : FR_NONE);
 
			DrawSprite(SPR_ARROW_RIGHT, PAL_NONE, r.right - 8 + clicked, r.top + 1 + clicked);
 

	
 
@@ -388,8 +388,8 @@ void DrawWindowWidgets(const Window *w)
 
			GfxFillRect(r.left + 10, r.top + 8, r.right - 10, r.top + 8, c2);
 

	
 
			/* draw actual scrollbar */
 
			Point pt = HandleScrollbarHittest(&w->hscroll, r.left, r.right);
 
			DrawFrameRect(pt.x, r.top, pt.y, r.bottom, wi->color, (w->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL)) == (WF_SCROLL_MIDDLE | WF_HSCROLL) ? FR_LOWERED : FR_NONE);
 
			Point pt = HandleScrollbarHittest(&this->hscroll, r.left, r.right);
 
			DrawFrameRect(pt.x, r.top, pt.y, r.bottom, wi->color, (this->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL)) == (WF_SCROLL_MIDDLE | WF_HSCROLL) ? FR_LOWERED : FR_NONE);
 

	
 
			break;
 
		}
 
@@ -429,7 +429,7 @@ void DrawWindowWidgets(const Window *w)
 
			assert(wi->data == 0);
 
			assert(r.right - r.left == 11); // To ensure the same sizes are used everywhere!
 

	
 
			clicked = !!(w->flags4 & WF_STICKY);
 
			clicked = !!(this->flags4 & WF_STICKY);
 
			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : FR_NONE);
 
			DrawSprite((clicked) ? SPR_PIN_UP : SPR_PIN_DOWN, PAL_NONE, r.left + 2 + clicked, r.top + 3 + clicked);
 
			break;
 
@@ -438,7 +438,7 @@ void DrawWindowWidgets(const Window *w)
 
			assert(wi->data == 0);
 
			assert(r.right - r.left == 11); // To ensure the same sizes are used everywhere!
 

	
 
			clicked = !!(w->flags4 & WF_SIZING);
 
			clicked = !!(this->flags4 & WF_SIZING);
 
			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : FR_NONE);
 
			DrawSprite(SPR_WINDOW_RESIZE, PAL_NONE, r.left + 3 + clicked, r.top + 3 + clicked);
 
			break;
 
@@ -457,10 +457,10 @@ void DrawWindowWidgets(const Window *w)
 
		case WWT_CAPTION:
 
			assert(r.bottom - r.top == 13); // To ensure the same sizes are used everywhere!
 
			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_BORDERONLY);
 
			DrawFrameRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, wi->color, (w->caption_color == 0xFF) ? FR_LOWERED | FR_DARKENED : FR_LOWERED | FR_DARKENED | FR_BORDERONLY);
 
			DrawFrameRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, wi->color, (this->caption_color == 0xFF) ? FR_LOWERED | FR_DARKENED : FR_LOWERED | FR_DARKENED | FR_BORDERONLY);
 

	
 
			if (w->caption_color != 0xFF) {
 
				GfxFillRect(r.left + 2, r.top + 2, r.right - 2, r.bottom - 2, _colour_gradient[_player_colors[w->caption_color]][4]);
 
			if (this->caption_color != 0xFF) {
 
				GfxFillRect(r.left + 2, r.top + 2, r.right - 2, r.bottom - 2, _colour_gradient[_player_colors[this->caption_color]][4]);
 
			}
 

	
 
			DrawStringCenteredTruncated(r.left + 2, r.right - 2, r.top + 2, wi->data, 0x84);
 
@@ -489,14 +489,14 @@ void DrawWindowWidgets(const Window *w)
 
		}
 
		}
 

	
 
		if (w->IsWidgetDisabled(i)) {
 
		if (this->IsWidgetDisabled(i)) {
 
			GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, _colour_gradient[wi->color & 0xF][2] | (1 << PALETTE_MODIFIER_GREYOUT));
 
		}
 
	}
 

	
 

	
 
	if (w->flags4 & WF_WHITE_BORDER_MASK) {
 
		DrawFrameRect(0, 0, w->width - 1, w->height - 1, 0xF, FR_BORDERONLY);
 
	if (this->flags4 & WF_WHITE_BORDER_MASK) {
 
		DrawFrameRect(0, 0, this->width - 1, this->height - 1, 0xF, FR_BORDERONLY);
 
	}
 

	
 
}
 
@@ -597,10 +597,10 @@ void ResizeWindowForWidget(Window *w, in
 
 * @param widget Sort button widget
 
 * @param state State of sort button
 
 */
 
void DrawSortButtonState(const Window *w, int widget, SortButtonState state)
 
void Window::DrawSortButtonState(int widget, SortButtonState state) const
 
{
 
	if (state == SBS_OFF) return;
 

	
 
	int offset = w->IsWidgetLowered(widget) ? 1 : 0;
 
	DoDrawString(state == SBS_DOWN ? DOWNARROW : UPARROW, w->widget[widget].right - 11 + offset, w->widget[widget].top + 1 + offset, TC_BLACK);
 
	int offset = this->IsWidgetLowered(widget) ? 1 : 0;
 
	DoDrawString(state == SBS_DOWN ? DOWNARROW : UPARROW, this->widget[widget].right - 11 + offset, this->widget[widget].top + 1 + offset, TC_BLACK);
 
}
src/widgets/dropdown.cpp
Show inline comments
 
@@ -118,7 +118,7 @@ struct DropdownWindow : Window {
 

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

	
 
		int x = 1;
 
		int y = 2;
src/window_gui.h
Show inline comments
 
@@ -245,6 +245,12 @@ struct ResizeInfo {
 
	uint step_height; ///< Step-size of height resize changes
 
};
 

	
 
enum SortButtonState {
 
	SBS_OFF,
 
	SBS_DOWN,
 
	SBS_UP,
 
};
 

	
 
/**
 
 * Data structure for a window viewport
 
 */
 
@@ -322,6 +328,10 @@ public:
 
	void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
 
	void InvalidateWidget(byte widget_index) const;
 

	
 
	void DrawWidgets() const;
 
	void DrawViewport() const;
 
	void DrawSortButtonState(int widget, SortButtonState state) const;
 

	
 
	void SetDirty() const;
 

	
 
	/*** Event handling ***/
 
@@ -612,8 +622,6 @@ Wcls *AllocateWindowDescFront(const Wind
 
	return new Wcls(desc, window_number);
 
}
 

	
 
void DrawWindowViewport(const Window *w);
 

	
 
void RelocateAllWindows(int neww, int newh);
 

	
 
/* misc_gui.cpp */
 
@@ -625,17 +633,6 @@ static inline void GuiShowTooltips(Strin
 

	
 
/* widget.cpp */
 
int GetWidgetFromPos(const Window *w, int x, int y);
 
void DrawWindowWidgets(const Window *w);
 

	
 
enum SortButtonState {
 
	SBS_OFF,
 
	SBS_DOWN,
 
	SBS_UP,
 
};
 

	
 
void DrawSortButtonState(const Window *w, int widget, SortButtonState state);
 

	
 

	
 

	
 
/* window.cpp */
 
extern Window *_z_windows[];
0 comments (0 inline, 0 general)