From 78afcbe019ee222ef3deb1a9e16b0c686b00542a Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Tue, 4 Mar 2008 20:12:54 -0600 Subject: [PATCH] Work on selection operations more. --- Region.C | 28 +++++++++++++++++----------- Timeline.C | 2 +- main.C | 7 ------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Region.C b/Region.C index f698dfc..de438f0 100644 --- a/Region.C +++ b/Region.C @@ -152,6 +152,7 @@ void Region::trim ( enum trim_e t, int X ) { + X -= _track->x(); redraw(); switch ( t ) @@ -204,15 +205,14 @@ Region::trim ( enum trim_e t, int X ) int Region::handle ( int m ) { - static bool dragging = false; - static int ox, oy; static enum trim_e trimming; static bool copied = false; static nframes_t os; - int X = Fl::event_x() - _track->x(); +// int X = Fl::event_x() - _track->x(); + int X = Fl::event_x(); int Y = Fl::event_y(); int ret; @@ -232,10 +232,12 @@ Region::handle ( int m ) { case 1: trim( trimming = LEFT, X ); + _drag = new Drag( x() - X, y() - Y ); _log.hold(); break; case 3: trim( trimming = RIGHT, X ); + _drag = new Drag( x() - X, y() - Y ); _log.hold(); break; case 2: @@ -306,24 +308,29 @@ Region::handle ( int m ) break; } case FL_RELEASE: + + { + Track_Widget::handle( m ); + copied = false; if ( trimming != NO ) { trimming = NO; - _log.release(); +// _log.release(); } - if ( dragging ) - _log.release(); - dragging = false; +/* delete _drag; */ +/* _drag = NULL; */ + goto changed; + } case FL_DRAG: - if ( ! dragging ) + if ( ! _drag ) { + _drag = new Drag( x() - X, y() - Y ); _log.hold(); - dragging = true; } if ( Fl::event_state() & FL_SHIFT && @@ -354,7 +361,6 @@ Region::handle ( int m ) else return 0; - ret = Track_Widget::handle( m ); if ( Fl::event_state() & FL_CTRL ) { @@ -383,7 +389,7 @@ Region::handle ( int m ) } } -// ret = Track_Widget::handle( m ); + ret = Track_Widget::handle( m ); return ret | 1; default: return Track_Widget::handle( m ); diff --git a/Timeline.C b/Timeline.C index b144333..f2d07bb 100644 --- a/Timeline.C +++ b/Timeline.C @@ -77,7 +77,7 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Wi { Scalebar *o = new Scalebar( X, Y + H - 18, W - 18, 18 ); - o->range( 0, 48000 * 2 ); + o->range( 0, 48000 * 300 ); o->zoom_range( 2, 8192 ); o->zoom( 256 ); o->type( FL_HORIZONTAL ); diff --git a/main.C b/main.C index f28a4c2..c03e4b6 100644 --- a/main.C +++ b/main.C @@ -54,14 +54,7 @@ Timeline *timeline; void cb_undo ( Fl_Widget *w, void *v ) { -/* static char pat[20]; */ - - Loggable::undo(); - -/* sprintf( pat, "undo %d", Loggable::undo_index() ); */ -/* w->label( pat ); */ - } int