Make region dragging work.

This commit is contained in:
Jonathan Moore Liles 2008-02-20 00:46:28 -06:00
parent 900c49aeae
commit 35d277d67d
1 changed files with 16 additions and 1 deletions

17
Track.C
View File

@ -125,6 +125,8 @@ Track::add ( Region *r )
int int
Track::handle ( int m ) Track::handle ( int m )
{ {
static Region *current_region;
switch ( m ) switch ( m )
{ {
case FL_DND_DRAG: case FL_DND_DRAG:
@ -172,8 +174,21 @@ Track::handle ( int m )
default: default:
{ {
Region *r = event_region(); Region *r = event_region();
if ( current_region )
r = current_region;
if ( r ) if ( r )
return r->handle( m ); {
int retval = r->handle( m );
if ( retval && m == FL_PUSH )
current_region = r;
if ( retval && m == FL_RELEASE )
current_region = NULL;
return retval;
}
else else
return Fl_Group::handle( m ); return Fl_Group::handle( m );
} }