]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/renderer.cpp
Improve positioning of wxSlider min/max labels in wxMSW.
[wxWidgets.git] / src / osx / carbon / renderer.cpp
index fd3b471abf6a84cff35a0416890fcb45e885539b..2481dd2242732914376dffed360ca956c7e1a736 100644 (file)
@@ -6,12 +6,14 @@
 // Created:     20.07.2003
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
-// License:     wxWindows licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // for compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxOSX_USE_COCOA_OR_CARBON
+
 #ifdef __BORLANDC__
     #pragma hdrstop
 #endif
@@ -22,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) );
 }
 
 
@@ -299,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;
@@ -806,3 +811,5 @@ void wxRendererMac::DrawTitleBarBitmap(wxWindow *win,
 }
 
 #endif // wxHAS_DRAW_TITLE_BAR_BITMAP
+
+#endif