diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-08 03:15:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-08 03:23:43 +0300 |
commit | f1c17766c66394ce875854430f8f028c0fa5b3a5 (patch) | |
tree | d42df4e515bff99c577d44a381dbb143d21833e9 /src/gui/widgets/dropdown.cpp | |
parent | 327c7e01b95263961d1e3ecd450939de01262346 (diff) | |
download | manaplus-f1c17766c66394ce875854430f8f028c0fa5b3a5.tar.gz manaplus-f1c17766c66394ce875854430f8f028c0fa5b3a5.tar.bz2 manaplus-f1c17766c66394ce875854430f8f028c0fa5b3a5.tar.xz manaplus-f1c17766c66394ce875854430f8f028c0fa5b3a5.zip |
Add additional sorting methods to inventory:
by weight, by amount, by type.
Diffstat (limited to 'src/gui/widgets/dropdown.cpp')
-rw-r--r-- | src/gui/widgets/dropdown.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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() |