Win16 compilation fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -101,7 +101,7 @@ config.cpp C B
|
||||
ctrlcmn.cpp C
|
||||
ctrlsub.cpp C
|
||||
date.cpp C B
|
||||
datetime.cpp C B
|
||||
datetime.cpp C 32,B
|
||||
datstrm.cpp C
|
||||
db.cpp C
|
||||
dbtable.cpp C
|
||||
@@ -146,7 +146,7 @@ layout.cpp C
|
||||
lboxcmn.cpp C
|
||||
list.cpp C B
|
||||
log.cpp C B
|
||||
longlong.cpp C B
|
||||
longlong.cpp C 32,B
|
||||
memory.cpp C
|
||||
menucmn.cpp C
|
||||
mimetype.cpp C 32,B
|
||||
|
@@ -328,7 +328,7 @@ typedef int wxWindowID;
|
||||
|
||||
// wxCALLBACK should be used for the functions which are called back by
|
||||
// Windows (such as compare function for wxListCtrl)
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__MINGW32__) || defined(__GNUWIN32__)
|
||||
#define wxCALLBACK __attribute__((stdcall))
|
||||
#else
|
||||
@@ -336,7 +336,7 @@ typedef int wxWindowID;
|
||||
#define wxCALLBACK _stdcall
|
||||
#endif
|
||||
#else
|
||||
// no stdcall under Unix
|
||||
// no stdcall under Unix nor Win16
|
||||
#define wxCALLBACK
|
||||
#endif // platform
|
||||
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
|
||||
bool CanRead( wxInputStream& stream ) { return DoCanRead(stream); }
|
||||
bool CanRead( const wxString& name );
|
||||
#endif
|
||||
#endif // wxUSE_STREAMS
|
||||
|
||||
void SetName(const wxString& name) { m_name = name; }
|
||||
void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||
@@ -62,17 +62,176 @@ public:
|
||||
wxString GetMimeType() const { return m_mime; }
|
||||
|
||||
protected:
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool DoCanRead( wxInputStream& stream ) = 0;
|
||||
#endif // wxUSE_STREAMS
|
||||
|
||||
wxString m_name;
|
||||
wxString m_extension;
|
||||
wxString m_mime;
|
||||
long m_type;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPNGHandler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LIBPNG
|
||||
class WXDLLEXPORT wxPNGHandler: public wxImageHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPNGHandler)
|
||||
|
||||
public:
|
||||
|
||||
inline wxPNGHandler()
|
||||
{
|
||||
m_name = "PNG file";
|
||||
m_extension = "png";
|
||||
m_type = wxBITMAP_TYPE_PNG;
|
||||
m_mime = "image/png";
|
||||
};
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
|
||||
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxJPEGHandler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LIBJPEG
|
||||
class WXDLLEXPORT wxJPEGHandler: public wxImageHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxJPEGHandler)
|
||||
|
||||
public:
|
||||
|
||||
inline wxJPEGHandler()
|
||||
{
|
||||
m_name = "JPEG file";
|
||||
m_extension = "jpg";
|
||||
m_type = wxBITMAP_TYPE_JPEG;
|
||||
m_mime = "image/jpeg";
|
||||
};
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
|
||||
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTIFFHandler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LIBTIFF
|
||||
class WXDLLEXPORT wxTIFFHandler: public wxImageHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTIFFHandler)
|
||||
|
||||
public:
|
||||
|
||||
inline wxTIFFHandler()
|
||||
{
|
||||
m_name = "TIFF file";
|
||||
m_extension = "tif";
|
||||
m_type = wxBITMAP_TYPE_TIF;
|
||||
m_mime = "image/tiff";
|
||||
};
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
|
||||
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
virtual int GetImageCount( wxInputStream& stream );
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxBMPHandler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBMPHandler: public wxImageHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBMPHandler)
|
||||
|
||||
public:
|
||||
|
||||
inline wxBMPHandler()
|
||||
{
|
||||
m_name = "BMP file";
|
||||
m_extension = "bmp";
|
||||
m_type = wxBITMAP_TYPE_BMP;
|
||||
m_mime = "image/bmp";
|
||||
};
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_PNM
|
||||
class WXDLLEXPORT wxPNMHandler : public wxImageHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPNMHandler)
|
||||
|
||||
public:
|
||||
|
||||
inline wxPNMHandler()
|
||||
{
|
||||
m_name = "PNM file";
|
||||
m_extension = "pnm";
|
||||
m_type = wxBITMAP_TYPE_PNM;
|
||||
m_mime = "image/pnm";
|
||||
};
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
|
||||
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPCXHandler
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_PCX
|
||||
class WXDLLEXPORT wxPCXHandler : public wxImageHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPCXHandler)
|
||||
|
||||
public:
|
||||
|
||||
inline wxPCXHandler()
|
||||
{
|
||||
m_name = "PCX file";
|
||||
m_extension = "pcx";
|
||||
m_type = wxBITMAP_TYPE_PCX;
|
||||
m_mime = "image/pcx";
|
||||
};
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
|
||||
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
|
||||
virtual bool DoCanRead( wxInputStream& stream );
|
||||
#endif // wxUSE_STREAMS
|
||||
};
|
||||
#endif // wxUSE_PCX
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxImage
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -284,9 +284,7 @@ public:
|
||||
inline long GetMask() { return m_item.m_mask; }
|
||||
inline const wxListItem &GetItem() const { return m_item; }
|
||||
|
||||
#ifndef __WXMSW__
|
||||
void CopyObject(wxObject& object_dest) const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxListEvent)
|
||||
|
@@ -104,8 +104,8 @@ protected:
|
||||
};
|
||||
|
||||
#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
|
||||
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance, char *lpszCmdLine,
|
||||
int nCmdShow, bool enterLoop = TRUE);
|
||||
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance,
|
||||
char *lpszCmdLine, int nCmdShow, bool enterLoop = TRUE);
|
||||
#else
|
||||
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance);
|
||||
#endif
|
||||
|
@@ -75,6 +75,9 @@ public:
|
||||
|
||||
WXCOLORREF GetPixel() const { return m_pixel; };
|
||||
|
||||
public:
|
||||
WXCOLORREF m_pixel;
|
||||
|
||||
private:
|
||||
bool m_isInit;
|
||||
unsigned char m_red;
|
||||
@@ -84,9 +87,6 @@ private:
|
||||
// helper func
|
||||
void InitFromName(const wxString& colourName);
|
||||
|
||||
public:
|
||||
WXCOLORREF m_pixel ;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||
};
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#pragma interface "tbarmsw.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
|
||||
#if wxUSE_TOOLBAR
|
||||
|
||||
#include "wx/tbarbase.h"
|
||||
|
||||
@@ -144,7 +144,7 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
||||
};
|
||||
|
||||
#endif // wxUSE_TOOL/BUTTONBAR
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
#endif
|
||||
// _WX_TBARMSW_H_
|
||||
|
@@ -314,7 +314,7 @@ void wxPrintData::ConvertToNative()
|
||||
|
||||
if ( hDevMode )
|
||||
{
|
||||
DEVMODE *devMode = (DEVMODE*) GlobalLock(hDevMode);
|
||||
LPDEVMODE devMode = (LPDEVMODE) GlobalLock(hDevMode);
|
||||
|
||||
//// Orientation
|
||||
|
||||
@@ -436,7 +436,7 @@ void wxPrintData::ConvertFromNative()
|
||||
|
||||
if ( hDevMode )
|
||||
{
|
||||
DEVMODE *devMode = (DEVMODE*) GlobalLock(hDevMode);
|
||||
LPDEVMODE devMode = (LPDEVMODE)GlobalLock(hDevMode);
|
||||
|
||||
#ifndef __WXWINE__
|
||||
//// Orientation
|
||||
|
@@ -747,7 +747,7 @@ wxBitmap wxImage::ConvertToBitmap() const
|
||||
|
||||
// create a DIB header
|
||||
int headersize = sizeof(BITMAPINFOHEADER);
|
||||
LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize );
|
||||
BITMAPINFO *lpDIBh = (BITMAPINFO *) malloc( headersize );
|
||||
wxCHECK_MSG( lpDIBh, bitmap, wxT("could not allocate memory for DIB header") );
|
||||
// Fill in the DIB header
|
||||
lpDIBh->bmiHeader.biSize = headersize;
|
||||
@@ -939,7 +939,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
|
||||
|
||||
// create a DIB header
|
||||
int headersize = sizeof(BITMAPINFOHEADER);
|
||||
LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize );
|
||||
BITMAPINFO *lpDIBh = (BITMAPINFO *) malloc( headersize );
|
||||
if( !lpDIBh )
|
||||
{
|
||||
wxFAIL_MSG( wxT("could not allocate data for DIB header") );
|
||||
|
@@ -3265,16 +3265,16 @@ void wxGrid::DrawTextRectangle( wxDC& dc,
|
||||
switch ( horizAlign )
|
||||
{
|
||||
case wxRIGHT:
|
||||
x = rect.x + (rect.width - textWidth - 1.0);
|
||||
x = rect.x + (rect.width - textWidth - 1);
|
||||
break;
|
||||
|
||||
case wxCENTRE:
|
||||
x = rect.x + ((rect.width - textWidth)/2.0);
|
||||
x = rect.x + ((rect.width - textWidth)/2);
|
||||
break;
|
||||
|
||||
case wxLEFT:
|
||||
default:
|
||||
x = rect.x + 1.0;
|
||||
x = rect.x + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3285,12 +3285,12 @@ void wxGrid::DrawTextRectangle( wxDC& dc,
|
||||
break;
|
||||
|
||||
case wxCENTRE:
|
||||
y = rect.y + ((rect.height - textHeight)/2.0);
|
||||
y = rect.y + ((rect.height - textHeight)/2);
|
||||
break;
|
||||
|
||||
case wxTOP:
|
||||
default:
|
||||
y = rect.y + 1.0;
|
||||
y = rect.y + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -80,7 +80,7 @@ bool wxImageList::Replace( int index, const wxBitmap &bitmap )
|
||||
//so construct it from a bitmap object until I can figure this nonsense out. (DW)
|
||||
newBitmap = new wxBitmap(bitmap) ;
|
||||
#else
|
||||
newBitmap = new wxIcon( (const wxIcon&) bitmap );
|
||||
newBitmap = new wxBitmap( (const wxIcon&) bitmap );
|
||||
#endif
|
||||
else
|
||||
newBitmap = new wxBitmap(bitmap) ;
|
||||
|
@@ -240,7 +240,8 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
|
||||
// and update the buttons state
|
||||
m_btnPrev->Enable(m_page->GetPrev() != (wxWizardPage *)NULL);
|
||||
|
||||
if ( btnLabelWasNext != (m_page->GetNext() != (wxWizardPage *)NULL) )
|
||||
bool hasNext = m_page->GetNext() != (wxWizardPage *)NULL;
|
||||
if ( btnLabelWasNext != hasNext )
|
||||
{
|
||||
// need to update
|
||||
m_btnNext->SetLabel(btnLabelWasNext ? _("&Finish") : _("&Next >"));
|
||||
|
@@ -172,9 +172,9 @@ bool wxBitmap::CopyFromCursor(const wxCursor& cursor)
|
||||
wxFAIL_MSG( _T("don't know how to convert cursor to bitmap") );
|
||||
|
||||
return FALSE;
|
||||
#endif // Win16
|
||||
|
||||
#else
|
||||
return CopyFromIconOrCursor(cursor);
|
||||
#endif // Win16
|
||||
}
|
||||
|
||||
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
|
@@ -172,6 +172,9 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
}
|
||||
|
||||
BOOL ok;
|
||||
|
||||
// no MaskBlt() under Win16
|
||||
#ifdef __WIN32__
|
||||
wxMask *mask = bitmap->GetMask();
|
||||
if ( mask )
|
||||
{
|
||||
@@ -196,6 +199,7 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
::DeleteObject(hbrBackground);
|
||||
}
|
||||
else
|
||||
#endif // Win32
|
||||
{
|
||||
ok = ::BitBlt(hDC, x1, y1, wBmp, hBmp, // dst
|
||||
memDC, 0, 0, // src
|
||||
|
183
src/msw/dir.cpp
183
src/msw/dir.cpp
@@ -36,8 +36,148 @@
|
||||
#include "wx/dir.h"
|
||||
#include "wx/filefn.h" // for wxPathExists()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// define the types and functions used for file searching
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// under Win16 use compiler-specific functions
|
||||
#ifdef __WIN16__
|
||||
#ifdef __VISUALC__
|
||||
#include <dos.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef struct _find_t FIND_STRUCT;
|
||||
#elif defined(__BORLANDC__)
|
||||
#include <dir.h>
|
||||
|
||||
typedef struct ffblk FIND_STRUCT;
|
||||
#else
|
||||
#error "No directory searching functions for this compiler"
|
||||
#endif
|
||||
|
||||
typedef FIND_STRUCT *FIND_DATA;
|
||||
typedef char FIND_ATTR;
|
||||
|
||||
static inline FIND_DATA InitFindData() { return (FIND_DATA)NULL; }
|
||||
static inline bool IsFindDataOk(FIND_DATA fd) { return fd != NULL; }
|
||||
static inline void FreeFindData(FIND_DATA fd) { free(fd); }
|
||||
|
||||
static inline FIND_DATA FindFirst(const wxString& spec,
|
||||
FIND_STRUCT * WXUNUSED(finddata))
|
||||
{
|
||||
// attribute to find all files
|
||||
static const FIND_ATTR attr = 0x3F;
|
||||
|
||||
FIND_DATA fd = (FIND_DATA)malloc(sizeof(FIND_STRUCT));
|
||||
|
||||
if (
|
||||
#ifdef __VISUALC__
|
||||
_dos_findfirst(spec, attr, fd) == 0
|
||||
#else // Borland
|
||||
findfirst(spec, fd, attr) == 0
|
||||
#endif
|
||||
)
|
||||
{
|
||||
return fd;
|
||||
}
|
||||
else
|
||||
{
|
||||
free(fd);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool FindNext(FIND_DATA fd, FIND_STRUCT * WXUNUSED(finddata))
|
||||
{
|
||||
#ifdef __VISUALC__
|
||||
return _dos_findnext(fd) == 0;
|
||||
#else // Borland
|
||||
return findnext(fd) == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static const wxChar *GetNameFromFindData(FIND_STRUCT *finddata)
|
||||
{
|
||||
#ifdef __VISUALC__
|
||||
return finddata->name;
|
||||
#else // Borland
|
||||
return finddata->ff_name;
|
||||
#endif
|
||||
}
|
||||
|
||||
static const FIND_ATTR GetAttrFromFindData(FIND_STRUCT *finddata)
|
||||
{
|
||||
#ifdef __VISUALC__
|
||||
return finddata->attrib;
|
||||
#else // Borland
|
||||
return finddata->ff_attrib;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool IsDir(FIND_ATTR attr)
|
||||
{
|
||||
return (attr & _A_SUBDIR) != 0;
|
||||
}
|
||||
|
||||
static inline bool IsHidden(FIND_ATTR attr)
|
||||
{
|
||||
return (attr & (_A_SYSTEM | _A_HIDDEN)) != 0;
|
||||
}
|
||||
#else // Win32
|
||||
#include <windows.h>
|
||||
|
||||
typedef WIN32_FIND_DATA FIND_STRUCT;
|
||||
typedef HANDLE FIND_DATA;
|
||||
typedef DWORD FIND_ATTR;
|
||||
|
||||
static inline FIND_DATA InitFindData() { return INVALID_HANDLE_VALUE; }
|
||||
|
||||
static inline bool IsFindDataOk(FIND_DATA fd)
|
||||
{
|
||||
return fd != INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
static inline void FreeFindData(FIND_DATA fd)
|
||||
{
|
||||
if ( !::FindClose(fd) )
|
||||
{
|
||||
wxLogLastError(_T("FindClose"));
|
||||
}
|
||||
}
|
||||
|
||||
static inline FIND_DATA FindFirst(const wxString& spec,
|
||||
FIND_STRUCT *finddata)
|
||||
{
|
||||
return ::FindFirstFile(filespec, &finddata);
|
||||
}
|
||||
|
||||
static inline bool FindNext(FIND_DATA fd, FIND_STRUCT *finddata)
|
||||
{
|
||||
return ::FindNextFile(fd, finddata) != 0;
|
||||
}
|
||||
|
||||
static const wxChar *GetNameFromFindData(FIND_STRUCT *finddata)
|
||||
{
|
||||
return finddata->cFileName;
|
||||
}
|
||||
|
||||
static const FIND_ATTR GetAttrFromFindData(FIND_STRUCT *finddata)
|
||||
{
|
||||
return finddata->dwFileAttributes;
|
||||
}
|
||||
|
||||
static inline bool IsDir(FIND_ATTR attr)
|
||||
{
|
||||
return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
||||
}
|
||||
|
||||
static inline bool IsHidden(FIND_ATTR attr)
|
||||
{
|
||||
return (attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)) != 0;
|
||||
}
|
||||
#endif // __WIN16__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -71,7 +211,7 @@ public:
|
||||
bool Read(wxString *filename);
|
||||
|
||||
private:
|
||||
HANDLE m_handle;
|
||||
FIND_DATA m_finddata;
|
||||
|
||||
wxString m_dirname;
|
||||
wxString m_filespec;
|
||||
@@ -90,7 +230,7 @@ private:
|
||||
wxDirData::wxDirData(const wxString& dirname)
|
||||
: m_dirname(dirname)
|
||||
{
|
||||
m_handle = INVALID_HANDLE_VALUE;
|
||||
m_finddata = InitFindData();
|
||||
}
|
||||
|
||||
wxDirData::~wxDirData()
|
||||
@@ -100,14 +240,11 @@ wxDirData::~wxDirData()
|
||||
|
||||
void wxDirData::Close()
|
||||
{
|
||||
if ( m_handle != INVALID_HANDLE_VALUE )
|
||||
if ( IsFindDataOk(m_finddata) )
|
||||
{
|
||||
if ( !::FindClose(m_handle) )
|
||||
{
|
||||
wxLogLastError(_T("FindClose"));
|
||||
}
|
||||
FreeFindData(m_finddata);
|
||||
|
||||
m_handle = INVALID_HANDLE_VALUE;
|
||||
m_finddata = InitFindData();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,21 +257,28 @@ bool wxDirData::Read(wxString *filename)
|
||||
{
|
||||
bool first = FALSE;
|
||||
|
||||
#ifdef __WIN32__
|
||||
WIN32_FIND_DATA finddata;
|
||||
if ( m_handle == INVALID_HANDLE_VALUE )
|
||||
#define PTR_TO_FINDDATA (&finddata)
|
||||
#else // Win16
|
||||
#define PTR_TO_FINDDATA (m_finddata)
|
||||
#endif
|
||||
|
||||
if ( !IsFindDataOk(m_finddata) )
|
||||
{
|
||||
// open first
|
||||
wxString filespec;
|
||||
filespec << m_dirname << _T('\\')
|
||||
<< (!m_filespec ? _T("*.*") : m_filespec.c_str());
|
||||
|
||||
m_handle = ::FindFirstFile(filespec, &finddata);
|
||||
m_finddata = FindFirst(filespec, PTR_TO_FINDDATA);
|
||||
|
||||
first = TRUE;
|
||||
}
|
||||
|
||||
if ( m_handle == INVALID_HANDLE_VALUE )
|
||||
if ( !IsFindDataOk(m_finddata) )
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
DWORD err = ::GetLastError();
|
||||
|
||||
if ( err != ERROR_FILE_NOT_FOUND )
|
||||
@@ -142,13 +286,14 @@ bool wxDirData::Read(wxString *filename)
|
||||
wxLogSysError(err, _("Can not enumerate files in directory '%s'"),
|
||||
m_dirname.c_str());
|
||||
}
|
||||
#endif // __WIN32__
|
||||
//else: not an error, just no (such) files
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const wxChar *name;
|
||||
DWORD attr;
|
||||
FIND_ATTR attr;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
@@ -158,22 +303,24 @@ bool wxDirData::Read(wxString *filename)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !::FindNextFile(m_handle, &finddata) )
|
||||
if ( !FindNext(m_finddata, PTR_TO_FINDDATA) )
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
DWORD err = ::GetLastError();
|
||||
|
||||
if ( err != ERROR_NO_MORE_FILES )
|
||||
{
|
||||
wxLogLastError(_T("FindNext"));
|
||||
}
|
||||
#endif // __WIN32__
|
||||
//else: not an error, just no more (such) files
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
name = finddata.cFileName;
|
||||
attr = finddata.dwFileAttributes;
|
||||
name = GetNameFromFindData(PTR_TO_FINDDATA);
|
||||
attr = GetAttrFromFindData(PTR_TO_FINDDATA);
|
||||
|
||||
// don't return "." and ".." unless asked for
|
||||
if ( name[0] == _T('.') &&
|
||||
@@ -185,12 +332,12 @@ bool wxDirData::Read(wxString *filename)
|
||||
}
|
||||
|
||||
// check the type now
|
||||
if ( !(m_flags & wxDIR_FILES) && !(attr & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
if ( !(m_flags & wxDIR_FILES) && !IsDir(attr) )
|
||||
{
|
||||
// it's a file, but we don't want them
|
||||
continue;
|
||||
}
|
||||
else if ( !(m_flags & wxDIR_DIRS) && (attr & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
else if ( !(m_flags & wxDIR_DIRS) && IsDir(attr) )
|
||||
{
|
||||
// it's a dir, and we don't want it
|
||||
continue;
|
||||
@@ -199,7 +346,7 @@ bool wxDirData::Read(wxString *filename)
|
||||
// finally, check whether it's a hidden file
|
||||
if ( !(m_flags & wxDIR_HIDDEN) )
|
||||
{
|
||||
if ( attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM) )
|
||||
if ( IsHidden(attr) )
|
||||
{
|
||||
// it's a hidden file, skip it
|
||||
continue;
|
||||
|
@@ -21,28 +21,26 @@
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <stdio.h>
|
||||
#include "wx/defs.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include "wx/msw/private.h"
|
||||
#endif
|
||||
|
||||
#if !defined(__WIN32__) || defined(__SALFORDC__) || defined(__WXWINE__)
|
||||
#include <commdlg.h>
|
||||
#endif
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "wx/tokenzr.h"
|
||||
|
||||
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
||||
|
||||
wxString wxFileSelector(const wxChar *title,
|
||||
|
@@ -129,7 +129,12 @@ void wxFontEnumeratorHelper::DoEnumerate()
|
||||
(LPARAM)this, 0 /* reserved */) ;
|
||||
#else // Win16
|
||||
::EnumFonts(hDC, (LPTSTR)NULL, (FONTENUMPROC)wxFontEnumeratorProc,
|
||||
(LPARAM) (void*) this) ;
|
||||
#ifdef STRICT
|
||||
(LPARAM)
|
||||
#else
|
||||
(LPSTR)
|
||||
#endif
|
||||
this);
|
||||
#endif // Win32/16
|
||||
|
||||
::ReleaseDC(NULL, hDC);
|
||||
|
@@ -62,7 +62,7 @@
|
||||
|
||||
extern wxWindowList wxModelessWindows;
|
||||
extern wxList WXDLLEXPORT wxPendingDelete;
|
||||
extern wxChar wxFrameClassName[];
|
||||
extern wxChar *wxFrameClassName;
|
||||
extern wxMenu *wxCurrentPopupMenu;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -39,6 +39,10 @@
|
||||
#include "wx/msw/dib.h"
|
||||
#include "wx/msw/gdiimage.h"
|
||||
|
||||
#ifdef __WIN16__
|
||||
#include "wx/msw/curico.h"
|
||||
#endif // __WIN16__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -68,6 +68,41 @@ static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, L
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxListEvent
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListEvent::CopyObject(wxObject& object_dest) const
|
||||
{
|
||||
wxListEvent *obj = (wxListEvent *)&object_dest;
|
||||
|
||||
wxNotifyEvent::CopyObject(object_dest);
|
||||
|
||||
obj->m_code = m_code;
|
||||
obj->m_itemIndex = m_itemIndex;
|
||||
obj->m_oldItemIndex = m_oldItemIndex;
|
||||
obj->m_col = m_col;
|
||||
obj->m_cancelled = m_cancelled;
|
||||
obj->m_pointDrag = m_pointDrag;
|
||||
obj->m_item.m_mask = m_item.m_mask;
|
||||
obj->m_item.m_itemId = m_item.m_itemId;
|
||||
obj->m_item.m_col = m_item.m_col;
|
||||
obj->m_item.m_state = m_item.m_state;
|
||||
obj->m_item.m_stateMask = m_item.m_stateMask;
|
||||
obj->m_item.m_text = m_item.m_text;
|
||||
obj->m_item.m_image = m_item.m_image;
|
||||
obj->m_item.m_data = m_item.m_data;
|
||||
obj->m_item.m_format = m_item.m_format;
|
||||
obj->m_item.m_width = m_item.m_width;
|
||||
|
||||
if ( m_item.HasAttributes() )
|
||||
{
|
||||
obj->m_item.SetTextColour(m_item.GetTextColour());
|
||||
obj->m_item.SetBackgroundColour(m_item.GetBackgroundColour());
|
||||
obj->m_item.SetFont(m_item.GetFont());
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxListCtrl construction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -64,26 +64,21 @@ HINSTANCE wxhInstance = 0;
|
||||
#if !defined(_WINDLL)
|
||||
|
||||
#if defined(__TWIN32__) || defined(__WXWINE__)
|
||||
#define HINSTANCE HANDLE
|
||||
|
||||
extern "C"
|
||||
BOOL PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
int PASCAL
|
||||
#else
|
||||
int APIENTRY
|
||||
#endif
|
||||
|
||||
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
|
||||
#endif
|
||||
// __TWIN32__
|
||||
#endif // WINE
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
return wxEntry((WXHINSTANCE) hInstance, (WXHINSTANCE) hPrevInstance, lpCmdLine, nCmdShow);
|
||||
return wxEntry((WXHINSTANCE) hInstance, (WXHINSTANCE) hPrevInstance,
|
||||
lpCmdLine, nCmdShow);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !defined(_WINDLL)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// DllMain
|
||||
|
@@ -63,8 +63,8 @@
|
||||
extern wxWindowList wxModelessWindows; // from dialog.cpp
|
||||
extern wxMenu *wxCurrentPopupMenu;
|
||||
|
||||
extern wxChar wxMDIFrameClassName[];
|
||||
extern wxChar wxMDIChildFrameClassName[];
|
||||
extern wxChar *wxMDIFrameClassName;
|
||||
extern wxChar *wxMDIChildFrameClassName;
|
||||
extern wxWindow *wxWndHook; // from window.cpp
|
||||
|
||||
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
|
||||
|
@@ -185,7 +185,9 @@ bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
{
|
||||
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) item;
|
||||
|
||||
wxBitmap* bitmap = m_image.bitmap;
|
||||
wxCHECK_MSG( !m_isIcon, FALSE, _T("icons not supported in wxStaticBitmap") );
|
||||
|
||||
wxBitmap* bitmap = (wxBitmap *)m_image;
|
||||
if ( !bitmap->Ok() )
|
||||
return FALSE;
|
||||
|
||||
|
@@ -119,7 +119,7 @@ extern MSG s_currentMsg;
|
||||
|
||||
wxMenu *wxCurrentPopupMenu = NULL;
|
||||
extern wxList WXDLLEXPORT wxPendingDelete;
|
||||
extern wxChar wxCanvasClassName[];
|
||||
extern wxChar *wxCanvasClassName;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// private functions
|
||||
|
Reference in New Issue
Block a user