]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes for 16-bit compilation
authorJulian Smart <julian@anthemion.co.uk>
Mon, 14 May 2001 16:13:12 +0000 (16:13 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 14 May 2001 16:13:12 +0000 (16:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

19 files changed:
distrib/msw/tmake/filelist.txt
include/wx/filename.h
include/wx/list.h
include/wx/matrix.h
src/common/datetime.cpp
src/common/xpmdecod.cpp
src/generic/dirctrlg.cpp
src/msw/choice.cpp
src/msw/combobox.cpp
src/msw/control.cpp
src/msw/cursor.cpp
src/msw/makefile.dos
src/msw/mdi.cpp
src/msw/radiobox.cpp
src/msw/radiobut.cpp
src/msw/textctrl.cpp
src/msw/tglbtn.cpp
src/msw/utils.cpp
utils/projgen/makeproj.cpp

index cfae1c50947a5bf4432451907efa92f3fd964b67..054fa153c4488ee8fa69fa5cb7e16d32902af23c 100644 (file)
@@ -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
index 367ad81cbfd7ae197683ff12d64c40c29c700e4a..06696bfdf207932e87250c73f16abc329a8a32b4 100644 (file)
@@ -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 );
index f5bf5336cc3d198d6f94fc9aa86cc79f74a06885..283c4586be01b985fb50862a8f0a61f06c56bb15 100644 (file)
@@ -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
index 018362a1719afebc404ea8013bce53bf0ada6447..e329c01f24d591ef8b51af0a9744fb4ceca0486e 100644 (file)
@@ -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 |
index a38960ec0549885a302e92437965d9842755d93a..2874bc6519f40a09146aff3cc5d1eb2f571ee97c 100644 (file)
@@ -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;
 
index f05334ba3f3045dca9704fa2a193ffa7a02cf6f0..3b33170ab78a8f26b60f15a77afbe00092d54a35 100644 (file)
@@ -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
index b5559d65b441c1f997877128a0f90840ab7eecae..6f27f881aab8402a9d2392ae5758a632de3c96d8 100644 (file)
@@ -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))
index d7d982797c0dc88c6ec1a6eeb2d19ed3f5da3d55..50612f6153bbb660dd306823e908e41974badfe4 100644 (file)
@@ -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 )
index 0d80dbcf05ffea495e4adfda56241866401437af..557eab89754dc01c12f4946212c8af9d67c59910 100644 (file)
@@ -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 )
index fd82221246087afa56984d9b2a196b6826d40218..689ed8f972b167afd21ecf735550a9a61b9650a7 100644 (file)
@@ -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 )
index 892ca4ee0f7cb3245a1d71a3d369a0dbca19bd29..0409580d2d140f03a505c67e74430916e8328efb 100644 (file)
@@ -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;
index 7ed4a50300784b7d67a6a5297d2e42ef45aa00e5..f2247e551d817b7fbaf92055fddb5d651548c330 100644 (file)
@@ -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)
index 4eaf3c777902851631519414d7c2b823f1d5677f..2bd4fa48d5db7d075415422562518307c54bfbf0 100644 (file)
@@ -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));
 }
 
index ca437cd5d90f2e67baa4a87f8fad982c0ed59f28..a89956a5ca832a95f2f85f32063d708596fbc78c 100644 (file)
@@ -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 )
index c75402ceafcbcbc06e240b421efc5c2ca1888370..d41d744284dc7ac87a63d29da9ef908361ba89bb 100644 (file)
@@ -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 )
index 49e3c4ed43fc355b5f61fa6d801cb7a5e6e337fa..83c92f0d9b4a30018a891a2f59643958f4673371 100644 (file)
@@ -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 )
index 353ac6526b48d417692791dc1108e992ce8359b4..f428a631fec81636c04bd1f820bdd08958cb2d08 100644 (file)
@@ -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)
index e32d27860f15b1adbd680f66d8649695cdc91923..8e907f1bd26f027d5c67d4abd90755c9102c480e 100644 (file)
@@ -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
 }
 
 
index e3e499926416fc2236be90b0bb09112cba9851e1..e52a40d5246c8b1825c9a050fad6daa5822aae4d 100644 (file)
@@ -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));