-// TODO CS
- dc->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) );
-/*
- delete dc->m_graphicContext ;
- dc->m_graphicContext = new wxMacCGContext( m_overlayContext );
- // we are right now startin at 0,0 not at the wxWindow's origin, so most of the calculations
- // int dc are already corect
- // just to make sure :
- dc->m_macLocalOrigin.x = 0 ;
- dc->m_macLocalOrigin.y = 0 ;
-*/
- 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 ) ;
+ }