summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-14 01:18:59 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-15 22:26:03 +0300
commit62a466e53cbb49c5338f8ea7f96b46e00d3b0bc4 (patch)
tree9d69e63c1d2263aadd49afa551c23aff8ec51c2b /src/gui/popupmenu.cpp
parent1d290d6a54c2ea6e689446551a8d16025a179177 (diff)
downloadmv-62a466e53cbb49c5338f8ea7f96b46e00d3b0bc4.tar.gz
mv-62a466e53cbb49c5338f8ea7f96b46e00d3b0bc4.tar.bz2
mv-62a466e53cbb49c5338f8ea7f96b46e00d3b0bc4.tar.xz
mv-62a466e53cbb49c5338f8ea7f96b46e00d3b0bc4.zip
Add popup list. Replace listbox in dropdown to popup list.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp17
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),