diff options
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 4d781f5ac..5a75cb71d 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -70,6 +70,8 @@ #include "utils/gettext.h" +#include <guichan/listmodel.hpp> + #include "debug.h" extern int serverVersion; @@ -2187,6 +2189,21 @@ void PopupMenu::addPickupFilter(const std::string &name) } } +void PopupMenu::showPopup(const int x, const int y, gcn::ListModel *model) +{ + if (!model) + return; + + mBrowserBox->clearRows(); + for (int f = 0, sz = model->getNumberOfElements(); f < sz; f ++) + { + mBrowserBox->addRow(strprintf("dropdown_%d", f), + model->getElementAt(f).c_str()); + } + mBrowserBox->addRow("cancel", _("Cancel")); + showPopup(x, y); +} + RenameListener::RenameListener() : gcn::ActionListener(), mMapItem(nullptr), |