]> git.saurik.com Git - wxWidgets.git/commitdiff
update to make digitalmars compile
authorChris Elliott <biol75@york.ac.uk>
Sat, 19 Apr 2003 18:15:17 +0000 (18:15 +0000)
committerChris Elliott <biol75@york.ac.uk>
Sat, 19 Apr 2003 18:15:17 +0000 (18:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

15 files changed:
distrib/msw/tmake/sc.t
include/wx/defs.h
include/wx/filename.h
include/wx/msw/bitmap.h
include/wx/msw/icon.h
include/wx/msw/missing.h
include/wx/platform.h
samples/minimal/makefile.sc
src/msw/checklst.cpp
src/msw/enhmeta.cpp
src/msw/gdiimage.cpp
src/msw/makefile.sc
src/msw/toplevel.cpp
src/msw/utils.cpp
src/msw/window.cpp

index 9ac3bf7c9d168d1a8c77ef281910f056e1fb45ab..b3a6730f1a79067acc8405c54a023f2370e9feff 100644 (file)
@@ -37,7 +37,7 @@
         #! these files don't compile with SC++ 6
         next if $file =~ /^(joystick|pnghand)\./;
 
-        next if $wxGeneric{$file} =~ /\b16\b/;
+        next if $wxMSW{$file} =~ /\b16\b/;
 
         my $isOleObj = $wxMSW{$file} =~ /\bO\b/;
         $file =~ s/cp?p?$/obj/;
@@ -61,7 +61,7 @@ include ..\makesc.env
 
 DEBUG=0
 
-LIBTARGET = $(LIBDIR)\wx.lib
+LIBTARGET = $(LIBDIR)\wx$(SC_SUFFIX).lib
 
 OPTIONS=
 
@@ -83,26 +83,35 @@ MSWOBJS = #$ ExpandList("WXMSWOBJS");
 # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
 
-all: $(LIBTARGET)
+all: MAKEARCHDIR $(LIBTARGET)
+
+MAKEARCHDIR:
+    @if not exist $(MSWINCDIR)\setup.h copy $(MSWINCDIR)\setup0.h $(MSWINCDIR)\setup.h
+    @if not exist $(ARCHINCDIR)\wx\setup.h mkdir $(ARCHINCDIR)
+    @if not exist $(ARCHINCDIR)\wx\setup.h mkdir $(ARCHINCDIR)\wx
+    @if not exist $(ARCHINCDIR)\wx\setup.h copy $(MSWINCDIR)\setup.h $(ARCHINCDIR)\wx\setup.h
 
 $(LIBTARGET): $(OBJECTS)
        -del $(LIBTARGET)
        *lib /PAGESIZE:512 $(LIBTARGET) y $(OBJECTS), nul;
 
 clean:
+       -del $(COMMDIR)\*.obj
+       -del $(MSWDIR)\*.obj
+       -del $(GENDIR)\*.obj
        -del *.obj
     -del $(LIBTARGET)
 
-$(COMMDIR)\y_tab.obj:     $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
-
-$(COMMDIR)\y_tab.c:     $(COMMDIR)\dosyacc.c
-        copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
-
-$(COMMDIR)\lex_yy.c:    $(COMMDIR)\doslex.c
-    copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
-
-# $(COMMDIR)\cmndata.obj:     $(COMMDIR)\cmndata.cpp
-#      *$(CC) -c $(CFLAGS) -I$(INCLUDE) $(OPTIONS) $(COMMDIR)\cmndata.cpp -o$(COMMDIR)\cmndata.obj
+## $(COMMDIR)\y_tab.obj:     $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
+##
+## $(COMMDIR)\y_tab.c:     $(COMMDIR)\dosyacc.c
+##        copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
+##
+## $(COMMDIR)\lex_yy.c:    $(COMMDIR)\doslex.c
+##    copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
+##
+### $(COMMDIR)\cmndata.obj:     $(COMMDIR)\cmndata.cpp
+###    *$(CC) -c $(CFLAGS) -I$(INCLUDE) $(OPTIONS) $(COMMDIR)\cmndata.cpp -o$(COMMDIR)\cmndata.obj
 
 MFTYPE=sc
 makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t
index c6c3699a6b31c94c4b04eb67dea0b7a40322126b..25cb52771aeb19849c233caa983dbfbf76c6c620 100644 (file)
     #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
         // Watcom 11+ supports bool
         #define HAVE_BOOL
+    #elif defined(__DIGITALMARS__) 
+        // DigitalMars supports bool
+        #define HAVE_BOOL
     #elif defined(__GNUWIN32__) || defined(__MINGW32__) || defined(__CYGWIN__)
         // Cygwin supports bool
         #define HAVE_BOOL
index 647e231e947567145ffdbc1b263ab1f6ce3bd9ac..e8a87042b8e95c3f5b588ea7846fdd2f4bab207b 100644 (file)
@@ -394,9 +394,10 @@ public:
     // deprecated methods, don't use any more
     // --------------------------------------
 
+#ifndef __DIGITALMARS__
     wxString GetPath( bool withSep, wxPathFormat format = wxPATH_NATIVE ) const
         { return GetPath(withSep ? wxPATH_GET_SEPARATOR : 0, format); }
-
+#endif
     wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const
         { return GetPath(wxPATH_GET_SEPARATOR, format); }
 
index 75efef8d651780e0395a8e9a1ac879973f3cdbdc..d0871203119459dffe8220f87674cd966d04b1cb 100644 (file)
@@ -50,7 +50,9 @@ public:
     wxBitmap(const char bits[], int width, int height, int depth = 1);
 
     // Initialize with XPM data
+#ifndef __DIGITALMARS__
     wxBitmap(const char **data) { CreateFromXpm(data); }
+#endif
     wxBitmap(char **data) { CreateFromXpm((const char **)data); }
 
     // Load a file or resource
index 741874298ca04f746b5409c054455f68229d33ef..4583310223a01bbb8cb700de8b9c7f69347da2a3 100644 (file)
@@ -54,7 +54,9 @@ public:
         // from raw data
     wxIcon(const char bits[], int width, int height);
         // from XPM data
+#ifndef __DIGITALMARS__
     wxIcon(const char **data) { CreateIconFromXpm(data); }
+#endif
     wxIcon(char **data) { CreateIconFromXpm((const char **)data); }
         // from resource/file
     wxIcon(const wxString& name,
index 62c8c2a762686ea9854221753e252c5cf7adda2e..3ce2627674a309221ead2fe41ea695deaf992548 100644 (file)
@@ -159,7 +159,7 @@ typedef struct tagNMLVDISPINFOW {
 #endif
 #endif
 
-#if ((defined(__WATCOMC__) && __WATCOMC__ >= 1200) || defined(__GNUWIN32__) || defined (__BORLANDC__)) && !defined(HDN_GETDISPINFOW)
+#if ((defined(__WATCOMC__) && __WATCOMC__ >= 1200) || defined(__GNUWIN32__) || defined(__DIGITALMARS__) || defined (__BORLANDC__)) && !defined(HDN_GETDISPINFOW)
 #define HDN_GETDISPINFOW (HDN_FIRST-29)
 #if !wxCHECK_W32API_VERSION(2, 2)
 typedef struct {
index 4d04491a583e61d7db46932af288a9b58a2d176b..c52ad430c198971f55347c928cbbf5f3e047c3dd 100644 (file)
     #define wxCHECK_W32API_VERSION(maj, min) (0)
 #endif
 
+#ifdef __SC__
+    #ifdef __DMC__
+         #define __DIGITALMARS__
+    #endif
+#endif
+
 #endif /* _WX_PLATFORM_H_ */
 
index c55f65c7d7619bfe4af9e47becf771d54327ab4c..5f574ba91ebf9ab91289eb4e1fb3b1c67dd32e6e 100644 (file)
@@ -8,9 +8,9 @@ TARGET=minimal
 
 include $(WXDIR)\src\makesc.env
 
-minimal.exe: minimal.obj $(DEFFILE) minimal.res
-       *$(CC) $(LDFLAGS) -o$@ $** $(LIBS)
-    *$(RC) -k minimal.res
+minimal.exe: minimal.obj 
+       link $(LDFLAGS) $*, $@, $*, $(LIBS)
+    
 
 sc32.def:
      echo EXETYPE NT > sc32.def
index 2a7e01108ecfb17e593f35a32ef3cfbca1b7ca6f..c6b37213541e4a5f9f9b1788347ace58ec30983b 100644 (file)
@@ -154,7 +154,7 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
       HBITMAP hbmpOld = (HBITMAP)SelectObject(hdcMem, hbmpCheck);
 
       // then draw a check mark into it
-#if defined(__WIN32__) && !defined(__SC__)
+
       RECT rect;
       rect.left   = 0;
       rect.top    = 0;
@@ -162,22 +162,6 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
       rect.bottom = nCheckHeight;
 
       DrawFrameControl(hdcMem, &rect, DFC_MENU, DFCS_MENUCHECK);
-#else
-      // In WIN16, draw a cross
-      HPEN blackPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
-      HPEN whiteBrush = (HPEN)GetStockObject(WHITE_BRUSH);
-      HPEN hPenOld = (HPEN)::SelectObject(hdcMem, blackPen);
-      HPEN hBrushOld = (HPEN)::SelectObject(hdcMem, whiteBrush);
-      ::SetROP2(hdcMem, R2_COPYPEN);
-      Rectangle(hdcMem, 0, 0, nCheckWidth, nCheckHeight);
-      MoveTo(hdcMem, 0, 0);
-      LineTo(hdcMem, nCheckWidth, nCheckHeight);
-      MoveTo(hdcMem, nCheckWidth, 0);
-      LineTo(hdcMem, 0, nCheckHeight);
-      ::SelectObject(hdcMem, hPenOld);
-      ::SelectObject(hdcMem, hBrushOld);
-      ::DeleteObject(blackPen);
-#endif
 
       // finally copy it to screen DC and clean up
       BitBlt(hdc, x, y, nCheckWidth - 1, nCheckHeight,
index 04dd7bc916d7673b310351e94b269fadcf4d7fb1..e470b3254b1f6a686212d1604cfe2f6447321283 100644 (file)
@@ -431,6 +431,7 @@ bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len),
     return TRUE;
 }
 
+
 #endif // wxUSE_DRAG_AND_DROP
 
 #endif // wxUSE_ENH_METAFILE
index 1e7606bcbece9ba0b1cac7626429025c383743f4..7d04d9be55c817ce801395ab9b4325a596298d5c 100644 (file)
@@ -373,6 +373,14 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
                                 long WXUNUSED(flags),
                                 int desiredWidth, int desiredHeight)
 {
+#ifdef __DIGITALMARS__
+//FIXME __DIGITALMARS__ April 2003 CE
+    // why no ExtractIcon in library
+            wxLogTrace(_T("iconload"),
+                   _T("Returning false from wxICOFileHandler::Load because of DigitalMars compiler bug"));
+
+    return false;
+#else
     icon->UnRef();
 
     // actual size
@@ -475,6 +483,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
     icon->SetSize(size.x, size.y);
 
     return icon->Ok();
+#endif // Digitalmars
 }
 
 bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
index 72035afc13f3a1839470e3fe1610e0a6afeb729a..37a26a971e3fcb8ee50516c92471263df9e511c3 100644 (file)
@@ -14,7 +14,7 @@ include ..\makesc.env
 
 DEBUG=0
 
-LIBTARGET = $(LIBDIR)\wx.lib
+LIBTARGET = $(LIBDIR)\wx$(SC_SUFFIX).lib
 
 OPTIONS=
 
@@ -242,8 +242,10 @@ MSWOBJS = $(MSWDIR)\accel.obj \
                $(MSWDIR)\helpchm.obj \
                $(MSWDIR)\helpwin.obj \
                $(MSWDIR)\icon.obj \
+               $(MSWDIR)\imaglist.obj \
                $(MSWDIR)\iniconf.obj \
                $(MSWDIR)\listbox.obj \
+               $(MSWDIR)\listctrl.obj \
                $(MSWDIR)\main.obj \
                $(MSWDIR)\mdi.obj \
                $(MSWDIR)\menu.obj \
@@ -254,6 +256,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \
                $(MSWDIR)\msgdlg.obj \
                $(MSWDIR)\mslu.obj \
                $(MSWDIR)\nativdlg.obj \
+               $(MSWDIR)\notebook.obj \
                $(MSWDIR)\ole\oleutils.obj \
                $(MSWDIR)\ownerdrw.obj \
                $(MSWDIR)\palette.obj \
@@ -270,7 +273,6 @@ MSWOBJS = $(MSWDIR)\accel.obj \
                $(MSWDIR)\scrolbar.obj \
                $(MSWDIR)\settings.obj \
                $(MSWDIR)\slider95.obj \
-               $(MSWDIR)\slidrmsw.obj \
                $(MSWDIR)\snglinst.obj \
                $(MSWDIR)\spinbutt.obj \
                $(MSWDIR)\spinctrl.obj \
@@ -282,7 +284,6 @@ MSWOBJS = $(MSWDIR)\accel.obj \
                $(MSWDIR)\tabctrl.obj \
                $(MSWDIR)\taskbar.obj \
                $(MSWDIR)\tbar95.obj \
-               $(MSWDIR)\tbarmsw.obj \
                $(MSWDIR)\textctrl.obj \
                $(MSWDIR)\tglbtn.obj \
                $(MSWDIR)\thread.obj \
@@ -300,26 +301,35 @@ MSWOBJS = $(MSWDIR)\accel.obj \
 # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
 
-all: $(LIBTARGET)
+all: MAKEARCHDIR $(LIBTARGET)
+
+MAKEARCHDIR:
+    @if not exist $(MSWINCDIR)\setup.h copy $(MSWINCDIR)\setup0.h $(MSWINCDIR)\setup.h
+    @if not exist $(ARCHINCDIR)\wx\setup.h mkdir $(ARCHINCDIR)
+    @if not exist $(ARCHINCDIR)\wx\setup.h mkdir $(ARCHINCDIR)\wx
+    @if not exist $(ARCHINCDIR)\wx\setup.h copy $(MSWINCDIR)\setup.h $(ARCHINCDIR)\wx\setup.h
 
 $(LIBTARGET): $(OBJECTS)
        -del $(LIBTARGET)
        *lib /PAGESIZE:512 $(LIBTARGET) y $(OBJECTS), nul;
 
 clean:
+       -del $(COMMDIR)\*.obj
+       -del $(MSWDIR)\*.obj
+       -del $(GENDIR)\*.obj
        -del *.obj
     -del $(LIBTARGET)
 
-$(COMMDIR)\y_tab.obj:     $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
-
-$(COMMDIR)\y_tab.c:     $(COMMDIR)\dosyacc.c
-        copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
-
-$(COMMDIR)\lex_yy.c:    $(COMMDIR)\doslex.c
-    copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
-
-# $(COMMDIR)\cmndata.obj:     $(COMMDIR)\cmndata.cpp
-#      *$(CC) -c $(CFLAGS) -I$(INCLUDE) $(OPTIONS) $(COMMDIR)\cmndata.cpp -o$(COMMDIR)\cmndata.obj
+## $(COMMDIR)\y_tab.obj:     $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
+##
+## $(COMMDIR)\y_tab.c:     $(COMMDIR)\dosyacc.c
+##        copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
+##
+## $(COMMDIR)\lex_yy.c:    $(COMMDIR)\doslex.c
+##    copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
+##
+### $(COMMDIR)\cmndata.obj:     $(COMMDIR)\cmndata.cpp
+###    *$(CC) -c $(CFLAGS) -I$(INCLUDE) $(OPTIONS) $(COMMDIR)\cmndata.cpp -o$(COMMDIR)\cmndata.obj
 
 MFTYPE=sc
 makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t
index 7d0164a3c0ccd1b5b0ab795ad01c1a6949c667d7..21fc67e8402fba97c333760bd6fff014e233593d 100644 (file)
@@ -191,7 +191,7 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const
 
     if ( exflags )
     {
-#if !defined(__WIN16__) && !defined(__SC__)
+#if !defined(__WIN16__) 
         if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) )
         {
             if ( style & wxFRAME_TOOL_WINDOW )
index 6d1b87409edb7e1f6f0288d7fd0d458d467039dd..c941c45a574b2416ebc06cde4e5250a54f73cae7 100644 (file)
@@ -180,6 +180,9 @@ bool wxGetFullHostName(wxChar *buf, int maxSize)
     // shouldn't use winsock.dll (a.k.a. ws2_32.dll) at all so only use this
     // code if we link with it anyhow
 #if wxUSE_SOCKETS
+    //FIXME __DIGITALMARS__ why is using sockets not properly turned off in setup.h ??
+    // find which library should contain sockets for Digital Mars CE April 2003
+#ifndef __DIGITALMARS__
     WSADATA wsa;
     if ( WSAStartup(MAKEWORD(1, 1), &wsa) == 0 )
     {
@@ -215,6 +218,8 @@ bool wxGetFullHostName(wxChar *buf, int maxSize)
             return TRUE;
         }
     }
+#endif //__DIGITALMARS__
+
 #endif // wxUSE_SOCKETS
 
 #endif // Win32
@@ -1009,7 +1014,7 @@ wxString wxGetOsDescription()
 
 int wxGetOsVersion(int *majorVsn, int *minorVsn)
 {
-#if defined(__WIN32__) && !defined(__SC__)
+#if defined(__WIN32__) 
     static int ver = -1, major = -1, minor = -1;
 
     if ( ver == -1 )
index 7dec91edbc98503c0f0fa148d6c4fb4720e035ef..1d21f036b7bc145e58bfc134cf6fd90052708135 100644 (file)
@@ -1479,10 +1479,12 @@ void wxWindowMSW::Update()
 // drag and drop
 // ---------------------------------------------------------------------------
 
-#if wxUSE_DRAG_AND_DROP
+//FIXME __DIGITALMARS__ does not honor drag drop in setup.h
 
+#if wxUSE_DRAG_AND_DROP
 void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
 {
+#ifndef __DIGITALMARS__
     if ( m_dropTarget != 0 ) {
         m_dropTarget->Revoke(m_hWnd);
         delete m_dropTarget;
@@ -1491,17 +1493,19 @@ void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
     m_dropTarget = pDropTarget;
     if ( m_dropTarget != 0 )
         m_dropTarget->Register(m_hWnd);
+#endif //  __DIGITALMARS__
 }
-
 #endif // wxUSE_DRAG_AND_DROP
 
 // old style file-manager drag&drop support: we retain the old-style
 // DragAcceptFiles in parallel with SetDropTarget.
 void wxWindowMSW::DragAcceptFiles(bool accept)
 {
+#ifndef __DIGITALMARS__
     HWND hWnd = GetHwnd();
     if ( hWnd )
         ::DragAcceptFiles(hWnd, (BOOL)accept);
+#endif
 }
 
 // ----------------------------------------------------------------------------
@@ -1932,7 +1936,11 @@ bool wxWindowMSW::DoPopupMenu(wxMenu *menu, int x, int y)
 long wxWindowMSW::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
 {
     if ( m_oldWndProc )
+#ifdef __DIGITALMARS__
+        return ::CallWindowProc( (FARPROC) m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
+#else
         return ::CallWindowProc(CASTWNDPROC m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
+#endif
     else
         return ::DefWindowProc(GetHwnd(), nMsg, wParam, lParam);
 }
@@ -3422,7 +3430,10 @@ bool wxWindowMSW::HandleInitDialog(WXHWND WXUNUSED(hWndFocus))
 
 bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam)
 {
-#ifndef __WXMICROWIN__
+//FIX ME  __DIGITALMARS__   
+#if defined (__WXMICROWIN__) || defined (__DIGITALMARS__)
+    return FALSE;
+#else // __WXMICROWIN__
     HDROP hFilesInfo = (HDROP) wParam;
 
     // Get the total number of files dropped
@@ -3457,8 +3468,6 @@ bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam)
     event.m_pos.y = dropPoint.y;
 
     return GetEventHandler()->ProcessEvent(event);
-#else // __WXMICROWIN__
-    return FALSE;
 #endif
 }