+ // don't TAB to another TLW
+ if ( child->IsTopLevel() )
+ {
+ node = forward ? node->GetNext() : node->GetPrevious();
+
+ continue;
+ }
+
+#if defined(__WXMSW__) && wxUSE_RADIOBTN
+ if ( event.IsFromTab() )
+ {
+ if ( wxIsKindOf(child, wxRadioButton) )
+ {
+ // only radio buttons with either wxRB_GROUP or wxRB_SINGLE
+ // can be tabbed to
+ if ( child->HasFlag(wxRB_GROUP) )
+ {
+ // need to tab into the active button within a group
+ wxRadioButton *rb = wxGetSelectedButtonInGroup((wxRadioButton*)child);
+ if ( rb )
+ child = rb;
+ }
+ else if ( !child->HasFlag(wxRB_SINGLE) )
+ {
+ node = forward ? node->GetNext() : node->GetPrevious();
+ continue;
+ }
+ }
+ }
+ else if ( m_winLastFocused &&
+ wxIsKindOf(m_winLastFocused, wxRadioButton) &&
+ !m_winLastFocused->HasFlag(wxRB_SINGLE) )
+ {
+ wxRadioButton * const
+ lastBtn = 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(lastBtn);
+ if ( !child )
+ {
+ // no next button in group, set it to the first button
+ child = wxGetFirstButtonInGroup(lastBtn);
+ }
+ }
+ else
+ {
+ child = wxGetPreviousButtonInGroup(lastBtn);
+ if ( !child )
+ {
+ // no previous button in group, set it to the last button
+ child = wxGetLastButtonInGroup(lastBtn);
+ }
+ }
+
+ if ( child == m_winLastFocused )
+ {
+ // must be a group consisting of only one button therefore
+ // no need to send a navigation event
+ event.Skip(false);
+ return;
+ }
+ }
+#endif // __WXMSW__
+
+ if ( child->CanAcceptFocusFromKeyboard() )