From: Vadim Zeitlin Date: Mon, 11 Feb 2008 00:14:54 +0000 (+0000) Subject: no changes, just do the case of m_winLastFocused to wxRadioButton once instead of... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/506f9e92cbb2e6948ffa281fe07634cdf0276454 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 --- diff --git a/src/common/containr.cpp b/src/common/containr.cpp index c0156165dd..43de0255b0 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -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); } }