From 788722ac5ca55bd3c0d1f9bd2d598f90b3b02071 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 14 May 2001 16:13:12 +0000 Subject: [PATCH] Fixes for 16-bit compilation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/tmake/filelist.txt | 2 +- include/wx/filename.h | 24 ++++++++++++------------ include/wx/list.h | 5 +++-- include/wx/matrix.h | 4 ---- src/common/datetime.cpp | 4 ++++ src/common/xpmdecod.cpp | 4 ++++ src/generic/dirctrlg.cpp | 4 ++++ src/msw/choice.cpp | 9 ++++++++- src/msw/combobox.cpp | 9 ++++++++- src/msw/control.cpp | 9 ++++++++- src/msw/cursor.cpp | 2 ++ src/msw/makefile.dos | 6 ++++++ src/msw/mdi.cpp | 3 +++ src/msw/radiobox.cpp | 9 ++++++++- src/msw/radiobut.cpp | 9 ++++++++- src/msw/textctrl.cpp | 9 ++++++++- src/msw/tglbtn.cpp | 4 ++++ src/msw/utils.cpp | 17 +++++++++++++++++ utils/projgen/makeproj.cpp | 1 + 19 files changed, 109 insertions(+), 25 deletions(-) diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index cfae1c5094..054fa153c4 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -159,7 +159,7 @@ imagtiff.cpp C 32 imagpcx.cpp C 32 imagpng.cpp C 32 imagpnm.cpp C 32 -imagxpm.cpp C 32 +imagxpm.cpp C init.cpp B intl.cpp C B ipcbase.cpp C B diff --git a/include/wx/filename.h b/include/wx/filename.h index 367ad81cbf..06696bfdf2 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -102,14 +102,6 @@ public: wxPathFormat format = wxPATH_NATIVE) { Assign(path, name, ext, format); } - // assorted assignment operators - - wxFileName& operator=(const wxFileName& filename) - { Assign(filename); return *this; } - - wxFileName& operator=(const wxString& filename) - { Assign(filename); return *this; } - // the same for delayed initialization // VZ: wouldn't it be better to call this Create() for consistency with @@ -128,6 +120,14 @@ public: void AssignDir(const wxString& dir, wxPathFormat format = wxPATH_NATIVE) { Assign(dir, _T(""), format); } + // assorted assignment operators + + wxFileName& operator=(const wxFileName& filename) + { Assign(filename); return *this; } + + wxFileName& operator=(const wxString& filename) + { Assign(filename); return *this; } + // reset all components to default, uninitialized state void Clear(); @@ -191,15 +191,15 @@ public: // Comparison + // compares with the rules of this platform + bool SameAs(const wxFileName &filepath, + wxPathFormat format = wxPATH_NATIVE); + // uses the current platform settings bool operator==(const wxFileName& filename) { return SameAs(filename); } bool operator==(const wxString& filename) { return *this == wxFileName(filename); } - // compares with the rules of this platform - bool SameAs(const wxFileName &filepath, - wxPathFormat format = wxPATH_NATIVE); - // Tests static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE ); bool IsRelative( wxPathFormat format = wxPATH_NATIVE ); diff --git a/include/wx/list.h b/include/wx/list.h index f5bf5336cc..283c4586be 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -187,6 +187,9 @@ class WXDLLEXPORT wxListBase : public wxObject { friend class wxNodeBase; // should be able to call DetachNode() friend class wxHashTableBase; // should be able to call untyped Find() +private: + // common part of all ctors + void Init(wxKeyType keyType = wxKEY_NONE); // Must be declared before it's used (for VC++ 1.5) public: // default ctor & dtor wxListBase(wxKeyType keyType = wxKEY_NONE) { Init(keyType); } @@ -308,8 +311,6 @@ protected: private: // helpers - // common part of all ctors - void Init(wxKeyType keyType = wxKEY_NONE); // common part of copy ctor and assignment operator void DoCopy(const wxListBase& list); // common part of all Append()s diff --git a/include/wx/matrix.h b/include/wx/matrix.h index 018362a171..e329c01f24 100644 --- a/include/wx/matrix.h +++ b/include/wx/matrix.h @@ -122,11 +122,7 @@ public: //!code: | -1 0 0 | //!code: matrix' = | 0 -1 0 | x matrix //!code: | 0 0 1 | -#if defined(__WXPM__) wxTransformMatrix& Mirror(bool x=TRUE, bool y=FALSE); -#else - wxTransformMatrix& Mirror(bool x=true, bool y=false); -#endif // Translate by dx, dy: //!ex: //!code: | 1 0 dx | diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index a38960ec05..2874bc6519 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -194,7 +194,11 @@ static const wxDateTime::wxDateTime_t gs_cumulatedDays[2][MONTHS_IN_YEAR] = // in the fine tradition of ANSI C we use our equivalent of (time_t)-1 to // indicate an invalid wxDateTime object +#ifdef __WIN16__ +static const wxDateTime gs_dtDefault; +#else static const wxDateTime gs_dtDefault = wxLongLong((long)ULONG_MAX, ULONG_MAX); +#endif const wxDateTime& wxDefaultDateTime = gs_dtDefault; diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index f05334ba3f..3b33170ab7 100644 --- a/src/common/xpmdecod.cpp +++ b/src/common/xpmdecod.cpp @@ -222,7 +222,11 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream) wxImage img = ReadData(xpm_lines); delete[] xpm_buffer; +#ifdef __WIN16__ + delete[] (char**) xpm_lines; +#else delete[] xpm_lines; +#endif return img; } #endif // wxUSE_STREAMS diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index b5559d65b4..6f27f881aa 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -316,7 +316,11 @@ int setdrive(int drive) newdrive[1] = ':'; newdrive[2] = '\0'; #if defined(__WXMSW__) +#ifdef __WIN16__ + if (wxSetWorkingDirectory(newdrive)) +#else if (SetCurrentDirectory((LPSTR)newdrive)) +#endif #else // VA doesn't know what LPSTR is and has its own set if (DosSetCurrentDir((PSZ)newdrive)) diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index d7d982797c..50612f6153 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -339,9 +339,16 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) } WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), +#if wxUSE_CTL3D + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam +#else WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), - WXLPARAM WXUNUSED(lParam)) + WXLPARAM WXUNUSED(lParam) +#endif + ) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 0d80dbcf05..557eab8975 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -142,9 +142,16 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd, } WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), +#if wxUSE_CTL3D + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam +#else WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), - WXLPARAM WXUNUSED(lParam)) + WXLPARAM WXUNUSED(lParam) +#endif + ) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/control.cpp b/src/msw/control.cpp index fd82221246..689ed8f972 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -224,9 +224,16 @@ void wxControl::OnEraseBackground(wxEraseEvent& event) } WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), +#if wxUSE_CTL3D + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam +#else WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), - WXLPARAM WXUNUSED(lParam)) + WXLPARAM WXUNUSED(lParam) +#endif + ) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 892ca4ee0f..0409580d2d 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -192,8 +192,10 @@ wxCursor::wxCursor(int cursor_type) switch (cursor_type) { case wxCURSOR_ARROWWAIT: +#ifndef __WIN16__ refData->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_APPSTARTING); break; +#endif case wxCURSOR_WAIT: refData->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_WAIT); break; diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos index 7ed4a50300..f2247e551d 100644 --- a/src/msw/makefile.dos +++ b/src/msw/makefile.dos @@ -130,6 +130,7 @@ COMMONOBJS1 = \ $(COMMDIR)\imagbmp.obj \ $(COMMDIR)\image.obj \ $(COMMDIR)\imaggif.obj \ + $(COMMDIR)\imagxpm.obj \ $(COMMDIR)\intl.obj \ $(COMMDIR)\ipcbase.obj \ $(COMMDIR)\layout.obj \ @@ -963,6 +964,11 @@ $(COMMDIR)/imaggif.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(COMMDIR)/imagxpm.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(COMMDIR)/intl.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 4eaf3c7779..2bd4fa48d5 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -1266,7 +1266,10 @@ static void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow) wxWindow *parent = win->GetParent(); wxCHECK_RET( parent, wxT("MDI client without parent frame? weird...") ); +#ifndef __WIN16__ ::SendMessage(GetWinHwnd(win), WM_MDIREFRESHMENU, 0, 0L); +#endif + ::DrawMenuBar(GetWinHwnd(parent)); } diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index ca437cd5d9..a89956a5ca 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -837,9 +837,16 @@ long wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) } WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), +#if wxUSE_CTL3D + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam +#else WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), - WXLPARAM WXUNUSED(lParam)) + WXLPARAM WXUNUSED(lParam) +#endif + ) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index c75402ceaf..d41d744284 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -173,9 +173,16 @@ void wxRadioButton::Command (wxCommandEvent & event) } WXHBRUSH wxRadioButton::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), +#if wxUSE_CTL3D + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam +#else WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), - WXLPARAM WXUNUSED(lParam)) + WXLPARAM WXUNUSED(lParam) +#endif + ) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 49e3c4ed43..83c92f0d9b 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -968,9 +968,16 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) } WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), +#if wxUSE_CTL3D + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam +#else WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), - WXLPARAM WXUNUSED(lParam)) + WXLPARAM WXUNUSED(lParam) +#endif + ) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/tglbtn.cpp b/src/msw/tglbtn.cpp index 353ac6526b..f428a631fe 100644 --- a/src/msw/tglbtn.cpp +++ b/src/msw/tglbtn.cpp @@ -81,6 +81,10 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id, m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); +#ifndef BS_PUSHLIKE +#define BS_PUSHLIKE 0x00001000L +#endif + long msStyle = BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP | WS_CHILD | WS_VISIBLE; #ifdef __WIN32__ if(m_windowStyle & wxBU_LEFT) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index e32d27860f..8e907f1bd2 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -463,6 +463,16 @@ bool wxDirExists(const wxString& dir) bool wxGetEnv(const wxString& var, wxString *value) { +#ifdef __WIN16__ + const wxChar* ret = wxGetenv(var); + if (ret) + { + *value = ret; + return TRUE; + } + else + return FALSE; +#else // first get the size of the buffer DWORD dwRet = ::GetEnvironmentVariable(var, NULL, 0); if ( !dwRet ) @@ -478,6 +488,7 @@ bool wxGetEnv(const wxString& var, wxString *value) } return TRUE; +#endif } bool wxSetEnv(const wxString& var, const wxChar *value) @@ -1034,14 +1045,20 @@ void wxDisplaySizeMM(int *width, int *height) void wxClientDisplayRect(int *x, int *y, int *width, int *height) { +#ifdef __WIN16__ + *x = 0; *y = 0; + wxDisplaySize(width, height); +#else // Determine the desktop dimensions minus the taskbar and any other // special decorations... RECT r; + SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0); if (x) *x = r.left; if (y) *y = r.top; if (width) *width = r.right - r.left; if (height) *height = r.bottom - r.top; +#endif } diff --git a/utils/projgen/makeproj.cpp b/utils/projgen/makeproj.cpp index e3e4999264..e52a40d524 100644 --- a/utils/projgen/makeproj.cpp +++ b/utils/projgen/makeproj.cpp @@ -228,6 +228,7 @@ void MyApp::GenerateSamples(const wxString& dir) GenerateSample("DynamicVC", "dynamic", dir + wxString("/samples/dynamic"), wxStringList("dynamic.cpp", 0)); GenerateSample("DrawingVC", "drawing", dir + wxString("/samples/drawing"), wxStringList("drawing.cpp", 0)); GenerateSample("ExecVC", "exec", dir + wxString("/samples/exec"), wxStringList("exec.cpp", 0)); + GenerateSample("EventVC", "event", dir + wxString("/samples/event"), wxStringList("event.cpp", 0)); GenerateSample("GridVC", "grid", dir + wxString("/samples/grid"), wxStringList("grid.cpp", 0)); GenerateSample("NewGridVC", "griddemo", dir + wxString("/samples/newgrid"), wxStringList("griddemo.cpp", 0)); GenerateSample("HelpVC", "demo", dir + wxString("/samples/help"), wxStringList("demo.cpp", 0)); -- 2.45.2