diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-18 19:47:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-18 19:47:28 +0300 |
commit | 7da95c7f4da447876458a0b1a17736b9a2865844 (patch) | |
tree | 4b6ac0ab5bc32a11234a5363de95d0cfec8cb7d5 /src/gui/widgets/listbox.cpp | |
parent | 515ce6c1413b5e3da131f3e4997abdc39c003a2c (diff) | |
download | manaverse-7da95c7f4da447876458a0b1a17736b9a2865844.tar.gz manaverse-7da95c7f4da447876458a0b1a17736b9a2865844.tar.bz2 manaverse-7da95c7f4da447876458a0b1a17736b9a2865844.tar.xz manaverse-7da95c7f4da447876458a0b1a17736b9a2865844.zip |
Move inputaction into separate file.
Diffstat (limited to 'src/gui/widgets/listbox.cpp')
-rw-r--r-- | src/gui/widgets/listbox.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index ceb3c1669..ab5e8dccb 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -67,6 +67,7 @@ #include "client.h" +#include "input/inputaction.h" #include "input/keydata.h" #include "listeners/selectionlistener.h" @@ -230,12 +231,12 @@ void ListBox::draw(Graphics *graphics) void ListBox::keyPressed(KeyEvent &event) { const int action = event.getActionId(); - if (action == Input::KEY_GUI_SELECT) + if (action == InputAction::GUI_SELECT) { distributeActionEvent(); event.consume(); } - else if (action == Input::KEY_GUI_UP) + else if (action == InputAction::GUI_UP) { if (mSelected > 0) setSelected(mSelected - 1); @@ -243,7 +244,7 @@ void ListBox::keyPressed(KeyEvent &event) setSelected(getListModel()->getNumberOfElements() - 1); event.consume(); } - else if (action == Input::KEY_GUI_DOWN) + else if (action == InputAction::GUI_DOWN) { const int num = getListModel()->getNumberOfElements() - 1; if (mSelected < num) @@ -252,12 +253,12 @@ void ListBox::keyPressed(KeyEvent &event) setSelected(0); event.consume(); } - else if (action == Input::KEY_GUI_HOME) + else if (action == InputAction::GUI_HOME) { setSelected(0); event.consume(); } - else if (action == Input::KEY_GUI_END && getListModel()) + else if (action == InputAction::GUI_END && getListModel()) { setSelected(getListModel()->getNumberOfElements() - 1); event.consume(); |