diff options
Diffstat (limited to 'plugingui/listbox.cc')
-rw-r--r-- | plugingui/listbox.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugingui/listbox.cc b/plugingui/listbox.cc index dfb5f07..f917368 100644 --- a/plugingui/listbox.cc +++ b/plugingui/listbox.cc @@ -125,6 +125,15 @@ void GUI::ListBox::repaintEvent(GUI::RepaintEvent *e) width() - 1, height() - 1); } +void GUI::ListBox::scrollEvent(ScrollEvent *e) +{ + scroll_offset += e->delta; + if(scroll_offset < 0) scroll_offset = 0; + if(scroll_offset > (items.size() - 1)) + scroll_offset = (items.size() - 1); + repaintEvent(NULL); +} + void GUI::ListBox::buttonEvent(ButtonEvent *e) { //printf("click %d %d [dc: %d]\n", e->x, e->y, e->doubleclick); |