Version: 3.1.0
wxTreeListItemComparator Class Referenceabstract

#include <wx/treelist.h>

Detailed Description

Class defining sort order for the items in wxTreeListCtrl.

See Also
wxTreeListCtrl

Library:  wxAdvanced
Category:  Controls
Since
2.9.3

Public Member Functions

 wxTreeListItemComparator ()
 Default constructor.
 
virtual int Compare (wxTreeListCtrl *treelist, unsigned column, wxTreeListItem first, wxTreeListItem second)=0
 Pure virtual function which must be overridden to define sort order.
 
virtual ~wxTreeListItemComparator ()
 Trivial but virtual destructor.
 

Constructor & Destructor Documentation

wxTreeListItemComparator::wxTreeListItemComparator ( )

Default constructor.

Notice that this class is not copyable, comparators are not passed by value.

virtual wxTreeListItemComparator::~wxTreeListItemComparator ( )
virtual

Trivial but virtual destructor.

Although this class is not used polymorphically by wxWidgets itself, provide virtual dtor in case it's used like this in the user code.

Member Function Documentation

virtual int wxTreeListItemComparator::Compare ( wxTreeListCtrl treelist,
unsigned  column,
wxTreeListItem  first,
wxTreeListItem  second 
)
pure virtual

Pure virtual function which must be overridden to define sort order.

The comparison function should return negative, null or positive value depending on whether the first item is less than, equal to or greater than the second one. The items should be compared using their values for the given column.

Parameters
treelistThe control whose contents is being sorted.
columnThe column of this control used for sorting.
firstFirst item to compare.
secondSecond item to compare.
Returns
A negative value if the first item is less than (i.e. should appear above) the second one, zero if the two items are equal or a positive value if the first item is greater than (i.e. should appear below) the second one.