From 70387b4857483ea6c955a5b9a945d31d6ee81195 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 5 May 2014 14:47:45 +0000 Subject: [PATCH] Fix wxMSW owner drawn buttons appearance in "selected" state. Draw the buttons (i.e. checkboxes and radio buttons) correctly when the space key is pressed. See #10137. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/control.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 077d09417b..aac7d19549 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -566,6 +566,9 @@ bool wxMSWOwnerDrawnButtonBase::MSWDrawButton(WXDRAWITEMSTRUCT *item) int flags = MSWGetButtonCheckedFlag(); + if ( dis->itemState & ODS_SELECTED ) + flags |= wxCONTROL_SELECTED | wxCONTROL_PRESSED; + if ( !m_win->IsEnabled() ) flags |= wxCONTROL_DISABLED; @@ -620,6 +623,9 @@ bool wxMSWOwnerDrawnButtonBase::MSWDrawButton(WXDRAWITEMSTRUCT *item) rectLabel.right = rect.right; } + // Erase the background. + ::FillRect(hdc, &rect, m_win->MSWGetBgBrush(hdc)); + // draw the button itself wxDCTemp dc(hdc);