#endif // wxHAS_DRAW_TITLE_BAR_BITMAP
-// check if we're currently in a paint event
-inline bool wxInPaintEvent(wxWindow* win, wxDC& dc)
+// check if we're having a CGContext we can draw into
+inline bool wxHasCGContext(wxWindow* WXUNUSED(win), wxDC& dc)
{
- if ( win->MacGetCGContextRef() != NULL )
- return true;
-
wxGCDCImpl* gcdc = wxDynamicCast( dc.GetImpl() , wxGCDCImpl);
if ( gcdc )
if ( gcdc->GetGraphicsContext()->GetNativeContext() )
return true;
}
- /*
- return win->MacGetCGContextRef() != NULL ||
- // wxMemoryDC's also have a valid CGContext.
- dc.IsKindOf( CLASSINFO(wxMemoryDC) );
- */
return false;
}
dc.SetBrush( *wxTRANSPARENT_BRUSH );
HIRect headerRect = CGRectMake( x, y, w, h );
- if ( !wxInPaintEvent(win, dc) )
+ if ( !wxHasCGContext(win, dc) )
{
win->Refresh( &rect );
}
dc.SetBrush( *wxTRANSPARENT_BRUSH );
HIRect headerRect = CGRectMake( x, y, w, h );
- if ( !wxInPaintEvent(win, dc) )
+ if ( !wxHasCGContext(win, dc) )
{
win->Refresh( &rect );
}
// under compositing we should only draw when called by the OS, otherwise just issue a redraw command
// strange redraw errors occur if we don't do this
- if ( !wxInPaintEvent(win, dc) )
+ if ( !wxHasCGContext(win, dc) )
{
wxRect rect( (int) splitterRect.origin.x, (int) splitterRect.origin.y, (int) splitterRect.size.width,
(int) splitterRect.size.height );
dc.SetBrush( *wxTRANSPARENT_BRUSH );
HIRect headerRect = CGRectMake( x, y, w, h );
- if ( !wxInPaintEvent(win, dc) )
+ if ( !wxHasCGContext(win, dc) )
{
win->Refresh( &rect );
}
dc.SetBrush( *wxTRANSPARENT_BRUSH );
HIRect hiRect = CGRectMake( x, y, w, h );
- if ( !wxInPaintEvent(win, dc) )
+ if ( !wxHasCGContext(win, dc) )
{
win->Refresh( &rect );
}