summaryrefslogtreecommitdiff
path: root/plugingui/knob.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/knob.cc')
-rw-r--r--plugingui/knob.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugingui/knob.cc b/plugingui/knob.cc
index 75a7278..d60ecc4 100644
--- a/plugingui/knob.cc
+++ b/plugingui/knob.cc
@@ -64,6 +64,17 @@ void GUI::Knob::registerClickHandler(void (*handler)(void *), void *ptr)
this->ptr = ptr;
}
+void GUI::Knob::scrollEvent(ScrollEvent *e)
+{
+ val -= e->delta / 200.0;
+ if(val < 0) val = 0;
+ if(val > 1) val = 1;
+
+ if(handler) handler(ptr);
+
+ repaintEvent(NULL);
+}
+
void GUI::Knob::mouseMoveEvent(MouseMoveEvent *e)
{
if(state == down) {