Browse Source

Add mousewheel handling.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
c88ef27abf
1 changed files with 31 additions and 0 deletions
  1. +31
    -0
      Fl_Arc_Dial.H

+ 31
- 0
Fl_Arc_Dial.H View File

@@ -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 )
{


Loading…
Cancel
Save