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:
Vadim Zeitlin
1999-12-16 21:29:54 +00:00
parent b4d1ebf058
commit 8f177c8e73
24 changed files with 798 additions and 450 deletions

View File

@@ -101,7 +101,7 @@ config.cpp C B
ctrlcmn.cpp C ctrlcmn.cpp C
ctrlsub.cpp C ctrlsub.cpp C
date.cpp C B date.cpp C B
datetime.cpp C B datetime.cpp C 32,B
datstrm.cpp C datstrm.cpp C
db.cpp C db.cpp C
dbtable.cpp C dbtable.cpp C
@@ -146,7 +146,7 @@ layout.cpp C
lboxcmn.cpp C lboxcmn.cpp C
list.cpp C B list.cpp C B
log.cpp C B log.cpp C B
longlong.cpp C B longlong.cpp C 32,B
memory.cpp C memory.cpp C
menucmn.cpp C menucmn.cpp C
mimetype.cpp C 32,B mimetype.cpp C 32,B

View File

@@ -328,7 +328,7 @@ typedef int wxWindowID;
// wxCALLBACK should be used for the functions which are called back by // wxCALLBACK should be used for the functions which are called back by
// Windows (such as compare function for wxListCtrl) // Windows (such as compare function for wxListCtrl)
#if defined(__WXMSW__) #if defined(__WIN32__)
#if defined(__MINGW32__) || defined(__GNUWIN32__) #if defined(__MINGW32__) || defined(__GNUWIN32__)
#define wxCALLBACK __attribute__((stdcall)) #define wxCALLBACK __attribute__((stdcall))
#else #else
@@ -336,7 +336,7 @@ typedef int wxWindowID;
#define wxCALLBACK _stdcall #define wxCALLBACK _stdcall
#endif #endif
#else #else
// no stdcall under Unix // no stdcall under Unix nor Win16
#define wxCALLBACK #define wxCALLBACK
#endif // platform #endif // platform

View File

@@ -45,12 +45,12 @@ public:
#if wxUSE_STREAMS #if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 ); 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 SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual int GetImageCount( wxInputStream& stream ); virtual int GetImageCount( wxInputStream& stream );
bool CanRead( wxInputStream& stream ) { return DoCanRead(stream); } bool CanRead( wxInputStream& stream ) { return DoCanRead(stream); }
bool CanRead( const wxString& name ); bool CanRead( const wxString& name );
#endif #endif // wxUSE_STREAMS
void SetName(const wxString& name) { m_name = name; } void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; } void SetExtension(const wxString& ext) { m_extension = ext; }
@@ -62,17 +62,176 @@ public:
wxString GetMimeType() const { return m_mime; } wxString GetMimeType() const { return m_mime; }
protected: protected:
#if wxUSE_STREAMS
virtual bool DoCanRead( wxInputStream& stream ) = 0; virtual bool DoCanRead( wxInputStream& stream ) = 0;
#endif // wxUSE_STREAMS
wxString m_name; wxString m_name;
wxString m_extension; wxString m_extension;
wxString m_mime; wxString m_mime;
long m_type; 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 // wxImage
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -284,9 +284,7 @@ public:
inline long GetMask() { return m_item.m_mask; } inline long GetMask() { return m_item.m_mask; }
inline const wxListItem &GetItem() const { return m_item; } inline const wxListItem &GetItem() const { return m_item; }
#ifndef __WXMSW__
void CopyObject(wxObject& object_dest) const; void CopyObject(wxObject& object_dest) const;
#endif
private: private:
DECLARE_DYNAMIC_CLASS(wxListEvent) DECLARE_DYNAMIC_CLASS(wxListEvent)

View File

@@ -104,8 +104,8 @@ protected:
}; };
#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL)) #if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance, char *lpszCmdLine, int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance,
int nCmdShow, bool enterLoop = TRUE); char *lpszCmdLine, int nCmdShow, bool enterLoop = TRUE);
#else #else
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance); int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance);
#endif #endif

