Add remove-selected binding. Work on transactions.
This commit is contained in:
parent
e2c6442dee
commit
5048f70e50
|
@ -35,5 +35,6 @@ public:
|
|||
|
||||
int handle ( int m );
|
||||
void dump ( void );
|
||||
void remove_selected ( void );
|
||||
|
||||
};
|
||||
|
|
17
Timeline.C
17
Timeline.C
|
@ -412,6 +412,23 @@ Timeline::handle ( int m )
|
|||
|
||||
switch ( m )
|
||||
{
|
||||
case FL_KEYBOARD:
|
||||
{
|
||||
switch ( Fl::event_key() )
|
||||
{
|
||||
case FL_Delete:
|
||||
{
|
||||
for ( int i = tracks->children(); i--; )
|
||||
{
|
||||
Track_Header *t = (Track_Header*)tracks->child( i );
|
||||
|
||||
t->track()->remove_selected();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* case FL_MOUSEWHEEL: */
|
||||
/* { */
|
||||
|
|
19
Track.C
19
Track.C
|
@ -82,6 +82,25 @@ Track::remove ( Track_Widget *r )
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
Track::remove_selected ( void )
|
||||
{
|
||||
Loggable::block_start();
|
||||
|
||||
for ( list <Track_Widget *>::iterator r = _widgets.begin(); r != _widgets.end(); )
|
||||
if ( (*r)->selected() )
|
||||
{
|
||||
Track_Widget *t = *r;
|
||||
_widgets.erase( r++ );
|
||||
delete t;
|
||||
}
|
||||
else
|
||||
++r;
|
||||
|
||||
Loggable::block_end();
|
||||
}
|
||||
|
||||
|
||||
Track_Widget *
|
||||
Track::event_widget ( void )
|
||||
{
|
||||
|
|
2
Track.H
2
Track.H
|
@ -112,6 +112,8 @@ public:
|
|||
void remove ( Track_Widget *r );
|
||||
void add ( Track_Widget *r );
|
||||
|
||||
void remove_selected ( void );
|
||||
|
||||
const list <Track_Widget *> widgets ( void ) const { return _widgets; }
|
||||
|
||||
void queue_delete ( Track_Widget *r )
|
||||
|
|
|
@ -48,6 +48,8 @@ private:
|
|||
|
||||
int _size;
|
||||
|
||||
enum { AUDIO } _type;
|
||||
|
||||
public:
|
||||
|
||||
Fl_Input * name_field;
|
||||
|
@ -198,6 +200,7 @@ public:
|
|||
static int width();
|
||||
|
||||
void track( Track * t );
|
||||
Track * track ( void ) { return _track; }
|
||||
|
||||
int handle ( int m )
|
||||
{
|
||||
|
|
|
@ -59,6 +59,8 @@ public:
|
|||
_track->remove( this );
|
||||
}
|
||||
|
||||
bool selected ( void ) { return _selected; }
|
||||
|
||||
Fl_Group * parent ( void ) const { return _track; }
|
||||
|
||||
int scroll_x ( void ) const { return timeline->ts_to_x( timeline->xoffset ); }
|
||||
|
|
Loading…
Reference in New Issue