git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2843
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
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;
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;
+ }
}
}