Use base class handle() in Region.
This commit is contained in:
parent
ff0614c7ae
commit
9e23dd5878
30
Region.C
30
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;
|
||||
}
|
||||
}
|
||||
|
|
10
Region.H
10
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 );
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue