]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow the renderer to also work with wxMemoryDCs
authorRobin Dunn <robin@alldunn.com>
Thu, 23 Sep 2010 21:09:24 +0000 (21:09 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 23 Sep 2010 21:09:24 +0000 (21:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/renderer.cpp

index 38642f8a861d8be9ba883eab35a97821a365d85b..659b070891f36e6928204b13a7a5f918f439a1a9 100644 (file)
@@ -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
 
     #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) ); 
 }
 
 
@@ -809,4 +812,4 @@ void wxRendererMac::DrawTitleBarBitmap(wxWindow *win,
 
 #endif // wxHAS_DRAW_TITLE_BAR_BITMAP
 
-#endif
\ No newline at end of file
+#endif