+ return wxStrcmp(GetItemText(item1), GetItemText(item2));
+}
+
+void wxTreeCtrl::SortChildren(const wxTreeItemId& item)
+{
+ // rely on the fact that TreeView_SortChildren does the same thing as our
+ // default behaviour, i.e. sorts items alphabetically and so call it
+ // directly if we're not in derived class (much more efficient!)
+ if ( GetClassInfo() == CLASSINFO(wxTreeCtrl) )
+ {
+ TreeView_SortChildren(GetHwnd(), (HTREEITEM)(WXHTREEITEM)item, 0);
+ }
+ else
+ {
+ TV_SORTCB tvSort;
+ tvSort.hParent = (HTREEITEM)(WXHTREEITEM)item;
+ tvSort.lpfnCompare = (PFNTVCOMPARE)TreeView_CompareCallback;
+ tvSort.lParam = (LPARAM)this;
+ TreeView_SortChildrenCB(GetHwnd(), &tvSort, 0 /* reserved */);
+ }