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 wxClientData;
class WXDLLEXPORT wxDC; class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxMenu;
class WXDLLEXPORT wxWindow;
#endif // wxUSE_GUI #endif // wxUSE_GUI
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

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

View File

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

View File

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

View File

@@ -441,7 +441,7 @@ bool wxDDEConnection::Disconnect(void)
return (DdeDisconnect((HCONV) m_hConv) != 0); 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; DWORD result;
if (size < 0) if (size < 0)

View File

@@ -83,14 +83,14 @@
#define PALVERSION 0x300 #define PALVERSION 0x300
#define MAXPALETTE 256 /* max. # supported palette entries */ #define MAXPALETTE 256 /* max. # supported palette entries */
DWORD PASCAL lread(int fh, VOID FAR *pv, DWORD ul); static DWORD PASCAL lread(int fh, VOID FAR *pv, DWORD ul);
DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul); static DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul);
BOOL WriteDIB (LPTSTR szFile,HANDLE hdib); static BOOL WriteDIB (LPTSTR szFile,HANDLE hdib);
WORD PaletteSize (VOID FAR * pv); static WORD PaletteSize (VOID FAR * pv);
WORD DibNumColors (VOID FAR * pv); static WORD DibNumColors (VOID FAR * pv);
// HANDLE DibFromBitmap (HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal); // HANDLE DibFromBitmap (HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal);
BOOL PASCAL MakeBitmapAndPalette(HDC,HANDLE,HPALETTE *,HBITMAP *); 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) p < (WORD *)&pMFHead ->checksum; ++p)
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; if (!fd) return FALSE;
wxChar tempFileBuf[256]; wxChar tempFileBuf[256];

View File

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

View File

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

View File

@@ -54,7 +54,7 @@ UINT WINAPI _EXPORT wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifdef __WIN32__ #ifdef __WIN32__
#define _EXPORT /**/ #define _EXPORT
#else #else
#define _EXPORT _export #define _EXPORT _export
#endif #endif
@@ -70,14 +70,15 @@ UINT WINAPI _EXPORT wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxTimer class // wxTimer class
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxTimer::wxTimer(void)
wxTimer::wxTimer()
{ {
milli = 0; milli = 0;
lastMilli = -1; lastMilli = -1;
id = 0; id = 0;
} }
wxTimer::~wxTimer(void) wxTimer::~wxTimer()
{ {
Stop(); Stop();
@@ -114,11 +115,12 @@ bool wxTimer::Start(int milliseconds, bool mode)
} }
} }
void wxTimer::Stop(void) void wxTimer::Stop()
{
if ( id )
{ {
if (id) {
KillTimer(NULL, (UINT)id); KillTimer(NULL, (UINT)id);
wxTimerList.DeleteObject(this); /* @@@@ */ wxTimerList.DeleteObject(this);
} }
id = 0; id = 0;
milli = 0; milli = 0;
@@ -127,6 +129,7 @@ void wxTimer::Stop(void)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private functions // private functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxProcessTimer(wxTimer& timer) void wxProcessTimer(wxTimer& timer)
{ {
// Avoid to process spurious timer events // Avoid to process spurious timer events

View File

@@ -463,7 +463,7 @@ size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
{ {
TraverseCounter counter(this, item, recursively); 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) if (dc)
{ {
xpmAttr.valuemask = XpmReturnPixels; 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); DeleteDC(dc);
if (errorStatus == XpmSuccess) if (errorStatus == XpmSuccess)
{ {
@@ -108,7 +108,7 @@ bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type
ximage.height = M_BITMAPHANDLERDATA->m_height; ximage.height = M_BITMAPHANDLERDATA->m_height;
ximage.depth = M_BITMAPHANDLERDATA->m_depth; ximage.depth = M_BITMAPHANDLERDATA->m_depth;
ximage.bitmap = (HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap; 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); &ximage, (XImage *) NULL, (XpmAttributes *) NULL);
if (dc) if (dc)