Remove remaining MSDOS support code
The remaining DOS source files where already removed in
26a0a24f38
. This removes the remaining __DOS__
and __DJGPP__ (the DOS gcc) code paths.
Closes https://github.com/wxWidgets/wxWidgets/pull/100
This commit is contained in:
committed by
Vadim Zeitlin
parent
854fce33a7
commit
2eccc1a57d
@@ -125,7 +125,6 @@ compiler used.
|
|||||||
@beginDefList
|
@beginDefList
|
||||||
@itemdef{__BORLANDC__, Borland C++. The value of the macro corresponds
|
@itemdef{__BORLANDC__, Borland C++. The value of the macro corresponds
|
||||||
to the compiler version: 500 is 5.0.}
|
to the compiler version: 500 is 5.0.}
|
||||||
@itemdef{__DJGPP__, DJGPP}
|
|
||||||
@itemdef{__DIGITALMARS__, Digital Mars (not used any more).}
|
@itemdef{__DIGITALMARS__, Digital Mars (not used any more).}
|
||||||
@itemdef{__GNUG__, Gnu C++ on any platform, see also wxCHECK_GCC_VERSION}
|
@itemdef{__GNUG__, Gnu C++ on any platform, see also wxCHECK_GCC_VERSION}
|
||||||
@itemdef{__GNUWIN32__, Gnu-Win32 compiler, see also wxCHECK_W32API_VERSION}
|
@itemdef{__GNUWIN32__, Gnu-Win32 compiler, see also wxCHECK_W32API_VERSION}
|
||||||
|
@@ -1130,8 +1130,7 @@ typedef wxUint32 wxDword;
|
|||||||
#define wxLongLongFmtSpec "I64"
|
#define wxLongLongFmtSpec "I64"
|
||||||
#elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \
|
#elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \
|
||||||
defined(__GNUC__) || \
|
defined(__GNUC__) || \
|
||||||
defined(__CYGWIN__) || \
|
defined(__CYGWIN__)
|
||||||
(defined(__DJGPP__) && __DJGPP__ >= 2)
|
|
||||||
#define wxLongLong_t long long
|
#define wxLongLong_t long long
|
||||||
#define wxLongLongSuffix ll
|
#define wxLongLongSuffix ll
|
||||||
#define wxLongLongFmtSpec "ll"
|
#define wxLongLongFmtSpec "ll"
|
||||||
|
@@ -32,13 +32,6 @@
|
|||||||
#endif // __WINDOWS__
|
#endif // __WINDOWS__
|
||||||
#endif // native Win compiler
|
#endif // native Win compiler
|
||||||
|
|
||||||
#if defined(__DOS__)
|
|
||||||
#ifdef __DJGPP__
|
|
||||||
#include <io.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __BORLANDC__ // Please someone tell me which version of Borland needs
|
#ifdef __BORLANDC__ // Please someone tell me which version of Borland needs
|
||||||
// this (3.1 I believe) and how to test for it.
|
// this (3.1 I believe) and how to test for it.
|
||||||
// If this works for Borland 4.0 as well, then no worries.
|
// If this works for Borland 4.0 as well, then no worries.
|
||||||
|
@@ -28,7 +28,7 @@ class WXDLLIMPEXP_FWD_BASE wxFFile;
|
|||||||
|
|
||||||
// this symbol is defined for the platforms where file systems use volumes in
|
// this symbol is defined for the platforms where file systems use volumes in
|
||||||
// paths
|
// paths
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
#define wxHAS_FILESYSTEM_VOLUMES
|
#define wxHAS_FILESYSTEM_VOLUMES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@
|
|||||||
wxDECL_FOR_STRICT_MINGW32(int, _finite, (double))
|
wxDECL_FOR_STRICT_MINGW32(int, _finite, (double))
|
||||||
|
|
||||||
#define wxFinite(x) _finite(x)
|
#define wxFinite(x) _finite(x)
|
||||||
#elif ( defined(__GNUG__)||defined(__GNUWIN32__)||defined(__DJGPP__)|| \
|
#elif ( defined(__GNUG__)||defined(__GNUWIN32__)|| \
|
||||||
defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \
|
defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \
|
||||||
defined(__HPUX__) ) && ( !defined(wxOSX_USE_IPHONE) || wxOSX_USE_IPHONE == 0 )
|
defined(__HPUX__) ) && ( !defined(wxOSX_USE_IPHONE) || wxOSX_USE_IPHONE == 0 )
|
||||||
#ifdef __SOLARIS__
|
#ifdef __SOLARIS__
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
|
|
||||||
#if defined(__VISUALC__)||defined(__BORLAND__)
|
#if defined(__VISUALC__)||defined(__BORLAND__)
|
||||||
#define wxIsNaN(x) _isnan(x)
|
#define wxIsNaN(x) _isnan(x)
|
||||||
#elif defined(__GNUG__)||defined(__GNUWIN32__)||defined(__DJGPP__)|| \
|
#elif defined(__GNUG__)||defined(__GNUWIN32__)|| \
|
||||||
defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \
|
defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \
|
||||||
defined(__HPUX__)
|
defined(__HPUX__)
|
||||||
#define wxIsNaN(x) isnan(x)
|
#define wxIsNaN(x) isnan(x)
|
||||||
|
@@ -237,21 +237,6 @@
|
|||||||
# define wxCOMPILER_BROKEN_CONCAT_OPER
|
# define wxCOMPILER_BROKEN_CONCAT_OPER
|
||||||
#endif /* __BORLANDC__ */
|
#endif /* __BORLANDC__ */
|
||||||
|
|
||||||
/*
|
|
||||||
OS: first of all, test for MS-DOS platform. We must do this before testing
|
|
||||||
for Unix, because DJGPP compiler defines __unix__ under MS-DOS
|
|
||||||
*/
|
|
||||||
#if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
|
|
||||||
# ifndef __DOS__
|
|
||||||
# define __DOS__
|
|
||||||
# endif
|
|
||||||
/* define it if it hadn't been done by configure yet */
|
|
||||||
# if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
|
|
||||||
# ifdef __DJGPP__
|
|
||||||
# define wxSIZE_T_IS_ULONG
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
OS: then test for generic Unix defines, then for particular flavours and
|
OS: then test for generic Unix defines, then for particular flavours and
|
||||||
finally for Unix-like systems
|
finally for Unix-like systems
|
||||||
@@ -369,7 +354,6 @@
|
|||||||
*/
|
*/
|
||||||
#if ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \
|
#if ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \
|
||||||
( defined( __CYGWIN__ ) && defined( __WINDOWS__ ) ) ) && \
|
( defined( __CYGWIN__ ) && defined( __WINDOWS__ ) ) ) && \
|
||||||
!defined(__DOS__) && \
|
|
||||||
!defined(__WXMOTIF__) && \
|
!defined(__WXMOTIF__) && \
|
||||||
!defined(__WXX11__)
|
!defined(__WXX11__)
|
||||||
# include "wx/msw/gccpriv.h"
|
# include "wx/msw/gccpriv.h"
|
||||||
|
@@ -228,7 +228,7 @@ extern unsigned long android_wcstoul(const wchar_t *nptr, wchar_t **endptr, int
|
|||||||
|
|
||||||
/* define wxCRT_StricmpA/W and wxCRT_StrnicmpA/W for various compilers */
|
/* define wxCRT_StricmpA/W and wxCRT_StrnicmpA/W for various compilers */
|
||||||
|
|
||||||
#if defined(__BORLANDC__) || defined(__DJGPP__)
|
#if defined(__BORLANDC__)
|
||||||
#define wxCRT_StricmpA stricmp
|
#define wxCRT_StricmpA stricmp
|
||||||
#define wxCRT_StrnicmpA strnicmp
|
#define wxCRT_StrnicmpA strnicmp
|
||||||
#elif defined(__VISUALC__)
|
#elif defined(__VISUALC__)
|
||||||
|
@@ -53,14 +53,6 @@
|
|||||||
#ifdef __GNUWIN32__
|
#ifdef __GNUWIN32__
|
||||||
#include "wx/msw/wrapwin.h"
|
#include "wx/msw/wrapwin.h"
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__DOS__)
|
|
||||||
#if defined(__DJGPP__)
|
|
||||||
#include <io.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#else
|
|
||||||
#error "Please specify the header with file functions declarations."
|
|
||||||
#endif
|
|
||||||
#elif (defined(__WXSTUBS__))
|
#elif (defined(__WXSTUBS__))
|
||||||
// Have to ifdef this for different environments
|
// Have to ifdef this for different environments
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
@@ -483,7 +475,7 @@ bool wxFile::Eof() const
|
|||||||
|
|
||||||
wxFileOffset iRc;
|
wxFileOffset iRc;
|
||||||
|
|
||||||
#if defined(__DOS__) || defined(__UNIX__) || defined(__GNUWIN32__)
|
#if defined(__UNIX__) || defined(__GNUWIN32__)
|
||||||
// @@ this doesn't work, of course, on unseekable file descriptors
|
// @@ this doesn't work, of course, on unseekable file descriptors
|
||||||
wxFileOffset ofsCur = Tell(),
|
wxFileOffset ofsCur = Tell(),
|
||||||
ofsMax = Length();
|
ofsMax = Length();
|
||||||
|
@@ -1159,7 +1159,7 @@ bool wxMkdir(const wxString& dir, int perm)
|
|||||||
|
|
||||||
// assume mkdir() has 2 args on non Windows-OS/2 platforms and on Windows too
|
// assume mkdir() has 2 args on non Windows-OS/2 platforms and on Windows too
|
||||||
// for the GNU compiler
|
// for the GNU compiler
|
||||||
#elif (!(defined(__WINDOWS__) || defined(__DOS__))) || \
|
#elif (!defined(__WINDOWS__)) || \
|
||||||
(defined(__GNUWIN32__) && !defined(__MINGW32__)) || \
|
(defined(__GNUWIN32__) && !defined(__MINGW32__)) || \
|
||||||
defined(__WINE__)
|
defined(__WINE__)
|
||||||
const wxChar *dirname = dir.c_str();
|
const wxChar *dirname = dir.c_str();
|
||||||
@@ -1169,14 +1169,7 @@ bool wxMkdir(const wxString& dir, int perm)
|
|||||||
#else
|
#else
|
||||||
if ( mkdir(wxFNCONV(dirname), perm) != 0 )
|
if ( mkdir(wxFNCONV(dirname), perm) != 0 )
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__DOS__)
|
#else // !MSW and !OS/2 VAC++
|
||||||
const wxChar *dirname = dir.c_str();
|
|
||||||
#if defined(__DJGPP__)
|
|
||||||
if ( mkdir(wxFNCONV(dirname), perm) != 0 )
|
|
||||||
#else
|
|
||||||
#error "Unsupported DOS compiler!"
|
|
||||||
#endif
|
|
||||||
#else // !MSW, !DOS and !OS/2 VAC++
|
|
||||||
wxUnusedVar(perm);
|
wxUnusedVar(perm);
|
||||||
if ( wxMkDir(dir.fn_str()) != 0 )
|
if ( wxMkDir(dir.fn_str()) != 0 )
|
||||||
#endif // !MSW/MSW
|
#endif // !MSW/MSW
|
||||||
@@ -1353,16 +1346,6 @@ wxChar *wxDoGetCwd(wxChar *buf, int sz)
|
|||||||
}
|
}
|
||||||
else // ok, but we might need to massage the path into the right format
|
else // ok, but we might need to massage the path into the right format
|
||||||
{
|
{
|
||||||
#ifdef __DJGPP__
|
|
||||||
// VS: DJGPP is a strange mix of DOS and UNIX API and returns paths
|
|
||||||
// with / deliminers. We don't like that.
|
|
||||||
for (wxChar *ch = buf; *ch; ch++)
|
|
||||||
{
|
|
||||||
if (*ch == wxT('/'))
|
|
||||||
*ch = wxT('\\');
|
|
||||||
}
|
|
||||||
#endif // __DJGPP__
|
|
||||||
|
|
||||||
// MBN: we hope that in the case the user is compiling a GTK+/Motif app,
|
// MBN: we hope that in the case the user is compiling a GTK+/Motif app,
|
||||||
// he needs Unix as opposed to Win32 pathnames
|
// he needs Unix as opposed to Win32 pathnames
|
||||||
#if defined( __CYGWIN__ ) && defined( __WINDOWS__ )
|
#if defined( __CYGWIN__ ) && defined( __WINDOWS__ )
|
||||||
@@ -1404,7 +1387,7 @@ wxString wxGetCwd()
|
|||||||
bool wxSetWorkingDirectory(const wxString& d)
|
bool wxSetWorkingDirectory(const wxString& d)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
#if defined(__UNIX__) || defined(__WXMAC__) || defined(__DOS__)
|
#if defined(__UNIX__) || defined(__WXMAC__)
|
||||||
success = (chdir(wxFNSTRINGCAST d.fn_str()) == 0);
|
success = (chdir(wxFNSTRINGCAST d.fn_str()) == 0);
|
||||||
#elif defined(__WINDOWS__)
|
#elif defined(__WINDOWS__)
|
||||||
|
|
||||||
|
@@ -118,10 +118,6 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __DJGPP__
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef S_ISREG
|
#ifndef S_ISREG
|
||||||
#define S_ISREG(mode) ((mode) & S_IFREG)
|
#define S_ISREG(mode) ((mode) & S_IFREG)
|
||||||
#endif
|
#endif
|
||||||
@@ -1000,11 +996,9 @@ static wxString wxCreateTempImpl(
|
|||||||
{
|
{
|
||||||
path = wxConvFile.cMB2WX( (const char*) buf );
|
path = wxConvFile.cMB2WX( (const char*) buf );
|
||||||
}
|
}
|
||||||
#else // !HAVE_MKTEMP (includes __DOS__)
|
#else // !HAVE_MKTEMP
|
||||||
// generate the unique file name ourselves
|
// generate the unique file name ourselves
|
||||||
#if !defined(__DOS__)
|
|
||||||
path << (unsigned int)getpid();
|
path << (unsigned int)getpid();
|
||||||
#endif
|
|
||||||
|
|
||||||
wxString pathTry;
|
wxString pathTry;
|
||||||
|
|
||||||
@@ -2280,7 +2274,7 @@ wxPathFormat wxFileName::GetFormat( wxPathFormat format )
|
|||||||
{
|
{
|
||||||
if (format == wxPATH_NATIVE)
|
if (format == wxPATH_NATIVE)
|
||||||
{
|
{
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
format = wxPATH_DOS;
|
format = wxPATH_DOS;
|
||||||
#elif defined(__VMS)
|
#elif defined(__VMS)
|
||||||
format = wxPATH_VMS;
|
format = wxPATH_VMS;
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
// default type is the native one
|
// default type is the native one
|
||||||
|
|
||||||
const wxTextFileType wxTextBuffer::typeDefault =
|
const wxTextFileType wxTextBuffer::typeDefault =
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
wxTextFileType_Dos;
|
wxTextFileType_Dos;
|
||||||
#elif defined(__UNIX__)
|
#elif defined(__UNIX__)
|
||||||
wxTextFileType_Unix;
|
wxTextFileType_Unix;
|
||||||
|
@@ -71,7 +71,7 @@
|
|||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__DJGPP__) || defined(__WINE__)
|
#if defined(__WINE__)
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#include <values.h>
|
#include <values.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -172,7 +172,7 @@ int wxGetTimeZone()
|
|||||||
gmtoffset += 3600;
|
gmtoffset += 3600;
|
||||||
}
|
}
|
||||||
return (int)gmtoffset;
|
return (int)gmtoffset;
|
||||||
#elif defined(__DJGPP__) || defined(__WINE__)
|
#elif defined(__WINE__)
|
||||||
struct timeb tb;
|
struct timeb tb;
|
||||||
ftime(&tb);
|
ftime(&tb);
|
||||||
return tb.timezone*60;
|
return tb.timezone*60;
|
||||||
|
@@ -204,24 +204,7 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI
|
|||||||
// wxIsDriveAvailable
|
// wxIsDriveAvailable
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
|
|
||||||
bool wxIsDriveAvailable(const wxString& dirName)
|
|
||||||
{
|
|
||||||
if ( dirName.length() == 3 && dirName[1u] == wxT(':') )
|
|
||||||
{
|
|
||||||
wxString dirNameLower(dirName.Lower());
|
|
||||||
// VS: always return true for removable media, since Win95 doesn't
|
|
||||||
// like it when MS-DOS app accesses empty floppy drive
|
|
||||||
return (dirNameLower[0u] == wxT('a') ||
|
|
||||||
dirNameLower[0u] == wxT('b') ||
|
|
||||||
wxDirExists(dirNameLower));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(__WINDOWS__)
|
|
||||||
|
|
||||||
int setdrive(int drive)
|
int setdrive(int drive)
|
||||||
{
|
{
|
||||||
@@ -444,7 +427,7 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
|
|||||||
|
|
||||||
wxString rootName;
|
wxString rootName;
|
||||||
|
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
rootName = _("Computer");
|
rootName = _("Computer");
|
||||||
#else
|
#else
|
||||||
rootName = _("Sections");
|
rootName = _("Sections");
|
||||||
@@ -702,7 +685,7 @@ void wxGenericDirCtrl::PopulateNode(wxTreeItemId parentId)
|
|||||||
|
|
||||||
wxString dirName(data->m_path);
|
wxString dirName(data->m_path);
|
||||||
|
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
// Check if this is a root directory and if so,
|
// Check if this is a root directory and if so,
|
||||||
// whether the drive is available.
|
// whether the drive is available.
|
||||||
if (!wxIsDriveAvailable(dirName))
|
if (!wxIsDriveAvailable(dirName))
|
||||||
@@ -716,7 +699,7 @@ void wxGenericDirCtrl::PopulateNode(wxTreeItemId parentId)
|
|||||||
// This may take a longish time. Go to busy cursor
|
// This may take a longish time. Go to busy cursor
|
||||||
wxBusyCursor busy;
|
wxBusyCursor busy;
|
||||||
|
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
if (dirName.Last() == ':')
|
if (dirName.Last() == ':')
|
||||||
dirName += wxString(wxFILE_SEP_PATH);
|
dirName += wxString(wxFILE_SEP_PATH);
|
||||||
#endif
|
#endif
|
||||||
@@ -866,7 +849,7 @@ wxTreeItemId wxGenericDirCtrl::FindChild(wxTreeItemId parentId, const wxString&
|
|||||||
path2 += wxString(wxFILE_SEP_PATH);
|
path2 += wxString(wxFILE_SEP_PATH);
|
||||||
|
|
||||||
// In MSW case is not significant
|
// In MSW case is not significant
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
path2.MakeLower();
|
path2.MakeLower();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -883,7 +866,7 @@ wxTreeItemId wxGenericDirCtrl::FindChild(wxTreeItemId parentId, const wxString&
|
|||||||
childPath += wxString(wxFILE_SEP_PATH);
|
childPath += wxString(wxFILE_SEP_PATH);
|
||||||
|
|
||||||
// In MSW case is not significant
|
// In MSW case is not significant
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__)
|
#if defined(__WINDOWS__)
|
||||||
childPath.MakeLower();
|
childPath.MakeLower();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -94,13 +94,10 @@ bool wxGenericDirDialog::Create(wxWindow* parent,
|
|||||||
// 0) 'New' and 'Home' Buttons
|
// 0) 'New' and 'Home' Buttons
|
||||||
wxSizer* buttonsizer = new wxBoxSizer( wxHORIZONTAL );
|
wxSizer* buttonsizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
// VS: 'Home directory' concept is unknown to MS-DOS
|
|
||||||
#if !defined(__DOS__)
|
|
||||||
wxBitmapButton* homeButton =
|
wxBitmapButton* homeButton =
|
||||||
new wxBitmapButton(this, ID_GO_HOME,
|
new wxBitmapButton(this, ID_GO_HOME,
|
||||||
wxArtProvider::GetBitmap(wxART_GO_HOME, wxART_BUTTON));
|
wxArtProvider::GetBitmap(wxART_GO_HOME, wxART_BUTTON));
|
||||||
buttonsizer->Add( homeButton, 0, wxLEFT|wxRIGHT, 10 );
|
buttonsizer->Add( homeButton, 0, wxLEFT|wxRIGHT, 10 );
|
||||||
#endif
|
|
||||||
|
|
||||||
// I'm not convinced we need a New button, and we tend to get annoying
|
// I'm not convinced we need a New button, and we tend to get annoying
|
||||||
// accidental-editing with label editing enabled.
|
// accidental-editing with label editing enabled.
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
#include "wx/msw/wrapwin.h"
|
#include "wx/msw/wrapwin.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__DOS__) || defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
#define IsTopMostDir(dir) (dir.empty())
|
#define IsTopMostDir(dir) (dir.empty())
|
||||||
#else
|
#else
|
||||||
#define IsTopMostDir(dir) (dir == wxT("/"))
|
#define IsTopMostDir(dir) (dir == wxT("/"))
|
||||||
@@ -173,7 +173,7 @@ void wxFileData::ReadData()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__DOS__) || defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
// c:\.. is a drive don't stat it
|
// c:\.. is a drive don't stat it
|
||||||
if ((m_fileName == wxT("..")) && (m_filePath.length() <= 5))
|
if ((m_fileName == wxT("..")) && (m_filePath.length() <= 5))
|
||||||
{
|
{
|
||||||
@@ -181,7 +181,7 @@ void wxFileData::ReadData()
|
|||||||
m_size = 0;
|
m_size = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // __DOS__ || __WINDOWS__
|
#endif // __WINDOWS__
|
||||||
|
|
||||||
// OTHER PLATFORMS
|
// OTHER PLATFORMS
|
||||||
|
|
||||||
@@ -498,7 +498,7 @@ void wxFileListCtrl::UpdateFiles()
|
|||||||
item.m_itemId = 0;
|
item.m_itemId = 0;
|
||||||
item.m_col = 0;
|
item.m_col = 0;
|
||||||
|
|
||||||
#if defined(__WINDOWS__) || defined(__DOS__) || defined(__WXMAC__)
|
#if defined(__WINDOWS__) || defined(__WXMAC__)
|
||||||
if ( IsTopMostDir(m_dirName) )
|
if ( IsTopMostDir(m_dirName) )
|
||||||
{
|
{
|
||||||
wxArrayString names, paths;
|
wxArrayString names, paths;
|
||||||
@@ -527,7 +527,7 @@ void wxFileListCtrl::UpdateFiles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif // defined(__DOS__) || defined(__WINDOWS__)
|
#endif // defined(__WINDOWS__) || defined(__WXMAC__)
|
||||||
{
|
{
|
||||||
// Real directory...
|
// Real directory...
|
||||||
if ( !IsTopMostDir(m_dirName) && !m_dirName.empty() )
|
if ( !IsTopMostDir(m_dirName) && !m_dirName.empty() )
|
||||||
@@ -544,10 +544,10 @@ void wxFileListCtrl::UpdateFiles()
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxString dirname(m_dirName);
|
wxString dirname(m_dirName);
|
||||||
#if defined(__DOS__) || defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
if (dirname.length() == 2 && dirname[1u] == wxT(':'))
|
if (dirname.length() == 2 && dirname[1u] == wxT(':'))
|
||||||
dirname << wxT('\\');
|
dirname << wxT('\\');
|
||||||
#endif // defined(__DOS__) || defined(__WINDOWS__)
|
#endif // defined(__WINDOWS__)
|
||||||
|
|
||||||
if (dirname.empty())
|
if (dirname.empty())
|
||||||
dirname = wxFILE_SEP_PATH;
|
dirname = wxFILE_SEP_PATH;
|
||||||
@@ -669,7 +669,7 @@ void wxFileListCtrl::GoToParentDir()
|
|||||||
m_dirName.Remove( len-1, 1 );
|
m_dirName.Remove( len-1, 1 );
|
||||||
wxString fname( wxFileNameFromPath(m_dirName) );
|
wxString fname( wxFileNameFromPath(m_dirName) );
|
||||||
m_dirName = wxPathOnly( m_dirName );
|
m_dirName = wxPathOnly( m_dirName );
|
||||||
#if defined(__DOS__) || defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
if (!m_dirName.empty())
|
if (!m_dirName.empty())
|
||||||
{
|
{
|
||||||
if (m_dirName.Last() == wxT('.'))
|
if (m_dirName.Last() == wxT('.'))
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
#if wxUSE_FILEDLG
|
#if wxUSE_FILEDLG
|
||||||
|
|
||||||
// NOTE : it probably also supports MAC, untested
|
// NOTE : it probably also supports MAC, untested
|
||||||
#if !defined(__UNIX__) && !defined(__DOS__) && !defined(__WIN32__)
|
#if !defined(__UNIX__) && !defined(__WIN32__)
|
||||||
#error wxGenericFileDialog currently only supports Unix, win32 and DOS
|
#error wxGenericFileDialog currently only supports Unix, win32 and DOS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -70,11 +70,11 @@
|
|||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#if defined(__UNIX__) || defined(__DOS__)
|
#if defined(__UNIX__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__DOS__) || defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
#define IsTopMostDir(dir) (dir.empty())
|
#define IsTopMostDir(dir) (dir.empty())
|
||||||
#else
|
#else
|
||||||
#define IsTopMostDir(dir) (dir == wxT("/"))
|
#define IsTopMostDir(dir) (dir == wxT("/"))
|
||||||
@@ -103,9 +103,9 @@ wxBEGIN_EVENT_TABLE(wxGenericFileDialog,wxDialog)
|
|||||||
EVT_FILECTRL_FILEACTIVATED(ID_FILE_CTRL, wxGenericFileDialog::OnFileActivated)
|
EVT_FILECTRL_FILEACTIVATED(ID_FILE_CTRL, wxGenericFileDialog::OnFileActivated)
|
||||||
|
|
||||||
EVT_UPDATE_UI(ID_UP_DIR, wxGenericFileDialog::OnUpdateButtonsUI)
|
EVT_UPDATE_UI(ID_UP_DIR, wxGenericFileDialog::OnUpdateButtonsUI)
|
||||||
#if defined(__DOS__) || defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
EVT_UPDATE_UI(ID_NEW_DIR, wxGenericFileDialog::OnUpdateButtonsUI)
|
EVT_UPDATE_UI(ID_NEW_DIR, wxGenericFileDialog::OnUpdateButtonsUI)
|
||||||
#endif // defined(__DOS__) || defined(__WINDOWS__)
|
#endif // defined(__WINDOWS__)
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
long wxGenericFileDialog::ms_lastViewStyle = wxLC_LIST;
|
long wxGenericFileDialog::ms_lastViewStyle = wxLC_LIST;
|
||||||
@@ -204,11 +204,9 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
|
|||||||
m_upDirButton = AddBitmapButton( ID_UP_DIR, wxART_GO_DIR_UP,
|
m_upDirButton = AddBitmapButton( ID_UP_DIR, wxART_GO_DIR_UP,
|
||||||
_("Go to parent directory"), buttonsizer );
|
_("Go to parent directory"), buttonsizer );
|
||||||
|
|
||||||
#ifndef __DOS__ // VS: Home directory is meaningless in MS-DOS...
|
|
||||||
AddBitmapButton( ID_HOME_DIR, wxART_GO_HOME,
|
AddBitmapButton( ID_HOME_DIR, wxART_GO_HOME,
|
||||||
_("Go to home directory"), buttonsizer );
|
_("Go to home directory"), buttonsizer );
|
||||||
buttonsizer->Add( 20, 20 );
|
buttonsizer->Add( 20, 20 );
|
||||||
#endif //!__DOS__
|
|
||||||
|
|
||||||
m_newDirButton = AddBitmapButton( ID_NEW_DIR, wxART_NEW_DIR,
|
m_newDirButton = AddBitmapButton( ID_NEW_DIR, wxART_NEW_DIR,
|
||||||
_("Create new directory"), buttonsizer );
|
_("Create new directory"), buttonsizer );
|
||||||
|
Reference in New Issue
Block a user