remove the search for parent with wxTAB_TRAVERSAL style in SetDefaultStyle(): it's useless as DM_SETDEFID can be only sent to the immediate parent anyhow, apparently

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2006-07-16 19:23:03 +00:00
parent dabb9b6d29
commit cef55d6485

View File

@ -397,18 +397,13 @@ wxButton::SetDefaultStyle(wxButton *btn, bool on)
if ( !wxTheApp->IsActive() )
return;
// look for a panel-like window
wxWindow *win = btn->GetParent();
while ( win && !win->HasFlag(wxTAB_TRAVERSAL) )
win = win->GetParent();
wxWindow * const parent = btn->GetParent();
wxCHECK_RET( parent, _T("button without parent?") );
if ( win )
{
::SendMessage(GetHwndOf(win), DM_SETDEFID, btn->GetId(), 0L);
::SendMessage(GetHwndOf(parent), DM_SETDEFID, btn->GetId(), 0L);
// sending DM_SETDEFID also changes the button style to
// BS_DEFPUSHBUTTON so there is nothing more to do
}
// sending DM_SETDEFID also changes the button style to
// BS_DEFPUSHBUTTON so there is nothing more to do
}
// then also change the style as needed