diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-11-18 21:00:48 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-11-18 21:00:48 +0100 |
commit | c1973bc4d4ec9d8d18a690359a2d649905e35264 (patch) | |
tree | 045c4d5afc28422319c4e20322fbafe97fefd280 /plugingui/lineedit.cc | |
parent | f11a61a36fa5e21b0c6c2362af2952a3f87408a0 (diff) |
Refactored Slider. Expanded all event variable names (all was 'e' before). Changed all uievent enums to enum classes.
Diffstat (limited to 'plugingui/lineedit.cc')
-rw-r--r-- | plugingui/lineedit.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugingui/lineedit.cc b/plugingui/lineedit.cc index ff936f4..1a9b8c8 100644 --- a/plugingui/lineedit.cc +++ b/plugingui/lineedit.cc @@ -96,7 +96,7 @@ void LineEdit::buttonEvent(ButtonEvent *buttonEvent) return; } - if(buttonEvent->direction == ButtonEvent::Down) + if(buttonEvent->direction == Direction::down) { for(int i = 0; i < (int)visibleText.length(); ++i) { @@ -120,10 +120,10 @@ void LineEdit::keyEvent(KeyEvent *keyEvent) bool change = false; - if(keyEvent->direction == KeyEvent::Up) + if(keyEvent->direction == Direction::up) { switch(keyEvent->keycode) { - case KeyEvent::KeyLeft: + case Key::left: if(pos == 0) { return; @@ -137,7 +137,7 @@ void LineEdit::keyEvent(KeyEvent *keyEvent) } break; - case KeyEvent::KeyRight: + case Key::right: if(pos == _text.length()) { return; @@ -151,19 +151,19 @@ void LineEdit::keyEvent(KeyEvent *keyEvent) } break; - case KeyEvent::KeyHome: + case Key::home: pos = 0; visibleText = _text; offsetPos = 0; break; - case KeyEvent::KeyEnd: + case Key::end: pos = _text.length(); visibleText = _text; offsetPos = 0; break; - case KeyEvent::KeyDelete: + case Key::deleteKey: if(pos < _text.length()) { std::string t = _text.substr(0, pos); @@ -173,7 +173,7 @@ void LineEdit::keyEvent(KeyEvent *keyEvent) } break; - case KeyEvent::KeyBackspace: + case Key::backspace: if(pos > 0) { std::string t = _text.substr(0, pos - 1); @@ -184,7 +184,7 @@ void LineEdit::keyEvent(KeyEvent *keyEvent) } break; - case KeyEvent::KeyCharacter: + case Key::character: { std::string pre = _text.substr(0, pos); std::string post = _text.substr(pos, std::string::npos); @@ -194,7 +194,7 @@ void LineEdit::keyEvent(KeyEvent *keyEvent) } break; - case KeyEvent::KeyEnter: + case Key::enter: enterPressedNotifier(); break; |