X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04dbb6467be8f564f380bd9a1106fbdecbd26a98..a92b0cfd2bd0bef75b43c071df0b0e028f360d8e:/src/generic/filedlgg.cpp diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 838e152bbf..7e969a82f5 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -22,8 +22,8 @@ #if wxUSE_FILEDLG -#ifndef __UNIX__ -#error wxFileDialog currently only supports unix +#if !defined(__UNIX__) && !defined(__DOS__) +#error wxFileDialog currently only supports Unix and DOS #endif #include "wx/checkbox.h" @@ -52,11 +52,19 @@ #include #include -#include -#include -#ifndef __VMS -# include + +#ifdef __UNIX__ + #include + #include + #ifndef __VMS + # include + #endif +#endif + +#ifdef __WATCOMC__ + #include #endif + # include #include @@ -300,6 +308,7 @@ static wxImage CutEmptyBorders(const wxImage& img) int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) { +#if wxUSE_MIMETYPE if (!extension.IsEmpty()) { wxFileIconEntry *entry = (wxFileIconEntry*) m_HashTable.Get(extension); @@ -331,6 +340,14 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) } m_HashTable.Put(extension, new wxFileIconEntry(id)); return id; + +#else // !wxUSE_MIMETYPE + + if (extension == wxT("exe")) + return FI_EXECUTABLE; + else + return FI_UNKNOWN; +#endif // wxUSE_MIMETYPE/!wxUSE_MIMETYPE } @@ -365,7 +382,7 @@ wxFileData::wxFileData( const wxString &name, const wxString &fname ) struct stat buff; stat( m_fileName.fn_str(), &buff ); -#if !defined( __EMX__ ) && !defined(__VMS) +#if defined(__UNIX__) && (!defined( __EMX__ ) && !defined(__VMS)) struct stat lbuff; lstat( m_fileName.fn_str(), &lbuff ); m_isLink = S_ISLNK( lbuff.st_mode ); @@ -655,19 +672,25 @@ void wxFileCtrl::Update() f = wxFindNextFile(); } - res = m_dirName + wxT("/") + m_wild; - f = wxFindFirstFile( res.GetData(), wxFILE ); - while (!f.IsEmpty()) + // Tokenize the wildcard string, so we can handle more than 1 + // search pattern in a wildcard. + wxStringTokenizer tokenWild( m_wild, ";" ); + while ( tokenWild.HasMoreTokens() ) { - res = wxFileNameFromPath( f ); - fd = new wxFileData( res, f ); - wxString s = fd->GetName(); - if (m_showHidden || (s[0u] != wxT('.'))) + res = m_dirName + wxT("/") + tokenWild.GetNextToken(); + f = wxFindFirstFile( res.GetData(), wxFILE ); + while (!f.IsEmpty()) { - Add( fd, item ); - item.m_itemId++; + res = wxFileNameFromPath( f ); + fd = new wxFileData( res, f ); + wxString s = fd->GetName(); + if (m_showHidden || (s[0u] != wxT('.'))) + { + Add( fd, item ); + item.m_itemId++; + } + f = wxFindNextFile(); } - f = wxFindNextFile(); } SortItems( ListCompare, 0 );