From f1c17766c66394ce875854430f8f028c0fa5b3a5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2011 03:15:52 +0300 Subject: Add additional sorting methods to inventory: by weight, by amount, by type. --- src/gui/widgets/dropdown.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets/dropdown.cpp') diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index f01d3fb55..687d7dc6d 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -46,7 +46,8 @@ Image *DropDown::buttons[2][2]; ImageRect DropDown::skin; float DropDown::mAlpha = 1.0; -DropDown::DropDown(gcn::ListModel *listModel): +DropDown::DropDown(gcn::ListModel *listModel, gcn::ActionListener* listener, + std::string eventId): gcn::DropDown::DropDown(listModel, new ScrollArea, new ListBox(listModel)) @@ -105,6 +106,12 @@ DropDown::DropDown(gcn::ListModel *listModel): mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT); mShadowColor = Theme::getThemeColor(Theme::DROPDOWN_SHADOW); setForegroundColor(Theme::getThemeColor(Theme::TEXT)); + + if (!eventId.empty()) + setActionEventId(eventId); + + if (listener) + addActionListener(listener); } DropDown::~DropDown() -- cgit v1.2.3-60-g2f50