X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/561955046eefec83345402eedea28cb31a10f9c6..8fd7108e7cfd6d3564a71ab5f49c391613e27798:/src/univ/stdrend.cpp diff --git a/src/univ/stdrend.cpp b/src/univ/stdrend.cpp index 6d7040a705..f392add9cc 100644 --- a/src/univ/stdrend.cpp +++ b/src/univ/stdrend.cpp @@ -199,7 +199,7 @@ void wxStdRenderer::DrawButtonSurface(wxDC& dc, // ---------------------------------------------------------------------------- void -wxStdRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int WXUNUSED(flags)) +wxStdRenderer::DrawFocusRect(wxWindow* WXUNUSED(win), wxDC& dc, const wxRect& rect, int WXUNUSED(flags)) { // draw the pixels manually because the "dots" in wxPen with wxDOT style // may be short traits and not really dots @@ -257,6 +257,8 @@ void wxStdRenderer::DrawButtonLabel(wxDC& dc, int indexAccel, wxRect *rectBounds) { + wxDCTextColourChanger clrChanger(dc); + wxRect rectLabel = rect; if ( !label.empty() && (flags & wxCONTROL_DISABLED) ) { @@ -267,13 +269,13 @@ void wxStdRenderer::DrawButtonLabel(wxDC& dc, } // draw shadow of the text - dc.SetTextForeground(m_penHighlight.GetColour()); + clrChanger.Set(m_penHighlight.GetColour()); wxRect rectShadow = rect; rectShadow.Offset(1, 1); dc.DrawLabel(label, rectShadow, alignment, indexAccel); // make the main label text grey - dc.SetTextForeground(m_penDarkGrey.GetColour()); + clrChanger.Set(m_penDarkGrey.GetColour()); if ( flags & wxCONTROL_FOCUSED ) { @@ -288,7 +290,7 @@ void wxStdRenderer::DrawButtonLabel(wxDC& dc, { rectLabel.Inflate(-1); - DrawFocusRect(dc, rectLabel); + DrawFocusRect(NULL, dc, rectLabel); } } @@ -630,7 +632,7 @@ void wxStdRenderer::DrawItem(wxDC& dc, if ( flags & wxCONTROL_FOCUSED ) { - DrawFocusRect(dc, rect, flags); + DrawFocusRect(NULL, dc, rect, flags); } }