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/combobox.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/combobox.cc')
-rw-r--r-- | plugingui/combobox.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugingui/combobox.cc b/plugingui/combobox.cc index 6e6a9c8..1323dab 100644 --- a/plugingui/combobox.cc +++ b/plugingui/combobox.cc @@ -37,12 +37,12 @@ namespace GUI { void ComboBox::listboxSelectHandler() { - ButtonEvent e; - e.direction = ButtonEvent::Down; - buttonEvent(&e); + ButtonEvent buttonEvent; + buttonEvent.direction = Direction::down; + this->buttonEvent(&buttonEvent); } -ComboBox::ComboBox(Widget *parent) +ComboBox::ComboBox(Widget* parent) : Widget(parent) , listbox(parent) { @@ -113,7 +113,7 @@ static void drawArrow(Painter &p, int x, int y, int w, int h) p.drawLine(x+(w/2), y+h, x+w, y); } -void ComboBox::repaintEvent(RepaintEvent *e) +void ComboBox::repaintEvent(RepaintEvent* repaintEvent) { Painter p(*this); @@ -148,7 +148,7 @@ void ComboBox::repaintEvent(RepaintEvent *e) } } -void ComboBox::scrollEvent(ScrollEvent *e) +void ComboBox::scrollEvent(ScrollEvent* scrollEvent) { /* scroll_offset += e->delta; @@ -164,16 +164,16 @@ void ComboBox::scrollEvent(ScrollEvent *e) */ } -void ComboBox::keyEvent(KeyEvent *e) +void ComboBox::keyEvent(KeyEvent* keyEvent) { - if(e->direction != KeyEvent::Up) + if(keyEvent->direction != Direction::up) { return; } /* - switch(e->keycode) { - case KeyEvent::KeyUp: + switch(keyEvent->keycode) { + case Key::up: { selected--; if(selected < 0) @@ -190,7 +190,7 @@ void ComboBox::keyEvent(KeyEvent *e) } } break; - case KeyEvent::KeyDown: + case Key::down: { // Number of items that can be displayed at a time. int numitems = height() / (font.textHeight() + padding); @@ -210,10 +210,10 @@ void ComboBox::keyEvent(KeyEvent *e) } } break; - case KeyEvent::KeyHome: + case Key::home: selected = 0; break; - case KeyEvent::KeyEnd: + case Key::end: selected = items.size() - 1; break; default: @@ -224,9 +224,9 @@ void ComboBox::keyEvent(KeyEvent *e) */ } -void ComboBox::buttonEvent(ButtonEvent *e) +void ComboBox::buttonEvent(ButtonEvent* buttonEvent) { - if(e->direction != ButtonEvent::Down) + if(buttonEvent->direction != Direction::down) { return; } |