#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"
#include <sys/types.h>
#include <sys/stat.h>
-#include <dirent.h>
-#include <pwd.h>
-#ifndef __VMS
-# include <grp.h>
+
+#ifdef __UNIX__
+ #include <dirent.h>
+ #include <pwd.h>
+ #ifndef __VMS
+ # include <grp.h>
+ #endif
+#endif
+
+#ifdef __WATCOMC__
+ #include <direct.h>
#endif
+
# include <time.h>
#include <unistd.h>
int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime)
{
+#if wxUSE_MIMETYPE
if (!extension.IsEmpty())
{
wxFileIconEntry *entry = (wxFileIconEntry*) m_HashTable.Get(extension);
}
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
}
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 );
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 );