MSW compilation (and other) fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3829 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-10-04 22:55:10 +00:00
parent e90c1d2a19
commit 73974df1f9
13 changed files with 58 additions and 49 deletions

View File

@@ -37,6 +37,7 @@ class WXDLLEXPORT wxList;
class WXDLLEXPORT wxClientData;
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxMenu;
class WXDLLEXPORT wxWindow;
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------

View File

@@ -12,13 +12,12 @@
#ifndef _WX_SETUP_H_
#define _WX_SETUP_H_
/*
* General features
*
*/
// ----------------------------------------------------------------------------
// global settings
// ----------------------------------------------------------------------------
#define wxUSE_CONFIG 1
// Use wxConfig, with CreateConfig in wxApp
// define this to 0 when building wxBase library
#define wxUSE_GUI 1
#define WXWIN_COMPATIBILITY 0
// Compatibility with 1.68 API.
@@ -27,6 +26,13 @@
// the compatibility code is now very minimal so there
// is little advantage to setting it to 1.
// ----------------------------------------------------------------------------
// General features
// ----------------------------------------------------------------------------
#define wxUSE_CONFIG 1
// Use wxConfig, with CreateConfig in wxApp
#define wxUSE_POSTSCRIPT 0
// 0 for no PostScript device context
#define wxUSE_AFM_FOR_POSTSCRIPT 0

View File

@@ -6,7 +6,7 @@
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIMER_H_
@@ -37,9 +37,9 @@ public:
bool OneShot() const { return oneShot; }
protected:
bool oneShot ;
int milli ;
int lastMilli ;
bool oneShot;
int milli;
int lastMilli;
long id;

View File

@@ -47,6 +47,9 @@
# define HAVE_WCSLEN 1
# include <tchar.h>
# define T(x) _T(x)
# if wxUSE_UNICODE // temporary - preserve binary compatibility
typedef _TCHAR wxChar;
typedef _TSCHAR wxSChar;

View File

