From 53630547cf632f7093d9c031ae9fff054b05ec6f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 6 Nov 2002 15:20:47 +0000 Subject: [PATCH] fixed GTK2-only bug in SetLogicalFunction() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dcclient.cpp | 12 +++++------- src/gtk1/dcclient.cpp | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 3d2ad4d292..d36b26b870 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1852,7 +1852,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) gdk_gc_set_dashes( m_penGC, 0, (wxGTKDash*)req_dash, req_nb_dash ); } } -#endif +#endif // GTK+ > 1.0 GdkCapStyle capStyle = GDK_CAP_ROUND; switch (m_pen.GetCap()) @@ -1991,12 +1991,12 @@ void wxWindowDC::SetLogicalFunction( int function ) if (!m_window) return; - GdkFunction mode = GDK_COPY; + GdkFunction mode; switch (function) { case wxXOR: mode = GDK_XOR; break; case wxINVERT: mode = GDK_INVERT; break; -#if (GTK_MINOR_VERSION > 0) +#if (GTK_MINOR_VERSION > 0) || (GTK_MAJOR_VERSION > 1) case wxOR_REVERSE: mode = GDK_OR_REVERSE; break; case wxAND_REVERSE: mode = GDK_AND_REVERSE; break; case wxCLEAR: mode = GDK_CLEAR; break; @@ -2013,12 +2013,10 @@ void wxWindowDC::SetLogicalFunction( int function ) // unsupported by GTK case wxNOR: mode = GDK_COPY; break; -#endif +#endif // GTK+ > 1.0 default: - { wxFAIL_MSG( wxT("unsupported logical function") ); - break; - } + mode = GDK_COPY; } m_logicalFunction = function; diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 3d2ad4d292..d36b26b870 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1852,7 +1852,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) gdk_gc_set_dashes( m_penGC, 0, (wxGTKDash*)req_dash, req_nb_dash ); } } -#endif +#endif // GTK+ > 1.0 GdkCapStyle capStyle = GDK_CAP_ROUND; switch (m_pen.GetCap()) @@ -1991,12 +1991,12 @@ void wxWindowDC::SetLogicalFunction( int function ) if (!m_window) return; - GdkFunction mode = GDK_COPY; + GdkFunction mode; switch (function) { case wxXOR: mode = GDK_XOR; break; case wxINVERT: mode = GDK_INVERT; break; -#if (GTK_MINOR_VERSION > 0) +#if (GTK_MINOR_VERSION > 0) || (GTK_MAJOR_VERSION > 1) case wxOR_REVERSE: mode = GDK_OR_REVERSE; break; case wxAND_REVERSE: mode = GDK_AND_REVERSE; break; case wxCLEAR: mode = GDK_CLEAR; break; @@ -2013,12 +2013,10 @@ void wxWindowDC::SetLogicalFunction( int function ) // unsupported by GTK case wxNOR: mode = GDK_COPY; break; -#endif +#endif // GTK+ > 1.0 default: - { wxFAIL_MSG( wxT("unsupported logical function") ); - break; - } + mode = GDK_COPY; } m_logicalFunction = function;