git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10101
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+// Function which is called by quick sort. We want to override the default wxArrayString behaviour,
+// and sort regardless of case.
+static int LINKAGEMODE wxDirCtrlStringCompareFunction(const void *first, const void *second)
+{
+ wxString *strFirst = (wxString *)first;
+ wxString *strSecond = (wxString *)second;
+
+ return strFirst->CmpNoCase(*strSecond);
+}
+
//-----------------------------------------------------------------------------
// wxDirItemDataEx
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// wxDirItemDataEx
//-----------------------------------------------------------------------------
while (d.GetNext(& eachFilename)) ;
}
}
while (d.GetNext(& eachFilename)) ;
}
}
+ dirs.Sort((wxArrayString::CompareFunction) wxDirCtrlStringCompareFunction);
// Now do the filenames -- but only if we're allowed to
if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0)
// Now do the filenames -- but only if we're allowed to
if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0)
while (d.GetNext(& eachFilename)) ;
}
}
while (d.GetNext(& eachFilename)) ;
}
}
+ filenames.Sort((wxArrayString::CompareFunction) wxDirCtrlStringCompareFunction);