move default button handling code from wxControlContainer to wxTLW (patch 1524441)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2146,14 +2146,17 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
|
||||
else // not a button itself
|
||||
{
|
||||
#if wxUSE_BUTTON
|
||||
wxButton *btn = wxDynamicCast(GetDefaultItem(),
|
||||
wxButton);
|
||||
if ( btn && btn->IsEnabled() )
|
||||
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
|
||||
if ( tlw )
|
||||
{
|
||||
// if we do have a default button, do press it
|
||||
btn->MSWCommand(BN_CLICKED, 0 /* unused */);
|
||||
wxButton *btn = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
|
||||
if ( btn && btn->IsEnabled() )
|
||||
{
|
||||
// if we do have a default button, do press it
|
||||
btn->MSWCommand(BN_CLICKED, 0 /* unused */);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else // no default button
|
||||
#endif // wxUSE_BUTTON
|
||||
|
Reference in New Issue
Block a user