Browse Source

Clean up track widget event handling.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
03385eb347
2 changed files with 11 additions and 23 deletions
  1. +6
    -15
      Region.C
  2. +5
    -8
      Track_Widget.C

+ 6
- 15
Region.C View File

@@ -257,7 +257,7 @@ Region::handle ( int m )
log_end(); log_end();


Loggable::block_end(); Loggable::block_end();
return 1;
return 0;
} }
} }
default: default:
@@ -273,16 +273,12 @@ Region::handle ( int m )
ox = x() - X; ox = x() - X;
oy = y() - Y; oy = y() - Y;


if ( Fl::event_state() && FL_CTRL )
{
if ( Fl::event_ctrl() )
os = _start; os = _start;
// Fl::local_grab( this );
}



if ( Fl::event_button() == 2 )
if ( Fl::event_button2() )
{ {
if ( Fl::event_state() & FL_CTRL )
if ( Fl::event_ctrl() )
normalize(); normalize();
else else
{ {
@@ -298,12 +294,8 @@ Region::handle ( int m )
redraw(); redraw();
goto changed; goto changed;
} }


ret = Track_Widget::handle( m );

return ret | 1;

else
return Track_Widget::handle( m );
} }
break; break;
} }
@@ -398,7 +390,6 @@ Region::handle ( int m )


changed: changed:


// log_end();
return 1; return 1;


} }


+ 5
- 8
Track_Widget.C View File

@@ -125,21 +125,18 @@ Track_Widget::handle ( int m )
return 1; return 1;
case FL_PUSH: case FL_PUSH:
{ {

/* ox = x() - X; */
/* oy = y() - Y; */

if ( Fl::event_state() & FL_CTRL && if ( Fl::event_state() & FL_CTRL &&
Fl::event_button() == 3 )
Fl::event_button3() )
{ {
// log_destroy();

redraw(); redraw();
_track->queue_delete( this ); _track->queue_delete( this );
return 0; return 0;
} }
else
if ( Fl::event_button1() )
return 1;


return 1;
return 0;
} }
case FL_RELEASE: case FL_RELEASE:
if ( _drag ) if ( _drag )


Loading…
Cancel
Save