From 453d7bcd4ec540b5178e4f9403fea7d5995ef73b Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 30 Jan 2010 02:38:15 -0600 Subject: [PATCH] Mixer: Clean up event handling. --- Mixer/Meter.H | 2 +- Mixer/Mixer.C | 9 +++------ Mixer/Mixer.H | 2 +- Mixer/Mixer_Strip.C | 20 +++++--------------- Mixer/Module.C | 2 +- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/Mixer/Meter.H b/Mixer/Meter.H index 6ea99c4..8468c7a 100644 --- a/Mixer/Meter.H +++ b/Mixer/Meter.H @@ -43,7 +43,7 @@ protected: return 1; } - return Fl_Widget::handle( m ); + return Fl_Valuator::handle( m ); } float diff --git a/Mixer/Mixer.C b/Mixer/Mixer.C index 3e563e7..88415ab 100644 --- a/Mixer/Mixer.C +++ b/Mixer/Mixer.C @@ -495,18 +495,15 @@ Mixer::save_options ( void ) int Mixer::handle ( int m ) { - int r = Fl_Group::handle( m ); + if ( Fl_Group::handle( m ) ) + return 1; switch ( m ) { case FL_ENTER: case FL_LEAVE: return 1; - default: - return r; - break; } - // return 0; - return r; + return 0; } diff --git a/Mixer/Mixer.H b/Mixer/Mixer.H index bc64451..1eba257 100644 --- a/Mixer/Mixer.H +++ b/Mixer/Mixer.H @@ -58,7 +58,7 @@ private: protected: - virtual int handle ( int m ); + int handle ( int m ); public: diff --git a/Mixer/Mixer_Strip.C b/Mixer/Mixer_Strip.C index 9cb3ab4..a6b408e 100644 --- a/Mixer/Mixer_Strip.C +++ b/Mixer/Mixer_Strip.C @@ -546,16 +546,19 @@ Mixer_Strip::handle ( int m ) switch ( m ) { case FL_KEYBOARD: + { if ( Fl_Group::handle( m ) ) return 1; - if ( test_press( FL_Menu ) ) + if ( Fl::event_key() == FL_Menu ) { menu_popup( &menu(), x(), y() ); return 1; } - else + else return menu().test_shortcut() != 0; + } + break; case FL_PUSH: { if ( Fl_Group::handle( m ) ) @@ -576,19 +579,6 @@ Mixer_Strip::handle ( int m ) _focused = false; damage( FL_DAMAGE_USER1 ); return 1; -/* case FL_ENTER: */ -/* name_field->color( FL_BLACK ); */ -/* name_field->redraw(); */ -/* return 1; */ -/* break; */ -/* case FL_LEAVE: */ -/* name_field->color( _color ); */ -/* name_field->redraw(); */ -/* return 1; */ -/* break; */ - default: - return Fl_Group::handle( m ); - } return Fl_Group::handle( m ); diff --git a/Mixer/Module.C b/Mixer/Module.C index 587b1cc..2bec441 100644 --- a/Mixer/Module.C +++ b/Mixer/Module.C @@ -462,7 +462,7 @@ Module::handle ( int m ) if ( Fl_Group::handle( m ) ) return 1; - if ( test_press( FL_Menu ) ) + if ( Fl::event_key() == FL_Menu ) { menu_popup( &menu(), x(), y() ); return 1;