From fe63109fc4429d3ca70310102f0a5daaee02f861 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Tue, 23 Feb 2010 15:24:50 +0000 Subject: [PATCH] When drawing wxPropertyGrid check box editor, be consistent with the other editors and use dc.GetTextForeground() for obtaining check box colour git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/editors.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 9ac08888ab..433a16112d 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1400,12 +1400,12 @@ const int wxSCB_SETVALUE_CYCLE = 2; static void DrawSimpleCheckBox( wxDC& dc, const wxRect& rect, int box_hei, - int state, const wxColour& lineCol ) + int state ) { // Box rectangle. wxRect r(rect.x+wxPG_XBEFORETEXT,rect.y+((rect.height-box_hei)/2), box_hei,box_hei); - wxColour useCol = lineCol; + wxColour useCol = dc.GetTextForeground(); if ( state & wxSCB_STATE_UNSPECIFIED ) { @@ -1529,14 +1529,14 @@ void wxSimpleCheckBox::OnPaint( wxPaintEvent& WXUNUSED(event) ) dc.SetPen( bgcol ); dc.DrawRectangle( rect ); - wxColour txcol = GetForegroundColour(); + dc.SetTextForeground(GetForegroundColour()); int state = m_state; if ( !(state & wxSCB_STATE_UNSPECIFIED) && GetFont().GetWeight() == wxBOLD ) state |= wxSCB_STATE_BOLD; - DrawSimpleCheckBox(dc,rect,m_boxHeight,state,txcol); + DrawSimpleCheckBox(dc, rect, m_boxHeight, state); } void wxSimpleCheckBox::OnLeftClick( wxMouseEvent& event ) @@ -1629,7 +1629,6 @@ void wxPGCheckBoxEditor::DrawValue( wxDC& dc, const wxRect& rect, const wxString& WXUNUSED(text) ) const { int state = wxSCB_STATE_UNCHECKED; - wxColour rectCol = dc.GetTextForeground(); if ( !property->IsValueUnspecified() ) { @@ -1642,7 +1641,7 @@ void wxPGCheckBoxEditor::DrawValue( wxDC& dc, const wxRect& rect, state |= wxSCB_STATE_UNSPECIFIED; } - DrawSimpleCheckBox(dc, rect, dc.GetCharHeight(), state, rectCol); + DrawSimpleCheckBox(dc, rect, dc.GetCharHeight(), state); } void wxPGCheckBoxEditor::UpdateControl( wxPGProperty* property, -- 2.45.2