Move track widget pointer sorting func into track widget class.
This commit is contained in:
parent
73180334f3
commit
0cbfaff090
11
Track.C
11
Track.C
|
@ -27,19 +27,10 @@
|
||||||
|
|
||||||
queue <Track_Widget *> Track::_delete_queue;
|
queue <Track_Widget *> Track::_delete_queue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static bool
|
|
||||||
sort_func ( Track_Widget *lhs, Track_Widget *rhs )
|
|
||||||
{
|
|
||||||
return *lhs < *rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Track::sort ( void )
|
Track::sort ( void )
|
||||||
{
|
{
|
||||||
_widgets.sort( sort_func );
|
_widgets.sort( Track_Widget::sort_func );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -89,6 +89,7 @@ public:
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_selection.push_back( this );
|
_selection.push_back( this );
|
||||||
|
_selection.sort( sort_func );
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
@ -216,4 +217,10 @@ public:
|
||||||
virtual void draw_label ( const char *label, Fl_Align align );
|
virtual void draw_label ( const char *label, Fl_Align align );
|
||||||
virtual int handle ( int m );
|
virtual int handle ( int m );
|
||||||
|
|
||||||
|
static bool
|
||||||
|
sort_func ( Track_Widget *lhs, Track_Widget *rhs )
|
||||||
|
{
|
||||||
|
return *lhs < *rhs;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue