diff options
author | frosch <frosch@openttd.org> | 2013-05-26 19:23:42 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-05-26 19:23:42 +0000 |
commit | 56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b (patch) | |
tree | f3e5c225182fce7a451af4e09e943920e0f1cc3c /src/station_gui.cpp | |
parent | b10a4f151aa534860dcc61ecf8cba7b3589e6281 (diff) | |
download | openttd-56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b.tar.xz |
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
Diffstat (limited to 'src/station_gui.cpp')
-rw-r--r-- | src/station_gui.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 5623edb32..c7c033fbf 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -282,7 +282,7 @@ protected: } public: - CompanyStationsWindow(const WindowDesc *desc, WindowNumber window_number) : Window() + CompanyStationsWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) { this->stations.SetListing(this->last_sorting); this->stations.SetSortFuncs(this->sorter_funcs); @@ -290,9 +290,9 @@ public: this->stations.NeedResort(); this->SortStationsList(); - this->CreateNestedTree(desc); + this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_STL_SCROLLBAR); - this->FinishInitNested(desc, window_number); + this->FinishInitNested(window_number); this->owner = (Owner)this->window_number; const CargoSpec *cs; @@ -711,7 +711,7 @@ static const NWidgetPart _nested_company_stations_widgets[] = { EndContainer(), }; -static const WindowDesc _company_stations_desc( +static WindowDesc _company_stations_desc( WDP_AUTO, 358, 162, WC_STATION_LIST, WC_NONE, 0, @@ -816,15 +816,15 @@ struct StationViewWindow : public Window { ALH_ACCEPTS = 3, ///< Height of the accepted cargo view. }; - StationViewWindow(const WindowDesc *desc, WindowNumber window_number) : Window() + StationViewWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) { this->rating_lines = ALH_RATING; this->accepts_lines = ALH_ACCEPTS; - this->CreateNestedTree(desc); + this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_SV_SCROLLBAR); /* Nested widget tree creation is done in two steps to ensure that this->GetWidget<NWidgetCore>(WID_SV_ACCEPTS_RATINGS) exists in UpdateWidgetSize(). */ - this->FinishInitNested(desc, window_number); + this->FinishInitNested(window_number); Owner owner = Station::Get(window_number)->owner; if (owner != OWNER_NONE) this->owner = owner; @@ -1183,7 +1183,7 @@ struct StationViewWindow : public Window { }; -static const WindowDesc _station_view_desc( +static WindowDesc _station_view_desc( WDP_AUTO, 249, 110, WC_STATION_VIEW, WC_NONE, 0, @@ -1326,15 +1326,15 @@ struct SelectStationWindow : Window { TileArea area; ///< Location of new station Scrollbar *vscroll; - SelectStationWindow(const WindowDesc *desc, CommandContainer cmd, TileArea ta) : - Window(), + SelectStationWindow(WindowDesc *desc, CommandContainer cmd, TileArea ta) : + Window(desc), select_station_cmd(cmd), area(ta) { - this->CreateNestedTree(desc); + this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_JS_SCROLLBAR); this->GetWidget<NWidgetCore>(WID_JS_CAPTION)->widget_data = T::EXPECTED_FACIL == FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CAPTION : STR_JOIN_STATION_CAPTION; - this->FinishInitNested(desc, 0); + this->FinishInitNested(0); this->OnInvalidateData(0); } @@ -1427,7 +1427,7 @@ struct SelectStationWindow : Window { } }; -static const WindowDesc _select_station_desc( +static WindowDesc _select_station_desc( WDP_AUTO, 200, 180, WC_SELECT_STATION, WC_NONE, WDF_CONSTRUCTION, |