Clean up track widget event handling.

This commit is contained in:
Jonathan Moore Liles 2008-03-05 16:51:04 -06:00
parent 0cbfaff090
commit 03385eb347
2 changed files with 11 additions and 23 deletions

View File

@ -257,7 +257,7 @@ Region::handle ( int m )
log_end(); log_end();
Loggable::block_end(); Loggable::block_end();
return 1; return 0;
} }
} }
default: default:
@ -273,16 +273,12 @@ Region::handle ( int m )
ox = x() - X; ox = x() - X;
oy = y() - Y; oy = y() - Y;
if ( Fl::event_state() && FL_CTRL ) if ( Fl::event_ctrl() )
{
os = _start; os = _start;
// Fl::local_grab( this );
}
if ( Fl::event_button2() )
if ( Fl::event_button() == 2 )
{ {
if ( Fl::event_state() & FL_CTRL ) if ( Fl::event_ctrl() )
normalize(); normalize();
else else
{ {
@ -298,12 +294,8 @@ Region::handle ( int m )
redraw(); redraw();
goto changed; goto changed;
} }
else
return Track_Widget::handle( m );
ret = Track_Widget::handle( m );
return ret | 1;
} }
break; break;
} }
@ -398,7 +390,6 @@ Region::handle ( int m )
changed: changed:
// log_end();
return 1; return 1;
} }

View File

@ -125,21 +125,18 @@ Track_Widget::handle ( int m )
return 1; return 1;
case FL_PUSH: case FL_PUSH:
{ {
/* ox = x() - X; */
/* oy = y() - Y; */
if ( Fl::event_state() & FL_CTRL && if ( Fl::event_state() & FL_CTRL &&
Fl::event_button() == 3 ) Fl::event_button3() )
{ {
// log_destroy();
redraw(); redraw();
_track->queue_delete( this ); _track->queue_delete( this );
return 0; return 0;
} }
else
if ( Fl::event_button1() )
return 1;
return 1; return 0;
} }
case FL_RELEASE: case FL_RELEASE:
if ( _drag ) if ( _drag )