X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec20a753b99f318de3bccf86a741a867717e6a92..5f480c0bf140db144e00993b060af28e45cd9c94:/src/osx/carbon/renderer.cpp diff --git a/src/osx/carbon/renderer.cpp b/src/osx/carbon/renderer.cpp index c8d11afd5d..9fc1a415bf 100644 --- a/src/osx/carbon/renderer.cpp +++ b/src/osx/carbon/renderer.cpp @@ -6,12 +6,14 @@ // 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". #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 @@ -35,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) ); } @@ -57,6 +62,8 @@ public: virtual int GetHeaderButtonHeight(wxWindow *win); + virtual int GetHeaderButtonMargin(wxWindow *win); + // draw the expanded/collapsed icon for a tree control item virtual void DrawTreeItemButton( wxWindow *win, wxDC& dc, @@ -220,6 +227,12 @@ int wxRendererMac::GetHeaderButtonHeight(wxWindow* WXUNUSED(win)) return -1; } +int wxRendererMac::GetHeaderButtonMargin(wxWindow *WXUNUSED(win)) +{ + wxFAIL_MSG( "GetHeaderButtonMargin() not implemented" ); + return -1; +} + void wxRendererMac::DrawTreeItemButton( wxWindow *win, wxDC& dc, const wxRect& rect, @@ -284,14 +297,27 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win, { wxRect rect( (int) splitterRect.origin.x, (int) splitterRect.origin.y, (int) splitterRect.size.width, (int) splitterRect.size.height ); - win->Refresh( &rect ); - } + win->RefreshRect( rect ); + } else { CGContextRef cgContext; wxGCDCImpl *impl = (wxGCDCImpl*) dc.GetImpl(); cgContext = (CGContextRef) impl->GetGraphicsContext()->GetNativeContext(); + HIThemeBackgroundDrawInfo bgdrawInfo; + bgdrawInfo.version = 0; + bgdrawInfo.state = kThemeStateActive; + bgdrawInfo.kind = hasMetal ? kThemeBackgroundMetal : kThemeBackgroundPlacard; + + if ( hasMetal ) + HIThemeDrawBackground(&splitterRect, &bgdrawInfo, cgContext, kHIThemeOrientationNormal); + else + { + CGContextSetFillColorWithColor(cgContext,win->GetBackgroundColour().GetCGColor()); + CGContextFillRect(cgContext,splitterRect); + } + HIThemeSplitterDrawInfo drawInfo; drawInfo.version = 0; drawInfo.state = kThemeStateActive; @@ -793,3 +819,5 @@ void wxRendererMac::DrawTitleBarBitmap(wxWindow *win, } #endif // wxHAS_DRAW_TITLE_BAR_BITMAP + +#endif