summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-18 19:47:28 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-18 19:47:28 +0300
commit7da95c7f4da447876458a0b1a17736b9a2865844 (patch)
tree4b6ac0ab5bc32a11234a5363de95d0cfec8cb7d5 /src/gui/widgets/textbox.cpp
parent515ce6c1413b5e3da131f3e4997abdc39c003a2c (diff)
downloadmv-7da95c7f4da447876458a0b1a17736b9a2865844.tar.gz
mv-7da95c7f4da447876458a0b1a17736b9a2865844.tar.bz2
mv-7da95c7f4da447876458a0b1a17736b9a2865844.tar.xz
mv-7da95c7f4da447876458a0b1a17736b9a2865844.zip
Move inputaction into separate file.
Diffstat (limited to 'src/gui/widgets/textbox.cpp')
-rw-r--r--src/gui/widgets/textbox.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 917c613c5..23fa63a07 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -65,6 +65,7 @@
#include "gui/widgets/textbox.h"
+#include "input/inputaction.h"
#include "input/keydata.h"
#include "gui/gui.h"
@@ -256,7 +257,7 @@ void TextBox::keyPressed(KeyEvent& event)
switch (action)
{
- case Input::KEY_GUI_LEFT:
+ case InputAction::GUI_LEFT:
{
--mCaretColumn;
if (mCaretColumn < 0)
@@ -277,7 +278,7 @@ void TextBox::keyPressed(KeyEvent& event)
break;
}
- case Input::KEY_GUI_RIGHT:
+ case InputAction::GUI_RIGHT:
{
++mCaretColumn;
if (mCaretColumn > static_cast<int>(mTextRows[mCaretRow].size()))
@@ -302,28 +303,28 @@ void TextBox::keyPressed(KeyEvent& event)
break;
}
- case Input::KEY_GUI_DOWN:
+ case InputAction::GUI_DOWN:
{
setCaretRow(mCaretRow + 1);
break;
}
- case Input::KEY_GUI_UP:
+ case InputAction::GUI_UP:
{
setCaretRow(mCaretRow - 1);
break;
}
- case Input::KEY_GUI_HOME:
+ case InputAction::GUI_HOME:
{
mCaretColumn = 0;
break;
}
- case Input::KEY_GUI_END:
+ case InputAction::GUI_END:
{
mCaretColumn = static_cast<int>(mTextRows[mCaretRow].size());
break;
}
- case Input::KEY_GUI_SELECT2:
+ case InputAction::GUI_SELECT2:
{
if (mEditable)
{
@@ -337,7 +338,7 @@ void TextBox::keyPressed(KeyEvent& event)
break;
}
- case Input::KEY_GUI_BACKSPACE:
+ case InputAction::GUI_BACKSPACE:
{
if (mCaretColumn != 0 && mEditable)
{
@@ -355,7 +356,7 @@ void TextBox::keyPressed(KeyEvent& event)
break;
}
- case Input::KEY_GUI_DELETE:
+ case InputAction::GUI_DELETE:
{
if (mCaretColumn < static_cast<int>(
mTextRows[mCaretRow].size()) && mEditable)
@@ -373,7 +374,7 @@ void TextBox::keyPressed(KeyEvent& event)
break;
}
- case Input::KEY_GUI_PAGE_UP:
+ case InputAction::GUI_PAGE_UP:
{
Widget *const par = getParent();
@@ -389,7 +390,7 @@ void TextBox::keyPressed(KeyEvent& event)
break;
}
- case Input::KEY_GUI_PAGE_DOWN:
+ case InputAction::GUI_PAGE_DOWN:
{
Widget *const par = getParent();
@@ -406,7 +407,7 @@ void TextBox::keyPressed(KeyEvent& event)
break;
}
- case Input::KEY_GUI_TAB:
+ case InputAction::GUI_TAB:
{
if (mEditable)
{