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/bridge_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/bridge_gui.cpp')
-rw-r--r-- | src/bridge_gui.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 4a349b605..e6a0812a5 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -134,17 +134,17 @@ private: } public: - BuildBridgeWindow(const WindowDesc *desc, TileIndex start, TileIndex end, uint32 br_type, GUIBridgeList *bl) : Window(), + BuildBridgeWindow(WindowDesc *desc, TileIndex start, TileIndex end, uint32 br_type, GUIBridgeList *bl) : Window(desc), start_tile(start), end_tile(end), type(br_type), bridges(bl) { - this->CreateNestedTree(desc); + this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_BBS_SCROLLBAR); /* Change the data, or the caption of the gui. Set it to road or rail, accordingly. */ this->GetWidget<NWidgetCore>(WID_BBS_CAPTION)->widget_data = (GB(this->type, 15, 2) == TRANSPORT_ROAD) ? STR_SELECT_ROAD_BRIDGE_CAPTION : STR_SELECT_RAIL_BRIDGE_CAPTION; - this->FinishInitNested(desc, GB(br_type, 15, 2)); // Initializes 'this->bridgetext_offset'. + this->FinishInitNested(GB(br_type, 15, 2)); // Initializes 'this->bridgetext_offset'. this->parent = FindWindowById(WC_BUILD_TOOLBAR, GB(this->type, 15, 2)); this->bridges->SetListing(this->last_sorting); @@ -213,7 +213,7 @@ public: } } - virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number) + virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) { /* Position the window so hopefully the first bridge from the list is under the mouse pointer. */ NWidgetBase *list = this->GetWidget<NWidgetBase>(WID_BBS_BRIDGE_LIST); @@ -351,7 +351,7 @@ static const NWidgetPart _nested_build_bridge_widgets[] = { }; /** Window definition for the rail bridge selection window. */ -static const WindowDesc _build_bridge_desc( +static WindowDesc _build_bridge_desc( WDP_AUTO, 200, 114, WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, |