+// ----------------------------------------------------------------------------
+// Sorting
+// ----------------------------------------------------------------------------
+
+void wxTreeListCtrl::SetSortColumn(unsigned col, bool ascendingOrder)
+{
+ wxCHECK_RET( col < m_view->GetColumnCount(), "Invalid column index" );
+
+ m_view->GetColumn(col)->SetSortOrder(ascendingOrder);
+}
+
+bool wxTreeListCtrl::GetSortColumn(unsigned* col, bool* ascendingOrder)
+{
+ const unsigned numColumns = m_view->GetColumnCount();
+ for ( unsigned n = 0; n < numColumns; n++ )
+ {
+ wxDataViewColumn* const column = m_view->GetColumn(n);
+ if ( column->IsSortKey() )
+ {
+ if ( col )
+ *col = n;
+
+ if ( ascendingOrder )
+ *ascendingOrder = column->IsSortOrderAscending();
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void wxTreeListCtrl::SetItemComparator(wxTreeListItemComparator* comparator)
+{
+ m_comparator = comparator;
+}
+