#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 );
{
if (m_dirName != wxT("/"))
{
+ size_t len = m_dirName.Len();
+ if (m_dirName[len-1] == wxT('/'))
+ m_dirName.Remove( len-1, 1 );
wxString fname( wxFileNameFromPath(m_dirName) );
m_dirName = wxPathOnly( m_dirName );
if (m_dirName.IsEmpty()) m_dirName = wxT("/");
m_dialogStyle |= wxOPEN;
m_dir = defaultDir;
- if ((m_dir.IsEmpty()) || (m_dir == wxT(".")))
+ if ((m_dir.empty()) || (m_dir == wxT(".")))
{
char buf[200];
m_dir = getcwd( buf, sizeof(buf) );
}
- m_path = defaultDir;
+
+ size_t len = m_dir.Len();
+ if ((len > 1) && (m_dir[len-1] == wxT('/')))
+ m_dir.Remove( len-1, 1 );
+
+ m_path = m_dir;
m_path += wxT("/");
m_path += defaultFile;
m_fileName = defaultFile;
if (m_dialogStyle & wxMULTIPLE)
m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
- wxSize(440,180), s_lastViewStyle | wxSUNKEN_BORDER );
+ wxSize(540,200), s_lastViewStyle | wxSUNKEN_BORDER );
else
m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
- wxSize(440,180), s_lastViewStyle | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
+ wxSize(540,200), s_lastViewStyle | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
m_list -> ShowHidden(s_lastShowHidden);
mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 );