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:
@@ -201,9 +201,12 @@ void wxButton::Command(wxCommandEvent & event)
|
|||||||
bool wxButton::MSWCommand(WXUINT param, WXWORD id)
|
bool wxButton::MSWCommand(WXUINT param, WXWORD id)
|
||||||
{
|
{
|
||||||
bool processed = FALSE;
|
bool processed = FALSE;
|
||||||
if ( param == BN_CLICKED || param == 1 ) // 1 for accelerator
|
switch ( param )
|
||||||
{
|
{
|
||||||
|
case 1: // 1 for accelerator
|
||||||
|
case BN_CLICKED:
|
||||||
processed = SendClickEvent();
|
processed = SendClickEvent();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
|
@@ -1458,9 +1458,18 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
|||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
|
|
||||||
if ( GetEventHandler()->ProcessEvent(event) )
|
if ( GetEventHandler()->ProcessEvent(event) )
|
||||||
|
{
|
||||||
|
wxButton *btn = wxDynamicCast(FindFocus(), wxButton);
|
||||||
|
if ( btn )
|
||||||
|
{
|
||||||
|
// the button which has focus should be default
|
||||||
|
btn->SetDefault();
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( ::IsDialogMessage(GetHwnd(), msg) )
|
if ( ::IsDialogMessage(GetHwnd(), msg) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user