Clean up track widget event handling some.

This commit is contained in:
Jonathan Moore Liles 2008-03-06 13:30:08 -06:00
parent 01a1e5846c
commit f58e156e3a
2 changed files with 18 additions and 23 deletions

View File

@ -236,8 +236,8 @@ Region::handle ( int m )
case FL_PUSH:
{
if ( Fl::event_state() & FL_SHIFT &&
! ( Fl::event_state() & FL_CTRL ))
/* trimming / splitting */
if ( Fl::event_shift() && ! Fl::event_ctrl() )
{
switch ( Fl::event_button() )
{
@ -283,10 +283,10 @@ Region::handle ( int m )
{
ox = x() - X;
oy = y() - Y;
/* for panning */
os = _start;
if ( Fl::event_ctrl() )
os = _start;
/* normalization and selection */
if ( Fl::event_button2() )
{
if ( Fl::event_ctrl() )
@ -305,6 +305,11 @@ Region::handle ( int m )
redraw();
goto changed;
}
if ( Fl::event_button1() && Fl::event_ctrl() )
{
/* duplication */
return 1;
}
else
return Track_Widget::handle( m );
}
@ -313,18 +318,11 @@ Region::handle ( int m )
case FL_RELEASE:
{
Track_Widget::handle( m );
copied = false;
if ( trimming != NO )
{
trimming = NO;
// _log.release();
}
/* delete _drag; */
/* _drag = NULL; */
goto changed;
}
@ -336,6 +334,7 @@ Region::handle ( int m )
_log.hold();
}
/* panning */
if ( Fl::event_state() & FL_SHIFT &&
Fl::event_state() & FL_CTRL )
{
@ -355,6 +354,7 @@ Region::handle ( int m )
return 1;
}
/* trimming */
if ( Fl::event_state() & FL_SHIFT )
if ( trimming )
{
@ -364,7 +364,7 @@ Region::handle ( int m )
else
return 0;
/* duplication */
if ( Fl::event_state() & FL_CTRL )
{
if ( _drag->state == 0 )
@ -375,6 +375,7 @@ Region::handle ( int m )
}
}
/* track jumping */
if ( ! selected() )
{
if ( Y > y() + h() )

View File

@ -143,6 +143,7 @@ Track_Widget::handle ( int m )
return 1;
case FL_PUSH:
{
/* deletion */
if ( Fl::event_state() & FL_CTRL &&
Fl::event_button3() )
{
@ -165,6 +166,7 @@ Track_Widget::handle ( int m )
}
fl_cursor( FL_CURSOR_HAND );
return 1;
case FL_DRAG:
{
@ -175,11 +177,9 @@ Track_Widget::handle ( int m )
_log.hold();
}
const int ox = _drag->x;
// _current->_drag->x;
fl_cursor( FL_CURSOR_MOVE );
/* const int ox = _drag->x; */
/* const int oy = _drag->y; */
const int ox = _drag->x;
redraw();
@ -194,10 +194,6 @@ Track_Widget::handle ( int m )
_track->snap( this );
}
// _track->redraw();
fl_cursor( FL_CURSOR_MOVE );
if ( X >= _track->x() + _track->w() ||
X <= _track->x() )
{
@ -220,10 +216,8 @@ Track_Widget::handle ( int m )
timeline->position( timeline->ts_to_x( pos ) );
_track->redraw();
// timeline->redraw();
}
return 1;
}
default: