From 03385eb347fb16b850295b804e8b8c52840addf6 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 5 Mar 2008 16:51:04 -0600 Subject: [PATCH] Clean up track widget event handling. --- Region.C | 21 ++++++--------------- Track_Widget.C | 13 +++++-------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/Region.C b/Region.C index de438f0..2c66e4b 100644 --- a/Region.C +++ b/Region.C @@ -257,7 +257,7 @@ Region::handle ( int m ) log_end(); Loggable::block_end(); - return 1; + return 0; } } default: @@ -273,16 +273,12 @@ Region::handle ( int m ) ox = x() - X; oy = y() - Y; - if ( Fl::event_state() && FL_CTRL ) - { + if ( Fl::event_ctrl() ) os = _start; -// Fl::local_grab( this ); - } - - if ( Fl::event_button() == 2 ) + if ( Fl::event_button2() ) { - if ( Fl::event_state() & FL_CTRL ) + if ( Fl::event_ctrl() ) normalize(); else { @@ -298,12 +294,8 @@ Region::handle ( int m ) redraw(); goto changed; } - - - ret = Track_Widget::handle( m ); - - return ret | 1; - + else + return Track_Widget::handle( m ); } break; } @@ -398,7 +390,6 @@ Region::handle ( int m ) changed: -// log_end(); return 1; } diff --git a/Track_Widget.C b/Track_Widget.C index 5a4d623..682a75d 100644 --- a/Track_Widget.C +++ b/Track_Widget.C @@ -125,21 +125,18 @@ Track_Widget::handle ( int m ) return 1; case FL_PUSH: { - -/* ox = x() - X; */ -/* oy = y() - Y; */ - if ( Fl::event_state() & FL_CTRL && - Fl::event_button() == 3 ) + Fl::event_button3() ) { -// log_destroy(); - redraw(); _track->queue_delete( this ); return 0; } + else + if ( Fl::event_button1() ) + return 1; - return 1; + return 0; } case FL_RELEASE: if ( _drag )