+ wxString dirPrefix(dirname + wxFILE_SEP_PATH);
+ int hiddenFlag = m_showHidden ? wxDIR_HIDDEN : 0;
+
+ bool cont;
+ wxString f;
+
+ // Get the directories first (not matched against wildcards):
+ cont = dir.GetFirst(&f, wxEmptyString, wxDIR_DIRS | hiddenFlag);
+ while (cont)
+ {
+ fd = new wxFileData(f, dirPrefix + f);
+ Add(fd, item);
+ item.m_itemId++;
+ cont = dir.GetNext(&f);
+ }
+
+ // Tokenize the wildcard string, so we can handle more than 1
+ // search pattern in a wildcard.
+ wxStringTokenizer tokenWild(m_wild, wxT(";"));
+ while ( tokenWild.HasMoreTokens() )
+ {
+ cont = dir.GetFirst(&f, tokenWild.GetNextToken(),
+ wxDIR_FILES | hiddenFlag);
+ while (cont)
+ {
+ fd = new wxFileData(f, dirPrefix + f);
+ Add(fd, item);
+ item.m_itemId++;
+ cont = dir.GetNext(&f);
+ }
+ }