]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed drawing a check box in the undetermined state for non-themed MSW apps.
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Mon, 29 Aug 2011 16:06:32 +0000 (16:06 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Mon, 29 Aug 2011 16:06:32 +0000 (16:06 +0000)
wxRendererMSW::DoDrawFrameControl (used for systems prior to XP or when theming is disabled) didn't check for the wxCONTROL_UNDETERMINED flag yet. Set the appropriate styles when the flag is used to fix drawing check boxes in their third state (as used in for example the treelist sample).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/renderer.cpp

index d1b57d14feff807cbcdd59fb4aa2e2c7d3ccd97b..46f438191514712ab9304290f0c51d11ab71f5f0 100644 (file)
@@ -437,6 +437,11 @@ wxRendererMSW::DoDrawFrameControl(UINT type,
         style |= DFCS_PUSHED;
     if ( flags & wxCONTROL_CURRENT )
         style |= DFCS_HOT;
+    if ( flags & wxCONTROL_UNDETERMINED )
+        // Using DFCS_BUTTON3STATE here doesn't work (as might be expected),
+        // use the following two styles to get the same look of a check box
+        // in the undetermined state.
+        style |= DFCS_INACTIVE | DFCS_CHECKED;
 
     ::DrawFrameControl(GetHdcOf(dc.GetTempHDC()), &r, type, style);
 }