no changes, just do the case of m_winLastFocused to wxRadioButton once instead of four times in wxMSW radiobutton navigation hack fragment

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-02-11 00:14:54 +00:00
parent 391b16953a
commit 506f9e92cb

View File

@@ -532,24 +532,27 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
wxIsKindOf(m_winLastFocused, wxRadioButton) &&
!m_winLastFocused->HasFlag(wxRB_SINGLE) )
{
wxRadioButton * const
lastBtn = wx_static_cast(wxRadioButton *, m_winLastFocused);
// cursor keys don't navigate out of a radio button group so
// find the correct radio button to focus
if ( forward )
{
child = wxGetNextButtonInGroup((wxRadioButton*)m_winLastFocused);
child = wxGetNextButtonInGroup(lastBtn);
if ( !child )
{
// no next button in group, set it to the first button
child = wxGetFirstButtonInGroup((wxRadioButton*)m_winLastFocused);
child = wxGetFirstButtonInGroup(lastBtn);
}
}
else
{
child = wxGetPreviousButtonInGroup((wxRadioButton*)m_winLastFocused);
child = wxGetPreviousButtonInGroup(lastBtn);
if ( !child )
{
// no previous button in group, set it to the last button
child = wxGetLastButtonInGroup((wxRadioButton*)m_winLastFocused);
child = wxGetLastButtonInGroup(lastBtn);
}
}