Move track widget pointer sorting func into track widget class.

This commit is contained in:
Jonathan Moore Liles 2008-03-05 13:38:25 -06:00
parent 73180334f3
commit 0cbfaff090
2 changed files with 8 additions and 10 deletions

11
Track.C
View File

@ -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

View File

@ -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;
}
}; };