- // 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(), HITEM(item), 0);
- }
- else
- {
- TV_SORTCB tvSort;
- tvSort.hParent = HITEM(item);
- tvSort.lpfnCompare = wxTreeSortHelper::Compare;
- tvSort.lParam = (LPARAM)this;
- TreeView_SortChildrenCB(GetHwnd(), &tvSort, 0 /* reserved */);
- }