From c1973bc4d4ec9d8d18a690359a2d649905e35264 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 18 Nov 2015 21:00:48 +0100 Subject: Refactored Slider. Expanded all event variable names (all was 'e' before). Changed all uievent enums to enum classes. --- plugingui/lineedit.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'plugingui/lineedit.cc') 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; -- cgit v1.2.3