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
This commit is contained in:
Vadim Zeitlin 2014-05-05 14:47:45 +00:00
parent 06292da40f
commit 70387b4857

View File

@ -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);