From c88ef27abfd7bbe1142a6aab597cac8ab629bf88 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 14 Mar 2008 19:23:03 -0500 Subject: [PATCH] Add mousewheel handling. --- Fl_Arc_Dial.H | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Fl_Arc_Dial.H b/Fl_Arc_Dial.H index ca5d04d..d94bed0 100644 --- a/Fl_Arc_Dial.H +++ b/Fl_Arc_Dial.H @@ -34,10 +34,41 @@ public: Fl_Dial( X, Y, W, H, L ) { box( FL_OVAL_BOX ); +// step( 0.1f ); } protected: + int handle ( int m ) + { + /* Fl_Dial and friends should really handle mousewheel, but they don't in FTLK1 */ + + switch ( m ) + { + case FL_MOUSEWHEEL: + { + if ( this != Fl::belowmouse() ) + return 0; + + int d = Fl::event_dy(); + + double v = increment( value(), d ); + + if ( v < minimum() ) + v = minimum(); + else if ( v > maximum() ) + v = maximum(); + + value( v ); + + return 1; + } + } + + return Fl_Dial::handle( m ); + } + + virtual void draw ( void ) {