View File

@@ -6,7 +6,7 @@
// Created: 01/02/97 // Created: 01/02/97
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart // Copyright: (c) Julian Smart
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOUR_H_ #ifndef _WX_COLOUR_H_
@@ -75,8 +75,11 @@ public:
WXCOLORREF GetPixel() const { return m_pixel; }; WXCOLORREF GetPixel() const { return m_pixel; };
public:
WXCOLORREF m_pixel;
private: private:
bool m_isInit; bool m_isInit;
unsigned char m_red; unsigned char m_red;
unsigned char m_blue; unsigned char m_blue;
unsigned char m_green; unsigned char m_green;
@@ -84,12 +87,9 @@ private:
// helper func // helper func
void InitFromName(const wxString& colourName); void InitFromName(const wxString& colourName);
public:
WXCOLORREF m_pixel ;
private: private:
DECLARE_DYNAMIC_CLASS(wxColour) DECLARE_DYNAMIC_CLASS(wxColour)
}; };
#endif #endif
// _WX_COLOUR_H_ // _WX_COLOUR_H_

View File

@@ -16,7 +16,7 @@
#pragma interface "tbarmsw.h" #pragma interface "tbarmsw.h"
#endif #endif
#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR #if wxUSE_TOOLBAR
#include "wx/tbarbase.h" #include "wx/tbarbase.h"
@@ -144,7 +144,7 @@ private:
DECLARE_DYNAMIC_CLASS(wxToolBar) DECLARE_DYNAMIC_CLASS(wxToolBar)
}; };
#endif // wxUSE_TOOL/BUTTONBAR #endif // wxUSE_TOOLBAR
#endif #endif
// _WX_TBARMSW_H_ // _WX_TBARMSW_H_

View File

@@ -314,7 +314,7 @@ void wxPrintData::ConvertToNative()
if ( hDevMode ) if ( hDevMode )
{ {
DEVMODE *devMode = (DEVMODE*) GlobalLock(hDevMode); LPDEVMODE devMode = (LPDEVMODE) GlobalLock(hDevMode);
//// Orientation //// Orientation
@@ -436,7 +436,7 @@ void wxPrintData::ConvertFromNative()
if ( hDevMode ) if ( hDevMode )
{ {
DEVMODE *devMode = (DEVMODE*) GlobalLock(hDevMode); LPDEVMODE devMode = (LPDEVMODE)GlobalLock(hDevMode);
#ifndef __WXWINE__ #ifndef __WXWINE__
//// Orientation //// Orientation

View File

@@ -747,7 +747,7 @@ wxBitmap wxImage::ConvertToBitmap() const
// create a DIB header // create a DIB header
int headersize = sizeof(BITMAPINFOHEADER); 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") ); wxCHECK_MSG( lpDIBh, bitmap, wxT("could not allocate memory for DIB header") );
// Fill in the DIB header // Fill in the DIB header
lpDIBh->bmiHeader.biSize = headersize; lpDIBh->bmiHeader.biSize = headersize;
@@ -939,7 +939,7 @@ wxImage::wxImage( const wxBitmap &bitmap )
// create a DIB header // create a DIB header
int headersize = sizeof(BITMAPINFOHEADER); int headersize = sizeof(BITMAPINFOHEADER);
LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize ); BITMAPINFO *lpDIBh = (BITMAPINFO *) malloc( headersize );
if( !lpDIBh ) if( !lpDIBh )
{ {
wxFAIL_MSG( wxT("could not allocate data for DIB header") ); wxFAIL_MSG( wxT("could not allocate data for DIB header") );
@@ -1260,11 +1260,11 @@ wxImage::wxImage( const wxBitmap &bitmap )
} }
SetMaskColour( r, g, b ); SetMaskColour( r, g, b );
SetMask( TRUE ); SetMask( TRUE );
} }
else else
{ {
SetMask( FALSE ); SetMask( FALSE );
} }
// free allocated resources // free allocated resources
::ReleaseDC(NULL, hdc); ::ReleaseDC(NULL, hdc);
free(lpDIBh); free(lpDIBh);

File diff suppressed because it is too large Load Diff

View File

@@ -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) //so construct it from a bitmap object until I can figure this nonsense out. (DW)
newBitmap = new wxBitmap(bitmap) ; newBitmap = new wxBitmap(bitmap) ;
#else #else
newBitmap = new wxIcon( (const wxIcon&) bitmap ); newBitmap = new wxBitmap( (const wxIcon&) bitmap );
#endif #endif
else else
newBitmap = new wxBitmap(bitmap) ; newBitmap = new wxBitmap(bitmap) ;

