diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-11-14 18:36:55 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-11-14 18:36:55 +0100 |
commit | f11a61a36fa5e21b0c6c2362af2952a3f87408a0 (patch) | |
tree | 2c1570a2ce1ca0a2e674383134cbd091ae8217d7 /plugingui/listboxbasic.h | |
parent | bfdb184d349d2b8ecf4ea993793182cb32098e12 (diff) |
Refactor ScrollBar, and fix keyboard navigation in listbox.
Diffstat (limited to 'plugingui/listboxbasic.h')
-rw-r--r-- | plugingui/listboxbasic.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/plugingui/listboxbasic.h b/plugingui/listboxbasic.h index ef6aceb..1ada745 100644 --- a/plugingui/listboxbasic.h +++ b/plugingui/listboxbasic.h @@ -48,8 +48,8 @@ public: ListBoxBasic(Widget *parent); ~ListBoxBasic(); - void addItem(std::string name, std::string value); - void addItems(std::vector<Item> &items); + void addItem(const std::string& name, const std::string& value); + void addItems(const std::vector<Item>& items); void clear(); bool selectItem(int index); @@ -58,19 +58,23 @@ public: void clearSelectedValue(); + Notifier<> selectionNotifier; + Notifier<> clickNotifier; + Notifier<> valueChangedNotifier; + + // From Widget: + virtual void resize(int w, int h) override; + +protected: + void onScrollBarValueChange(int value); + // From Widget: bool isFocusable() override { return true; } virtual void repaintEvent(RepaintEvent *e) override; virtual void buttonEvent(ButtonEvent *e) override; - virtual void scrollEvent(ScrollEvent *e) override; virtual void keyEvent(KeyEvent *e) override; - virtual void resize(int w, int h) override; - - Notifier<> selectionNotifier; - Notifier<> clickNotifier; - Notifier<> valueChangedNotifier; + virtual void scrollEvent(ScrollEvent *e) override; -private: ScrollBar scroll; Image bg_img; |