Don't activate hidden buttons when Enter is pressed in wxMSW.

The keyboard handling code could decide to activate a button which wasn't
currently visible at all, e.g. because it was on a non-current, and hence
hidden, page of a wxBookCtrl. This didn't make any sense, so check for the
button visibility before activating it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-08-03 12:47:45 +00:00
parent 1b90acc357
commit f1950d1111

View File

@ -2536,7 +2536,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
}
}
if ( btn && btn->IsEnabled() )
if ( btn && btn->IsEnabled() && btn->IsShownOnScreen() )
{
btn->MSWCommand(BN_CLICKED, 0 /* unused */);
return true;