buttons now become default when they have focus

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-06-20 22:07:49 +00:00
parent 319fefa910
commit 57c0af52bf
2 changed files with 14 additions and 2 deletions

View File

@ -201,9 +201,12 @@ void wxButton::Command(wxCommandEvent & event)
bool wxButton::MSWCommand(WXUINT param, WXWORD id)
{
bool processed = FALSE;
if ( param == BN_CLICKED || param == 1 ) // 1 for accelerator
switch ( param )
{
processed = SendClickEvent();
case 1: // 1 for accelerator
case BN_CLICKED:
processed = SendClickEvent();
break;
}
return processed;

View File

@ -1458,7 +1458,16 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
event.SetEventObject(this);
if ( GetEventHandler()->ProcessEvent(event) )
{
wxButton *btn = wxDynamicCast(FindFocus(), wxButton);
if ( btn )
{
// the button which has focus should be default
btn->SetDefault();
}
return TRUE;
}
}
}