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:
parent
319fefa910
commit
57c0af52bf
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user