Browse Source

Improve the way sequence widgets are selected.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
c464c73ab9
3 changed files with 27 additions and 1 deletions
  1. +1
    -1
      Timeline/Timeline.C
  2. +24
    -0
      Timeline/Track.C
  3. +2
    -0
      Timeline/Track.H

+ 1
- 1
Timeline/Timeline.C View File

@@ -751,7 +751,7 @@ Timeline::select( const Rectangle &r )
Track *t = (Track*)tracks->child( i );

if ( ! ( t->y() > Y + r.h || t->y() + t->h() < Y ) )
t->track()->select_range( r.x, r.w );
t->select( r.x, r.y, r.w, r.h, true, true );
}
}



+ 24
- 0
Timeline/Track.C View File

@@ -365,6 +365,30 @@ Track::add ( Control_Sequence *t )
resize();
}

/** add all widget on this track falling within the given rectangle to
the selection. */
void
Track::select ( int X, int Y, int W, int H,
bool include_control, bool merge_control )
{

Sequence *t = track();

if ( ! ( t->y() > Y + H || t->y() + t->h() < Y ) )
t->select_range( X, W );
else
include_control = true;

if ( include_control )
for ( int i = control->children(); i--; )
{
Control_Sequence *c = (Control_Sequence*)control->child( i );

if ( merge_control ||
( c->y() >= Y && c->y() + c->h() <= Y + H ) )
c->select_range( X, W );
}
}

void
Track::draw ( void )


+ 2
- 0
Timeline/Track.H View File

@@ -190,6 +190,8 @@ public:
void remove ( Sequence *t );
void remove ( Control_Sequence *t );

void select ( int X, int Y, int W, int H, bool include_control, bool merge_control );

int size ( void ) const { return _size; }

void resize ( void );


Loading…
Cancel
Save