Make region dragging work.
This commit is contained in:
parent
900c49aeae
commit
35d277d67d
17
Track.C
17
Track.C
|
@ -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 );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue