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/widgets/dropdown.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/widgets/dropdown.cpp')
-rw-r--r-- | src/widgets/dropdown.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index ffba1a6b6..b0beca0fe 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -90,7 +90,7 @@ static const NWidgetPart _nested_dropdown_menu_widgets[] = { EndContainer(), }; -const WindowDesc _dropdown_desc( +static WindowDesc _dropdown_desc( WDP_MANUAL, 0, 0, WC_DROPDOWN_MENU, WC_NONE, 0, @@ -124,11 +124,12 @@ struct DropdownWindow : Window { * @param scroll Dropdown menu has a scrollbar. * @param widget Widgets of the dropdown menu window. */ - DropdownWindow(Window *parent, DropDownList *list, int selected, int button, bool instant_close, const Point &position, const Dimension &size, Colours wi_colour, bool scroll) : Window() + DropdownWindow(Window *parent, DropDownList *list, int selected, int button, bool instant_close, const Point &position, const Dimension &size, Colours wi_colour, bool scroll) + : Window(&_dropdown_desc) { this->position = position; - this->CreateNestedTree(&_dropdown_desc); + this->CreateNestedTree(); this->vscroll = this->GetScrollbar(WID_DM_SCROLL); @@ -142,7 +143,7 @@ struct DropdownWindow : Window { this->GetWidget<NWidgetStacked>(WID_DM_SHOW_SCROLL)->SetDisplayedPlane(scroll ? 0 : SZSP_NONE); - this->FinishInitNested(&_dropdown_desc, 0); + this->FinishInitNested(0); CLRBITS(this->flags, WF_WHITE_BORDER); /* Total length of list */ @@ -183,7 +184,7 @@ struct DropdownWindow : Window { DeleteDropDownList(this->list); } - 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) { return this->position; } |