]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
warning and compilos
[wxWidgets.git] / src / mac / carbon / window.cpp
index 19d98ade9b728a4863f983378f729f3845904e2c..444bb432ddc4d98a743235c4788f5071479978f2 100644 (file)
@@ -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() ) ;
+        }
     }
 }