From 3061e2fb502bc5a5572843b417ead3674f25410b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 19 Apr 2006 01:20:42 +0000 Subject: [PATCH] use wxDC::DrawCheckMark() to draw the checkbox button; also simplified the code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/renderg.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index 7b89f9d7ec..53e31a830f 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -406,21 +406,13 @@ wxRendererGeneric::DrawCheckButton(wxWindow *WXUNUSED(win), const wxRect& rect, int flags) { - if (flags & wxCONTROL_DISABLED) - dc.SetPen( *wxGREY_PEN ); - else - dc.SetPen( *wxBLACK_PEN ); + dc.SetPen(*(flags & wxCONTROL_DISABLED ? wxGREY_PEN : wxBLACK_PEN)); dc.SetBrush( *wxTRANSPARENT_BRUSH ); - wxRect my_rect = rect; - dc.DrawRectangle( my_rect ); - if (flags & wxCONTROL_CHECKED) + dc.DrawRectangle(rect); + + if ( flags & wxCONTROL_CHECKED ) { - my_rect.x += 2; - my_rect.y += 2; - my_rect.width -= 4; - my_rect.height -= 4; - dc.DrawLine( my_rect.x, my_rect.y, my_rect.x+my_rect.width, my_rect.y+my_rect.height ); - dc.DrawLine( my_rect.x+my_rect.width, my_rect.y, my_rect.x, my_rect.y+my_rect.height ); + dc.DrawCheckMark(rect.Deflate(2, 2)); } } -- 2.45.2