From 56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 26 May 2013 19:23:42 +0000 Subject: (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. --- src/widgets/dropdown.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/widgets') 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(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; } -- cgit v1.2.3-54-g00ecf