]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/overlay.cpp
Document wxBitmapToggleButton, add update UI event in Base class for all toggle buttons
[wxWidgets.git] / src / mac / carbon / overlay.cpp
index ec49a7fc9efe5dde22b929e3188fae21036eb88d..c33c96e8e7ac4211324107a64fb8af5295978a8b 100644 (file)
@@ -134,15 +134,24 @@ void wxOverlayImpl::Init( wxWindowDC* dc, int x , int y , int width , int height
 
 void wxOverlayImpl::BeginDrawing( wxWindowDC* dc)
 {
 
 void wxOverlayImpl::BeginDrawing( wxWindowDC* dc)
 {
-    dc->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) );
-    wxSize size = dc->GetSize() ;
-    dc->SetClippingRegion( 0 , 0 , size.x , size.y ) ;
+    wxDCImpl *impl = dc->GetImpl();
+    wxWindowDCImpl *win_impl = wxDynamicCast(impl,wxWindowDCImpl);
+    if (win_impl)
+    {
+        win_impl->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) );
+        wxSize size = dc->GetSize() ;
+        dc->SetClippingRegion( 0 , 0 , size.x , size.y ) ;
+    }
 }
 
 void wxOverlayImpl::EndDrawing( wxWindowDC* dc)
 {
 }
 
 void wxOverlayImpl::EndDrawing( wxWindowDC* dc)
 {
-    dc->SetGraphicsContext(NULL);
-    CGContextSynchronize( m_overlayContext );
+    wxDCImpl *impl = dc->GetImpl();
+    wxWindowDCImpl *win_impl = wxDynamicCast(impl,wxWindowDCImpl);
+    if (win_impl)
+        win_impl->SetGraphicsContext(NULL);
+        
+    CGContextFlush( m_overlayContext );
 }
 
 void wxOverlayImpl::Clear(wxWindowDC* WXUNUSED(dc))
 }
 
 void wxOverlayImpl::Clear(wxWindowDC* WXUNUSED(dc))