]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dcclient.cpp
Document lack of wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK under OS X.
[wxWidgets.git] / src / osx / carbon / dcclient.cpp
index 4387f6c2a8a0e337db21425537ad5beb776a47c5..97929e1093ce915b43497cd4c338fa6408e4c00e 100644 (file)
@@ -58,6 +58,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window )
     if ( cg == NULL )
     {
         SetGraphicsContext( wxGraphicsContext::Create( window ) ) ;
+        SetDeviceOrigin(-window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize());
     }
     else
     {
@@ -68,7 +69,9 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window )
         if ( window->MacGetLeftBorderSize() != 0 || window->MacGetTopBorderSize() != 0 )
             CGContextTranslateCTM( cg , -window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize() );
 
-        SetGraphicsContext( wxGraphicsContext::CreateFromNative( cg ) );
+        wxGraphicsContext* context = wxGraphicsContext::CreateFromNative( cg );
+        context->EnableOffset(true);
+        SetGraphicsContext( context );
     }
     DoSetClippingRegion( 0 , 0 , m_width , m_height ) ;
 
@@ -155,7 +158,11 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) :
     m_window->GetClientSize( &m_width , &m_height);
     if ( !m_window->IsShownOnScreen() )
         m_width = m_height = 0;
-    SetDeviceOrigin( origin.x, origin.y );
+    
+    int x0,y0;
+    DoGetDeviceOrigin(&x0,&y0);
+    SetDeviceOrigin( origin.x + x0, origin.y + y0 );
+    
     DoSetClippingRegion( 0 , 0 , m_width , m_height ) ;
 }