From d1fabc121183800c237c8a1949494ea634c6796f Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 13 Feb 2005 16:48:00 +0000 Subject: [PATCH] source compatible way to solve the background problem git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 19d98ad..444bb43 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -2253,6 +2253,13 @@ void wxWindowMac::OnEraseBackground(wxEraseEvent& event) { event.Skip() ; } + else if ( m_macBackgroundBrush.MacGetBrushKind() == kwxMacBrushTheme ) + { + if ( wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL ) + { + CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ; + } + } else #endif { @@ -3232,9 +3239,14 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) void wxWindowMac::OnPaint( wxPaintEvent & event ) { - if ( wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL ) + // in the other case we already have drawn from the OnEraseBackground Handler + if ( !m_macBackgroundBrush.Ok() || m_macBackgroundBrush.GetStyle() == wxTRANSPARENT || + m_macBackgroundBrush.MacGetBrushKind() != kwxMacBrushTheme ) { - CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ; + if ( wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL ) + { + CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ; + } } } -- 2.7.4