View File

@@ -240,7 +240,8 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
// and update the buttons state // and update the buttons state
m_btnPrev->Enable(m_page->GetPrev() != (wxWizardPage *)NULL); 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 // need to update
m_btnNext->SetLabel(btnLabelWasNext ? _("&Finish") : _("&Next >")); m_btnNext->SetLabel(btnLabelWasNext ? _("&Finish") : _("&Next >"));

View File

@@ -172,9 +172,9 @@ bool wxBitmap::CopyFromCursor(const wxCursor& cursor)
wxFAIL_MSG( _T("don't know how to convert cursor to bitmap") ); wxFAIL_MSG( _T("don't know how to convert cursor to bitmap") );
return FALSE; return FALSE;
#endif // Win16 #else
return CopyFromIconOrCursor(cursor); return CopyFromIconOrCursor(cursor);
#endif // Win16
} }
bool wxBitmap::CopyFromIcon(const wxIcon& icon) bool wxBitmap::CopyFromIcon(const wxIcon& icon)

View File

@@ -172,6 +172,9 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
} }
BOOL ok; BOOL ok;
// no MaskBlt() under Win16
#ifdef __WIN32__
wxMask *mask = bitmap->GetMask(); wxMask *mask = bitmap->GetMask();
if ( mask ) if ( mask )
{ {
@@ -196,6 +199,7 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
::DeleteObject(hbrBackground); ::DeleteObject(hbrBackground);
} }
else else
#endif // Win32
{ {
ok = ::BitBlt(hDC, x1, y1, wBmp, hBmp, // dst ok = ::BitBlt(hDC, x1, y1, wBmp, hBmp, // dst
memDC, 0, 0, // src memDC, 0, 0, // src

View File

@@ -36,7 +36,147 @@
#include "wx/dir.h" #include "wx/dir.h"
#include "wx/filefn.h" // for wxPathExists() #include "wx/filefn.h" // for wxPathExists()
#include <windows.h> // ----------------------------------------------------------------------------
// 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 // constants
@@ -71,7 +211,7 @@ public:
bool Read(wxString *filename); bool Read(wxString *filename);
private: private:
HANDLE m_handle; FIND_DATA m_finddata;
wxString m_dirname; wxString m_dirname;
wxString m_filespec; wxString m_filespec;
@@ -90,7 +230,7 @@ private:
wxDirData::wxDirData(const wxString& dirname) wxDirData::wxDirData(const wxString& dirname)
: m_dirname(dirname) : m_dirname(dirname)
{ {
m_handle = INVALID_HANDLE_VALUE; m_finddata = InitFindData();
} }
wxDirData::~wxDirData() wxDirData::~wxDirData()
@@ -100,14 +240,11 @@ wxDirData::~wxDirData()
void wxDirData::Close() void wxDirData::Close()
{ {
if ( m_handle != INVALID_HANDLE_VALUE ) if ( IsFindDataOk(m_finddata) )
{ {
if ( !::FindClose(m_handle) ) FreeFindData(m_finddata);
{
wxLogLastError(_T("FindClose"));
}
m_handle = INVALID_HANDLE_VALUE; m_finddata = InitFindData();
} }
} }
@@ -120,21 +257,28 @@ bool wxDirData::Read(wxString *filename)
{ {
bool first = FALSE; bool first = FALSE;
#ifdef __WIN32__
WIN32_FIND_DATA finddata; 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 // open first
wxString filespec; wxString filespec;
filespec << m_dirname << _T('\\') filespec << m_dirname << _T('\\')
<< (!m_filespec ? _T("*.*") : m_filespec.c_str()); << (!m_filespec ? _T("*.*") : m_filespec.c_str());
m_handle = ::FindFirstFile(filespec, &finddata); m_finddata = FindFirst(filespec, PTR_TO_FINDDATA);
first = TRUE; first = TRUE;
} }
if ( m_handle == INVALID_HANDLE_VALUE ) if ( !IsFindDataOk(m_finddata) )
{ {
#ifdef __WIN32__
DWORD err = ::GetLastError(); DWORD err = ::GetLastError();
if ( err != ERROR_FILE_NOT_FOUND ) if ( err != ERROR_FILE_NOT_FOUND )
@@ -142,13 +286,14 @@ bool wxDirData::Read(wxString *filename)
wxLogSysError(err, _("Can not enumerate files in directory '%s'"), wxLogSysError(err, _("Can not enumerate files in directory '%s'"),
m_dirname.c_str()); m_dirname.c_str());
} }
#endif // __WIN32__
//else: not an error, just no (such) files //else: not an error, just no (such) files
return FALSE; return FALSE;
} }
const wxChar *name; const wxChar *name;
DWORD attr; FIND_ATTR attr;
for ( ;; ) for ( ;; )
{ {
@@ -158,22 +303,24 @@ bool wxDirData::Read(wxString *filename)
} }
else else
{ {
if ( !::FindNextFile(m_handle, &finddata) ) if ( !FindNext(m_finddata, PTR_TO_FINDDATA) )
{ {
#ifdef __WIN32__
DWORD err = ::GetLastError(); DWORD err = ::GetLastError();
if ( err != ERROR_NO_MORE_FILES ) if ( err != ERROR_NO_MORE_FILES )
{ {
wxLogLastError(_T("FindNext")); wxLogLastError(_T("FindNext"));
} }
#endif // __WIN32__
//else: not an error, just no more (such) files //else: not an error, just no more (such) files
return FALSE; return FALSE;
} }
} }
name = finddata.cFileName; name = GetNameFromFindData(PTR_TO_FINDDATA);
attr = finddata.dwFileAttributes; attr = GetAttrFromFindData(PTR_TO_FINDDATA);
// don't return "." and ".." unless asked for // don't return "." and ".." unless asked for
if ( name[0] == _T('.') && if ( name[0] == _T('.') &&
@@ -185,12 +332,12 @@ bool wxDirData::Read(wxString *filename)
} }
// check the type now // 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 // it's a file, but we don't want them
continue; 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 // it's a dir, and we don't want it
continue; continue;
@@ -199,7 +346,7 @@ bool wxDirData::Read(wxString *filename)
// finally, check whether it's a hidden file // finally, check whether it's a hidden file
if ( !(m_flags & wxDIR_HIDDEN) ) if ( !(m_flags & wxDIR_HIDDEN) )
{ {
if ( attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM) ) if ( IsHidden(attr) )
{ {
// it's a hidden file, skip it // it's a hidden file, skip it
continue; continue;

View File

@@ -21,29 +21,27 @@
#endif #endif
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include <stdio.h>
#include "wx/defs.h"
#include "wx/utils.h" #include "wx/utils.h"
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/dialog.h" #include "wx/dialog.h"
#include "wx/filedlg.h" #include "wx/filedlg.h"
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#endif
#include <windows.h> #include "wx/msw/private.h"
#endif
#if !defined(__WIN32__) || defined(__SALFORDC__) || defined(__WXWINE__) #if !defined(__WIN32__) || defined(__SALFORDC__) || defined(__WXWINE__)
#include <commdlg.h> #include <commdlg.h>
#endif #endif
#include "wx/msw/private.h"
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
IMPLEMENT_CLASS(wxFileDialog, wxDialog) #include "wx/tokenzr.h"
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
wxString wxFileSelector(const wxChar *title, wxString wxFileSelector(const wxChar *title,
const wxChar *defaultDir, const wxChar *defaultDir,

View File

@@ -129,7 +129,12 @@ void wxFontEnumeratorHelper::DoEnumerate()
(LPARAM)this, 0 /* reserved */) ; (LPARAM)this, 0 /* reserved */) ;
#else // Win16 #else // Win16
::EnumFonts(hDC, (LPTSTR)NULL, (FONTENUMPROC)wxFontEnumeratorProc, ::EnumFonts(hDC, (LPTSTR)NULL, (FONTENUMPROC)wxFontEnumeratorProc,
(LPARAM) (void*) this) ; #ifdef STRICT
(LPARAM)
#else
(LPSTR)
#endif
this);
#endif // Win32/16 #endif // Win32/16
::ReleaseDC(NULL, hDC); ::ReleaseDC(NULL, hDC);

View File

@@ -62,7 +62,7 @@
extern wxWindowList wxModelessWindows; extern wxWindowList wxModelessWindows;
extern wxList WXDLLEXPORT wxPendingDelete; extern wxList WXDLLEXPORT wxPendingDelete;
extern wxChar wxFrameClassName[]; extern wxChar *wxFrameClassName;
extern wxMenu *wxCurrentPopupMenu; extern wxMenu *wxCurrentPopupMenu;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -39,6 +39,10 @@
#include "wx/msw/dib.h" #include "wx/msw/dib.h"
#include "wx/msw/gdiimage.h" #include "wx/msw/gdiimage.h"
#ifdef __WIN16__
#include "wx/msw/curico.h"
#endif // __WIN16__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private classes // private classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -61,13 +61,48 @@ static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, L
// macros // macros
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
// ============================================================================ // ============================================================================
// implementation // 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 // wxListCtrl construction
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -64,26 +64,21 @@ HINSTANCE wxhInstance = 0;
#if !defined(_WINDLL) #if !defined(_WINDLL)
#if defined(__TWIN32__) || defined(__WXWINE__) #if defined(__TWIN32__) || defined(__WXWINE__)
#define HINSTANCE HANDLE
extern "C" extern "C"
BOOL PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) #endif // WINE
#else
#ifdef __WATCOMC__
int PASCAL
#else
int APIENTRY
#endif
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
#endif
// __TWIN32__
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 // DllMain

View File

@@ -63,8 +63,8 @@
extern wxWindowList wxModelessWindows; // from dialog.cpp extern wxWindowList wxModelessWindows; // from dialog.cpp
extern wxMenu *wxCurrentPopupMenu; extern wxMenu *wxCurrentPopupMenu;
extern wxChar wxMDIFrameClassName[]; extern wxChar *wxMDIFrameClassName;
extern wxChar wxMDIChildFrameClassName[]; extern wxChar *wxMDIChildFrameClassName;
extern wxWindow *wxWndHook; // from window.cpp extern wxWindow *wxWndHook; // from window.cpp
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win); extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);

View File

@@ -185,7 +185,9 @@ bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item)
{ {
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) 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() ) if ( !bitmap->Ok() )
return FALSE; return FALSE;

View File

@@ -119,7 +119,7 @@ extern MSG s_currentMsg;
wxMenu *wxCurrentPopupMenu = NULL; wxMenu *wxCurrentPopupMenu = NULL;
extern wxList WXDLLEXPORT wxPendingDelete; extern wxList WXDLLEXPORT wxPendingDelete;
extern wxChar wxCanvasClassName[]; extern wxChar *wxCanvasClassName;
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// private functions // private functions