summaryrefslogtreecommitdiff
path: root/plugingui/listbox.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-03-09 19:34:07 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-03-09 19:34:07 +0100
commit1fe04afd8dd8addcc8902ea3c1c0f77d148cd1b7 (patch)
treea5d6804482f18d03e8d8d6bcebb3a4cd0e032850 /plugingui/listbox.h
parente03c36f2435c7b14b974d96d2081e608040a5f66 (diff)
Fix keyboard navigation logic in listbox.
Diffstat (limited to 'plugingui/listbox.h')
-rw-r--r--plugingui/listbox.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugingui/listbox.h b/plugingui/listbox.h
index 26d104b..d7a5021 100644
--- a/plugingui/listbox.h
+++ b/plugingui/listbox.h
@@ -28,7 +28,7 @@
#define __DRUMGIZMO_LISTBOX_H__
#include <string.h>
-#include <map>
+#include <vector>
#include "widget.h"
#include "font.h"
@@ -45,7 +45,7 @@ public:
void addItem(std::string name, std::string value);
void clear();
- bool selectItem(std::string name);
+ bool selectItem(int index);
std::string selectedName();
std::string selectedValue();
@@ -57,8 +57,13 @@ public:
virtual void keyEvent(KeyEvent *e);
private:
- std::map<std::string, std::string> items;
- std::string selected;
+ struct item {
+ std::string name;
+ std::string value;
+ };
+
+ std::vector<struct item> items;
+ int selected;
GUI::Font font;
int padding;
int btn_size;