@@ -1279,7 +1279,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates,
wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
int noTemplates)
{
const wxChar **strings = new wxChar *[noTemplates];
wxChar **strings = new wxChar *[noTemplates];
wxChar **data = new wxChar *[noTemplates];
int i;
int n = 0;
@@ -1287,7 +1287,7 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
{
if (templates[i]->IsVisible())
{
strings[n] = templates[i]->m_description;
strings[n] = (wxChar *)templates[i]->m_description.c_str();
data[n] = (wxChar *)templates[i];
n ++;
}
@@ -1316,7 +1316,7 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates,
int noTemplates)
{
const wxChar **strings = new wxChar *[noTemplates];
wxChar **strings = new wxChar *[noTemplates];
wxChar **data = new wxChar *[noTemplates];
int i;
int n = 0;
@@ -1324,7 +1324,7 @@ wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates,
{
if (templates[i]->IsVisible() && (templates[i]->GetViewName() != T("")))
{
strings[n] = templates[i]->m_viewTypeName;
strings[n] = (wxChar *)templates[i]->m_viewTypeName.c_str();
data[n] = (wxChar *)templates[i];
n ++;
}

View File

@@ -441,7 +441,7 @@ bool wxDDEConnection::Disconnect(void)
return (DdeDisconnect((HCONV) m_hConv) != 0);
}
bool wxDDEConnection::Execute(wxChar *data, int size, wxIPCFormat format)
bool wxDDEConnection::Execute(const wxChar *data, int size, wxIPCFormat format)
{
DWORD result;
if (size < 0)

View File

@@ -83,14 +83,14 @@
#define PALVERSION 0x300
#define MAXPALETTE 256 /* max. # supported palette entries */
DWORD PASCAL lread(int fh, VOID FAR *pv, DWORD ul);
DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul);
static DWORD PASCAL lread(int fh, VOID FAR *pv, DWORD ul);
static DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul);
BOOL WriteDIB (LPTSTR szFile,HANDLE hdib);
WORD PaletteSize (VOID FAR * pv);
WORD DibNumColors (VOID FAR * pv);
// HANDLE DibFromBitmap (HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal);
BOOL PASCAL MakeBitmapAndPalette(HDC,HANDLE,HPALETTE *,HBITMAP *);
static BOOL WriteDIB (LPTSTR szFile,HANDLE hdib);
static WORD PaletteSize (VOID FAR * pv);
static WORD DibNumColors (VOID FAR * pv);
// HANDLE DibFromBitmap (HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal);
static BOOL PASCAL MakeBitmapAndPalette(HDC,HANDLE,HPALETTE *,HBITMAP *);
/****************************************************************************
* *

View File

@@ -340,7 +340,7 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i
p < (WORD *)&pMFHead ->checksum; ++p)
pMFHead ->checksum ^= *p;
FILE *fd = fopen(filename.mb_str(wxConvFile), "rb");
FILE *fd = fopen(filename.fn_str(), "rb");
if (!fd) return FALSE;
wxChar tempFileBuf[256];

View File

@@ -386,35 +386,30 @@ wxMask *wxPNGReader::CreateMask()
bool wxPNGReader::ReadFile(wxChar * ImageFileName)
{
int number_passes;
if (ImageFileName)
wxStrcpy(filename, ImageFileName);
FILE *fp;
png_struct *png_ptr;
png_info *info_ptr;
/* open the file */
fp = fopen(wxConvFile.cWX2MB(filename), "rb");
FILE *fp = fopen(wxConvFile.cWX2MB(filename), "rb");
if (!fp)
return FALSE;
/* allocate the necessary structures */
png_ptr = new (png_struct);
png_struct *png_ptr = new (png_struct);
if (!png_ptr)
{
fclose(fp);
return FALSE;
}
info_ptr = new (png_info);
png_info *info_ptr = new (png_info);
if (!info_ptr)
{
fclose(fp);
delete(png_ptr);
return FALSE;
}
/* set error handling */
if (setjmp(png_ptr->jmpbuf))
{
@@ -478,6 +473,7 @@ bool wxPNGReader::ReadFile(wxChar * ImageFileName)
byte *row_pointers = new byte[row_stride];
/* turn on interlace handling */
int number_passes;
if (info_ptr->interlace_type)
number_passes = png_set_interlace_handling(png_ptr);
else

View File

@@ -167,14 +167,14 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
m_lDlgCode |= DLGC_WANTTAB;
// do create the control - either an EDIT or RICHEDIT
const wxChar *windowClass = T("EDIT(");
const wxChar *windowClass = T("EDIT");
#if wxUSE_RICHEDIT
if ( m_windowStyle & wxTE_RICH )
{
msStyle |= ES_AUTOVSCROLL;
m_isRich = TRUE;
windowClass = T("RICHEDIT(");
windowClass = T("RICHEDIT");
}
else
m_isRich = FALSE;

View File

@@ -6,7 +6,7 @@
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -54,7 +54,7 @@ UINT WINAPI _EXPORT wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD);
// ----------------------------------------------------------------------------
#ifdef __WIN32__
#define _EXPORT /**/
#define _EXPORT
#else
#define _EXPORT _export
#endif
@@ -70,14 +70,15 @@ UINT WINAPI _EXPORT wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD);
// ----------------------------------------------------------------------------
// wxTimer class
// ----------------------------------------------------------------------------
wxTimer::wxTimer(void)
wxTimer::wxTimer()
{
milli = 0 ;
lastMilli = -1 ;
milli = 0;
lastMilli = -1;
id = 0;
}
wxTimer::~wxTimer(void)
wxTimer::~wxTimer()
{
Stop();
@@ -86,7 +87,7 @@ wxTimer::~wxTimer(void)
bool wxTimer::Start(int milliseconds, bool mode)
{
oneShot = mode ;
oneShot = mode;
if (milliseconds < 0)
milliseconds = lastMilli;
@@ -114,19 +115,21 @@ bool wxTimer::Start(int milliseconds, bool mode)
}
}
void wxTimer::Stop(void)
void wxTimer::Stop()
{
if (id) {
if ( id )
{
KillTimer(NULL, (UINT)id);
wxTimerList.DeleteObject(this); /* @@@@ */
wxTimerList.DeleteObject(this);
}
id = 0 ;
milli = 0 ;
id = 0;
milli = 0;
}
// ----------------------------------------------------------------------------
// private functions
// ----------------------------------------------------------------------------
void wxProcessTimer(wxTimer& timer)
{
// Avoid to process spurious timer events

View File

@@ -463,7 +463,7 @@ size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
{
TraverseCounter counter(this, item, recursively);
return counter.GetCount();
return counter.GetCount() - 1;
}
// ----------------------------------------------------------------------------

View File

@@ -60,7 +60,7 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
if (dc)
{
xpmAttr.valuemask = XpmReturnPixels;
int errorStatus = XpmReadFileToImage(&dc, wxMBSTRINGCAST name.mb_str(wxConvFile), &ximage, (XImage **) NULL, &xpmAttr);
int errorStatus = XpmReadFileToImage(&dc, wxMBSTRINGCAST name.fn_str(), &ximage, (XImage **) NULL, &xpmAttr);
DeleteDC(dc);
if (errorStatus == XpmSuccess)
{
@@ -108,7 +108,7 @@ bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type
ximage.height = M_BITMAPHANDLERDATA->m_height;
ximage.depth = M_BITMAPHANDLERDATA->m_depth;
ximage.bitmap = (HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap;
int errorStatus = XpmWriteFileFromImage(&dc, wxMBSTRINGCAST name.mb_str(wxConvFile),
int errorStatus = XpmWriteFileFromImage(&dc, wxMBSTRINGCAST name.fn_str(),
&ximage, (XImage *) NULL, (XpmAttributes *) NULL);
if (dc)