From 7da95c7f4da447876458a0b1a17736b9a2865844 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 18 May 2014 19:47:28 +0300 Subject: Move inputaction into separate file. --- src/gui/widgets/listbox.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/listbox.cpp') 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(); -- cgit v1.2.3-70-g09d2