X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/391b16953a9895de51f2f6ecd9237088903bc0d8..0b7dce5480b8cf7ce4368122744d853f7a684e34:/src/common/containr.cpp diff --git a/src/common/containr.cpp b/src/common/containr.cpp index c0156165dd..06ada8e7a2 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 = static_cast(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); } }