Make duplicate work for selection.

This commit is contained in:
Jonathan Moore Liles 2008-03-03 21:46:48 -06:00
parent 8533f49d87
commit a0c6c794fa
2 changed files with 7 additions and 4 deletions

View File

@ -353,12 +353,14 @@ Region::handle ( int m )
else
return 0;
ret = Track_Widget::handle( m );
if ( Fl::event_state() & FL_CTRL )
{
if ( ! copied )
if ( _drag->state == 0 )
{
_track->add( new Region( *this ) );
copied = true;
_drag->state = 1;
return 1;
}
}
@ -380,7 +382,7 @@ Region::handle ( int m )
}
}
ret = Track_Widget::handle( m );
// ret = Track_Widget::handle( m );
return ret | 1;
default:
return Track_Widget::handle( m );

View File

@ -50,8 +50,9 @@ protected:
/* mouse coords at start of drag */
int x;
int y;
int state;
Drag( int X, int Y ) : x( X ), y( Y ) {}
Drag( int X, int Y ) : x( X ), y( Y ) { state = 0; }
};
Drag *_drag;