From 1a77875bed4779fad450b289ab7e476d049ccd14 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 30 Jun 2001 13:43:34 +0000 Subject: [PATCH] More fixes for wxUniv git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/univ/window.h | 2 +- samples/minimal/MinimalVC.dsp | 71 ++++++++++++++++++++++++++++++++++- samples/minimal/minimal.cpp | 7 ++++ src/common/event.cpp | 25 +++++++++++- src/common/wincmn.cpp | 1 + src/univ/textctrl.cpp | 2 + 6 files changed, 104 insertions(+), 4 deletions(-) diff --git a/include/wx/univ/window.h b/include/wx/univ/window.h index ba2828e06f..924e11cb30 100644 --- a/include/wx/univ/window.h +++ b/include/wx/univ/window.h @@ -66,7 +66,7 @@ enum class WXDLLEXPORT wxWindow : public wxWindowNative { public: - // ctors and creatie functions + // ctors and create functions // --------------------------- wxWindow() { Init(); } diff --git a/samples/minimal/MinimalVC.dsp b/samples/minimal/MinimalVC.dsp index ee3793339e..5c3106d9fb 100644 --- a/samples/minimal/MinimalVC.dsp +++ b/samples/minimal/MinimalVC.dsp @@ -4,7 +4,7 @@ # TARGTYPE "Win32 (x86) Application" 0x0101 -CFG=MinimalVC - Win32 Debug +CFG=MinimalVC - Win32 UnivDebug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -13,7 +13,7 @@ CFG=MinimalVC - Win32 Debug !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "MinimalVC.mak" CFG="MinimalVC - Win32 Debug" +!MESSAGE NMAKE /f "MinimalVC.mak" CFG="MinimalVC - Win32 UnivDebug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE @@ -21,6 +21,8 @@ CFG=MinimalVC - Win32 Debug !MESSAGE "MinimalVC - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE "MinimalVC - Win32 Debug DLL" (based on "Win32 (x86) Application") !MESSAGE "MinimalVC - Win32 Release DLL" (based on "Win32 (x86) Application") +!MESSAGE "MinimalVC - Win32 UnivRelease" (based on "Win32 (x86) Application") +!MESSAGE "MinimalVC - Win32 UnivDebug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project @@ -137,6 +139,62 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx23_2.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /out:"ReleaseDLL/minimal.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" +!ELSEIF "$(CFG)" == "MinimalVC - Win32 UnivRelease" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "MinimalVC___Win32_UnivRelease" +# PROP BASE Intermediate_Dir "MinimalVC___Win32_UnivRelease" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "UnivRelease" +# PROP Intermediate_Dir "UnivRelease" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../include" /I "../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"Release/minimal.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx_univ.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"UnivRelease/minimal.exe" /libpath:"../../lib" /libpath:"../../contrib/lib" + +!ELSEIF "$(CFG)" == "MinimalVC - Win32 UnivDebug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "MinimalVC___Win32_UnivDebug" +# PROP BASE Intermediate_Dir "MinimalVC___Win32_UnivDebug" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "UnivDebug" +# PROP Intermediate_Dir "UnivDebug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"Debug/minimal.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx_univd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"UnivDebug/minimal.exe" /pdbtype:sept /libpath:"../../lib" /libpath:"../../contrib/lib" + !ENDIF # Begin Target @@ -145,6 +203,8 @@ LINK32=link.exe # Name "MinimalVC - Win32 Debug" # Name "MinimalVC - Win32 Debug DLL" # Name "MinimalVC - Win32 Release DLL" +# Name "MinimalVC - Win32 UnivRelease" +# Name "MinimalVC - Win32 UnivDebug" # Begin Source File SOURCE=.\minimal.cpp @@ -162,6 +222,13 @@ SOURCE=.\minimal.cpp !ELSEIF "$(CFG)" == "MinimalVC - Win32 Release DLL" +!ELSEIF "$(CFG)" == "MinimalVC - Win32 UnivRelease" + +!ELSEIF "$(CFG)" == "MinimalVC - Win32 UnivDebug" + +# SUBTRACT BASE CPP /YX /Yc /Yu +# SUBTRACT CPP /YX /Yc /Yu + !ENDIF # End Source File diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index 55d27665ec..4434353621 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -107,6 +107,13 @@ END_EVENT_TABLE() // not wxApp) IMPLEMENT_APP(MyApp) +#ifdef __WXUNIVERSAL__ + #include "wx/univ/theme.h" + + WX_USE_THEME(win32); + WX_USE_THEME(gtk); +#endif // __WXUNIVERSAL__ + // ============================================================================ // implementation // ============================================================================ diff --git a/src/common/event.cpp b/src/common/event.cpp index 897280b804..49ce7c19fa 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -890,9 +890,32 @@ void wxEvtHandler::ProcessPendingEvents() bool wxEvtHandler::ProcessEvent(wxEvent& event) { #if wxUSE_GUI + + // We have to use the actual window or processing events from wxWindowNative + // destructor won't work (we don't see the wxWindow class) +#ifdef __WXDEBUG__ // check that our flag corresponds to reality - wxASSERT_MSG( m_isWindow == IsKindOf(CLASSINFO(wxWindow)), + wxClassInfo* info = NULL; +#ifdef __WXUNIVERSAL__ +# if defined(__WXMSW__) + info = CLASSINFO(wxWindowMSW); +# elif defined(__WXGTK__) + info = CLASSINFO(wxWindowGTK); +# elif defined(__WXMGL__) + info = CLASSINFO(wxWindowMGL); +# elif defined(__WXMAC__) + info = CLASSINFO(wxWindowMac); +# elif defined(__WXMOTIF__) + info = CLASSINFO(wxWindowMotif); +# endif +#else + info = CLASSINFO(wxWindow); +#endif + + wxASSERT_MSG( m_isWindow == IsKindOf(info), _T("this should [not] be a window but it is [not]") ); +#endif + #endif // wxUSE_GUI // An event handler can be enabled or disabled diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 0e16d408ce..864bb24f1a 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -305,6 +305,7 @@ bool wxWindowBase::DestroyChildren() wxASSERT_MSG( child, wxT("children list contains empty nodes") ); + child->Show(FALSE); delete child; wxASSERT_MSG( !GetChildren().Find(child), diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 9d5bdc38c3..09bf799a15 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -1736,6 +1736,8 @@ wxTextCoord wxTextCtrl::GetRowsPerLine(wxTextCoord line) const wxTextCoord wxTextCtrl::GetRowCount() const { wxTextCoord count = GetLineCount(); + if (count == 0) + return 0; if ( WrapLines() ) { count = GetFirstRowOfLine(count - 1) + -- 2.45.2