X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/afd5d91cae0ef66ac743ffb26c55e33af4735c0f..ce0ee9aec1fe43a5645390bd1e45f27a2518a03b:/src/osx/carbon/renderer.cpp?ds=sidebyside diff --git a/src/osx/carbon/renderer.cpp b/src/osx/carbon/renderer.cpp index cf8c734dc3..2481dd2242 100644 --- a/src/osx/carbon/renderer.cpp +++ b/src/osx/carbon/renderer.cpp @@ -6,7 +6,7 @@ // Created: 20.07.2003 // RCS-ID: $Id$ // Copyright: (c) 2003 Vadim Zeitlin -// License: wxWindows licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // for compilers that support precompilation, includes "wx.h". @@ -24,6 +24,7 @@ #include "wx/bitmap.h" #include "wx/settings.h" #include "wx/dcclient.h" + #include "wx/dcmemory.h" #include "wx/toplevel.h" #endif @@ -37,11 +38,13 @@ #include "wx/mstream.h" #endif // wxHAS_DRAW_TITLE_BAR_BITMAP + // check if we're currently in a paint event inline bool wxInPaintEvent(wxWindow* win, wxDC& dc) { - wxUnusedVar(dc); - return ( win->MacGetCGContextRef() != NULL ); + return win->MacGetCGContextRef() != NULL || + // wxMemoryDC's also have a valid CGContext. + dc.IsKindOf( CLASSINFO(wxMemoryDC) ); } @@ -301,12 +304,12 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win, if ( hasMetal ) HIThemeDrawBackground(&splitterRect, &bgdrawInfo, cgContext, kHIThemeOrientationNormal); - else + else { CGContextSetFillColorWithColor(cgContext,win->GetBackgroundColour().GetCGColor()); CGContextFillRect(cgContext,splitterRect); } - + HIThemeSplitterDrawInfo drawInfo; drawInfo.version = 0; drawInfo.state = kThemeStateActive; @@ -809,4 +812,4 @@ void wxRendererMac::DrawTitleBarBitmap(wxWindow *win, #endif // wxHAS_DRAW_TITLE_BAR_BITMAP -#endif \ No newline at end of file +#endif