]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxDC::DrawCheckMark() to draw the checkbox button; also simplified the code
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 19 Apr 2006 01:20:42 +0000 (01:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 19 Apr 2006 01:20:42 +0000 (01:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/renderg.cpp

index 7b89f9d7ec5f6403d68ad66c5fab68de060ab7fe..53e31a830f14bb23ca852e171f8ddb09f65fcf20 100644 (file)
@@ -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));
     }
 }