X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6d78998725b53eea209c0fa845b5a25fe5b512d2..2263f62d9b7e6c44db963cbb42438752fd176aa5:/src/generic/renderg.cpp diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index 5ff309e88a..0dba0f18d3 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -37,6 +37,10 @@ #include "wx/splitter.h" #include "wx/dcmirror.h" +#ifdef __WXMAC__ + #include "wx/mac/private.h" +#endif + // ---------------------------------------------------------------------------- // wxRendererGeneric: our wxRendererNative implementation // ---------------------------------------------------------------------------- @@ -635,10 +639,17 @@ wxRendererGeneric::DrawPushButton(wxWindow *win, } void +#ifdef __WXMAC__ +wxRendererGeneric::DrawItemSelectionRect(wxWindow * win, + wxDC& dc, + const wxRect& rect, + int flags) +#else wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win), wxDC& dc, const wxRect& rect, int flags) +#endif { wxBrush brush; if ( flags & wxCONTROL_SELECTED ) @@ -658,7 +669,14 @@ wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win), } dc.SetBrush(brush); - dc.SetPen(flags & wxCONTROL_CURRENT ? *wxBLACK_PEN : *wxTRANSPARENT_PEN); + if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED) +#ifdef __WXMAC__ + && IsControlActive( (ControlRef)win->GetHandle() ) +#endif + ) + dc.SetPen( *wxBLACK_PEN ); + else + dc.SetPen( *wxTRANSPARENT_PEN ); dc.DrawRectangle( rect ); } @@ -678,9 +696,13 @@ wxRendererGeneric::DrawFocusRect(wxWindow* WXUNUSED(win), wxDC& dc, const wxRect dc.SetPen(m_penBlack); +#ifdef __WXMAC__ + dc.SetLogicalFunction(wxCOPY); +#else // this seems to be closer than what Windows does than wxINVERT although // I'm still not sure if it's correct dc.SetLogicalFunction(wxAND_REVERSE); +#endif wxCoord z; for ( z = x1 + 1; z < x2; z += 2 )