From c25a510b30bd87f26deaf3532a48d29a158f0aea Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 20 Dec 1999 19:04:48 +0000 Subject: [PATCH] Mostly Mingw32/Cygwin corrections git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/longlong.h | 3 +++ samples/html/about/about.cpp | 1 + samples/taskbar/tbtest.cpp | 4 ++-- src/common/datetime.cpp | 7 ++++++- src/common/string.cpp | 2 +- src/makeg95.env | 2 +- src/makeprog.vc | 2 +- src/msw/dialup.cpp | 6 +++++- src/msw/fontenum.cpp | 4 +++- src/msw/gdiimage.cpp | 1 + src/msw/radiobox.cpp | 13 ++++++++++++- src/msw/taskbar.cpp | 3 +++ src/msw/tbar95.cpp | 8 +++++++- src/msw/tbarmsw.cpp | 6 +++--- src/msw/textctrl.cpp | 4 +++- src/msw/thread.cpp | 4 ++++ src/msw/tooltip.cpp | 2 +- src/wxvc.dsp | 8 ++++---- src/wxvc_dll.dsp | 8 ++++---- 19 files changed, 65 insertions(+), 23 deletions(-) diff --git a/include/wx/longlong.h b/include/wx/longlong.h index 2731af5ae5..02f7ded9ea 100644 --- a/include/wx/longlong.h +++ b/include/wx/longlong.h @@ -39,6 +39,9 @@ #if defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) #define wxLongLong_t long #define wxLongLongIsLong +#elif defined(__WIN16__) + #define wxLongLong_t long + #define wxLongLongIsLong #elif defined(__VISUALC__) || defined( __VMS__ ) #define wxLongLong_t __int64 #elif defined(__GNUG__) diff --git a/samples/html/about/about.cpp b/samples/html/about/about.cpp index 664b18f06e..99f32b263e 100644 --- a/samples/html/about/about.cpp +++ b/samples/html/about/about.cpp @@ -22,6 +22,7 @@ #endif #include +#include #include // ---------------------------------------------------------------------------- diff --git a/samples/taskbar/tbtest.cpp b/samples/taskbar/tbtest.cpp index 114267dcae..74a7200000 100644 --- a/samples/taskbar/tbtest.cpp +++ b/samples/taskbar/tbtest.cpp @@ -17,10 +17,10 @@ #endif #ifndef WX_PRECOMP -#include "wx.h" +#include #endif -#include "wx/msw/taskbar.h" +#include #include "tbtest.h" // Declare two frames diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 93c8dc6b84..00ccb08398 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -79,6 +79,11 @@ #define WX_TIMEZONE timezone #endif +// Is this right? Just a guess. (JACS) +#ifdef __MINGW32__ +#define timezone _timezone +#endif + // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -114,7 +119,7 @@ static const int DAYS_PER_400_YEARS = 146097; // a critical section is needed to protect GetTimeZone() static // variable in MT case -#ifdef wxUSE_THREADS +#if wxUSE_THREADS wxCriticalSection gs_critsectTimezone; #endif // wxUSE_THREADS diff --git a/src/common/string.cpp b/src/common/string.cpp index ed777353a7..8b83cf17fc 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -107,7 +107,7 @@ extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy; // function wxVsnprintfA (A for ANSI), should also find one for Unicode // strings in Unicode build #ifdef __WXMSW__ - #if defined(__VISUALC__) || defined(wxUSE_NORLANDER_HEADERS) + #if (defined(__VISUALC__) || defined(wxUSE_NORLANDER_HEADERS)) && !defined(__MINGW32__) #define wxVsnprintfA _vsnprintf #endif #else // !Windows diff --git a/src/makeg95.env b/src/makeg95.env index 9c40db3f39..36a2a1d03a 100644 --- a/src/makeg95.env +++ b/src/makeg95.env @@ -7,7 +7,7 @@ # If using Cygwin, set this to 0. # If using Mingw32, set this to 1. -MINGW32=0 +MINGW32=1 # Set to the version you have MINGW32VERSION=2.95 diff --git a/src/makeprog.vc b/src/makeprog.vc index 5c17936e4f..9de992e7b9 100644 --- a/src/makeprog.vc +++ b/src/makeprog.vc @@ -10,7 +10,7 @@ # Use FINAL=1 argument to nmake to build final version with no debugging # info -# Set WXDIR for your system (hint, set an environment variable named WXWIN) +# Set WXDIR for your system WXDIR = $(WXWIN) WXUSINGDLL=0 diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index d0163f9dde..cbf2e82cb9 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -38,12 +38,16 @@ #include "wx/event.h" #endif +#ifndef wxUSE_DYNLIB_CLASS +#error You need wxUSE_DYNLIB_CLASS to be 1 to compile dialup.cpp. +#endif + #include "wx/dynlib.h" #include "wx/dialup.h" // Doesn't yet compile under BC++ nor with mingw: no wininet.h -#if !defined(__BORLANDC__) && !defined(__GNUWIN32_OLD__) +#if !defined(__BORLANDC__) && !defined(__GNUWIN32_OLD__) && !defined(__GNUWIN32__) #include #include diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index 5674825c1b..9d7e1820d0 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -110,7 +110,9 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) return TRUE; } -#ifdef __GNUWIN32_OLD__ +// I've no idea what __GNUWIN32_OLD__ is. Anyway, I had to add the 2nd condition +// for Cygwin b20 (JACS) +#if (defined(__GNUWIN32_OLD__) || defined(__GNUWIN32__)) && !defined(__MINGW32__) #define wxFONTENUMPROC int(*)(ENUMLOGFONTEX *, NEWTEXTMETRICEX*, int, LPARAM) #else #define wxFONTENUMPROC FONTENUMPROC diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index d34a94c64c..6d9158e4aa 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -37,6 +37,7 @@ #include "wx/app.h" #include "wx/msw/dib.h" +#include "wx/msw/bitmap.h" #include "wx/msw/gdiimage.h" #ifdef __WIN16__ diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 2767986d6a..fe2d803e2c 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -38,7 +38,10 @@ #include "wx/msw/private.h" #if wxUSE_TOOLTIPS + +#ifndef __GNUWIN32__ #include +#endif #include "wx/tooltip.h" #endif // wxUSE_TOOLTIPS @@ -52,7 +55,15 @@ // and allows tooltips to work with radioboxes, so there should be no // reason to revert to the backward compatible behaviour - but I still // leave this possibility just in case. + +// For some reason, the background colour is set wrongly in WIN16 mode +// if we use the new method. + +#ifdef __WIN16__ +#define RADIOBTN_PARENT_IS_RADIOBOX 0 +#else #define RADIOBTN_PARENT_IS_RADIOBOX 1 +#endif // --------------------------------------------------------------------------- // private functions @@ -746,7 +757,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") ); -#if wxUSE_TOOLTIPS +#if wxUSE_TOOLTIPS && !defined(__GNUWIN32__) if ( msg == WM_NOTIFY ) { NMHDR* hdr = (NMHDR *)lParam; diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 3d8de5f7c6..cc82231d23 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -32,6 +32,9 @@ #if defined(__WIN95__) && !defined(__TWIN32__) #include + +#include "wx/msw/winundef.h" + #include #include "wx/msw/taskbar.h" #include "wx/msw/private.h" diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 77bc8885dc..d60c8baa0f 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -49,7 +49,10 @@ #ifndef __TWIN32__ -#ifdef __GNUWIN32_OLD__ +// I don't know what _OLD_ refers to so I'm reinstating the old +// ifdef (JACS). +// #ifdef __GNUWIN32_OLD__ +#if defined(__GNUWIN32__) && !defined(__MINGW32__) #include "wx/msw/gnuwin32/extra.h" #else #include @@ -199,7 +202,10 @@ bool wxToolBar::Create(wxWindow *parent, DWORD msflags = 0; // WS_VISIBLE | WS_CHILD always included if (style & wxBORDER) msflags |= WS_BORDER; + +#ifdef TBSTYLE_TOOLTIPS msflags |= TBSTYLE_TOOLTIPS; +#endif if (style & wxTB_FLAT) { diff --git a/src/msw/tbarmsw.cpp b/src/msw/tbarmsw.cpp index 50410b00f8..5de16db0f8 100644 --- a/src/msw/tbarmsw.cpp +++ b/src/msw/tbarmsw.cpp @@ -32,7 +32,7 @@ #include "wx/wx.h" #endif -#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR && !wxUSE_TOOLBAR_SIMPLE +#if wxUSE_TOOLBAR && defined(__WIN16__) #if !defined(__WIN32__) && !wxUSE_IMAGE_LOADING_IN_MSW #error wxToolBar needs wxUSE_IMAGE_LOADING_IN_MSW under Win16 @@ -48,7 +48,7 @@ #include -#include "wx/tbarmsw.h" +#include "wx/msw/tbarmsw.h" #include "wx/event.h" #include "wx/app.h" #include "wx/bitmap.h" @@ -491,7 +491,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) // TODO: use the mapping code from wxToolBar95 to get it right in this class #if !defined(__WIN32__) && !defined(__WIN386__) wxBitmap bitmap2; - if (toggle) + if (tool->CanBeToggled()) { HBITMAP hbmp = CreateMappedBitmap((WXHINSTANCE)wxGetInstance(), GetHbitmapOf(tool->GetBitmap1())); diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 6d55b55949..011e3e677e 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -58,7 +58,9 @@ # include #endif -#if wxUSE_RICHEDIT +// Why oh why did someone remove the tail of this line? Bizarre. +// It's needed for GNUWIN32 b20, at least. +#if wxUSE_RICHEDIT && (!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS)) #include #endif diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 8bb3c99382..472d1916e3 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -521,6 +521,10 @@ bool wxThread::IsMain() return ::GetCurrentThreadId() == gs_idMainThread; } +#ifdef Yield +#undef Yield +#endif + void wxThread::Yield() { // 0 argument to Sleep() is special and means to just give away the rest of diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 0bac53472b..0aa577b1aa 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -32,7 +32,7 @@ #include "wx/tooltip.h" #include "wx/msw/private.h" -#if defined(__WIN95__) && !defined(__GNUWIN32_OLD__) +#if defined(__WIN95__) && (!defined(__GNUWIN32__) || defined(__MINGW32__)) #include #endif diff --git a/src/wxvc.dsp b/src/wxvc.dsp index 67dba20a6f..690e86787c 100644 --- a/src/wxvc.dsp +++ b/src/wxvc.dsp @@ -399,10 +399,6 @@ SOURCE=.\common\tbarbase.cpp # End Source File # Begin Source File -SOURCE=.\common\tbarsmpl.cpp -# End Source File -# Begin Source File - SOURCE=.\common\textcmn.cpp # End Source File # Begin Source File @@ -571,6 +567,10 @@ SOURCE=.\generic\tabg.cpp # End Source File # Begin Source File +SOURCE=.\generic\tbarsmpl.cpp +# End Source File +# Begin Source File + SOURCE=.\generic\textdlgg.cpp # End Source File # Begin Source File diff --git a/src/wxvc_dll.dsp b/src/wxvc_dll.dsp index 29ea46b043..e9f76be312 100644 --- a/src/wxvc_dll.dsp +++ b/src/wxvc_dll.dsp @@ -402,10 +402,6 @@ SOURCE=.\common\tbarbase.cpp # End Source File # Begin Source File -SOURCE=.\common\tbarsmpl.cpp -# End Source File -# Begin Source File - SOURCE=.\common\textcmn.cpp # End Source File # Begin Source File @@ -565,6 +561,10 @@ SOURCE=.\generic\tabg.cpp # End Source File # Begin Source File +SOURCE=.\generic\tbarsmpl.cpp +# End Source File +# Begin Source File + SOURCE=.\generic\textdlgg.cpp # End Source File # Begin Source File -- 2.45.2