diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-01-08 12:43:07 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-01-22 23:15:29 +0100 |
commit | 414606b64aa6c6cf3209861b81a92a6af873937f (patch) | |
tree | 408992e785dde59748aa2f94bd8666f190575567 /dggui/combobox.cc | |
parent | 235ad6fbbce2e0ae9e06db960a5ba3b099936ace (diff) |
Make UI events const refs and celan up redundant use of virtual with override.event_cleanup
Diffstat (limited to 'dggui/combobox.cc')
-rw-r--r-- | dggui/combobox.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dggui/combobox.cc b/dggui/combobox.cc index 33765e2..51e5868 100644 --- a/dggui/combobox.cc +++ b/dggui/combobox.cc @@ -40,7 +40,7 @@ void ComboBox::listboxSelectHandler() { ButtonEvent buttonEvent; buttonEvent.direction = Direction::down; - this->buttonEvent(&buttonEvent); + this->buttonEvent(buttonEvent); } ComboBox::ComboBox(Widget* parent) @@ -95,7 +95,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* repaintEvent) +void ComboBox::repaintEvent(const RepaintEvent& repaintEvent) { Painter p(*this); @@ -129,7 +129,7 @@ void ComboBox::repaintEvent(RepaintEvent* repaintEvent) } } -void ComboBox::scrollEvent(ScrollEvent* scrollEvent) +void ComboBox::scrollEvent(const ScrollEvent& scrollEvent) { /* scroll_offset += e->delta; @@ -145,15 +145,15 @@ void ComboBox::scrollEvent(ScrollEvent* scrollEvent) */ } -void ComboBox::keyEvent(KeyEvent* keyEvent) +void ComboBox::keyEvent(const KeyEvent& keyEvent) { - if(keyEvent->direction != Direction::up) + if(keyEvent.direction != Direction::up) { return; } /* - switch(keyEvent->keycode) { + switch(keyEvent.keycode) { case Key::up: { selected--; @@ -205,15 +205,15 @@ void ComboBox::keyEvent(KeyEvent* keyEvent) */ } -void ComboBox::buttonEvent(ButtonEvent* buttonEvent) +void ComboBox::buttonEvent(const ButtonEvent& buttonEvent) { // Ignore everything except left clicks. - if(buttonEvent->button != MouseButton::left) + if(buttonEvent.button != MouseButton::left) { return; } - if(buttonEvent->direction != Direction::down) + if(buttonEvent.direction != Direction::down) { return; } |