diff --git a/Region.C b/Region.C index 195922f..62b1260 100644 --- a/Region.C +++ b/Region.C @@ -133,6 +133,9 @@ Region::handle ( int m ) int X = Fl::event_x(); int Y = Fl::event_y(); + int ret; + + switch ( m ) { case FL_PUSH: @@ -168,13 +171,13 @@ Region::handle ( int m ) // Fl::local_grab( this ); } + ret = Track_Widget::handle( m ); + return ret | 1; + /* if ( Fl::event_button() == 2 ) */ /* normalize(); */ - - return 1; } - return 0; break; } case FL_RELEASE: @@ -223,21 +226,6 @@ Region::handle ( int m ) } } - if ( ox + X >= _track->x() ) - { - int nx = ox + X; - -// nx = _track->snap( this, nx ); - -// _offset = timeline.x_to_ts( nx ); - -// position( nx, y() ); - - _offset = timeline.x_to_ts( nx ) + timeline.xoffset; - - _track->snap( this ); - } - if ( Y > y() + h() ) { if ( _track->next() ) @@ -252,7 +240,8 @@ Region::handle ( int m ) _track->redraw(); - fl_cursor( FL_CURSOR_MOVE ); + ret = Track_Widget::handle( m ); + return ret | 1; /* if ( X >= timeline.scroll->x() + timeline.scroll->w() || */ /* X <= timeline.scroll->x() ) */ @@ -274,9 +263,8 @@ Region::handle ( int m ) // _offset = timeline.x_to_ts( x() ); - return 1; default: - return 0; + return Track_Widget::handle( m ); break; } } diff --git a/Region.H b/Region.H index f745e50..d6d51a8 100644 --- a/Region.H +++ b/Region.H @@ -140,6 +140,12 @@ public: return 0; } } + + bool + operator< ( const Track_Widget & rhs ) + { + return _offset < rhs._offset; + } }; @@ -183,7 +189,9 @@ public: snprintf( pat, 40, "%.1f", _tempo ); fl_font( FL_HELVETICA, 14 ); - fl_color( FL_YELLOW ); + fl_color( FL_BLACK ); + fl_draw( pat, x() + w() + 1, Y + 1, w(), h(), FL_ALIGN_LEFT ); + fl_color( FL_WHITE ); fl_draw( pat, x() + w(), Y, w(), h(), FL_ALIGN_LEFT ); }