diff --git a/include/wx/radiobut.h b/include/wx/radiobut.h index 02dadc5ff9..182ae9c8c5 100644 --- a/include/wx/radiobut.h +++ b/include/wx/radiobut.h @@ -34,10 +34,13 @@ class WXDLLIMPEXP_FWD_CORE wxRadioButton; -wxRadioButton* wxGetNextButtonInGroup(wxRadioButton *btn); -wxRadioButton* wxGetPreviousButtonInGroup(wxRadioButton *btn); -wxRadioButton* wxGetFirstButtonInGroup(wxRadioButton *btn); -wxRadioButton* wxGetLastButtonInGroup(wxRadioButton *btn); +namespace wxPrivate +{ + WXDLLIMPEXP_CORE wxRadioButton* wxGetNextButtonInGroup(wxRadioButton *btn); + WXDLLIMPEXP_CORE wxRadioButton* wxGetPreviousButtonInGroup(wxRadioButton *btn); + WXDLLIMPEXP_CORE wxRadioButton* wxGetFirstButtonInGroup(wxRadioButton *btn); + WXDLLIMPEXP_CORE wxRadioButton* wxGetLastButtonInGroup(wxRadioButton *btn); +} // namespace wxPrivate template class WXDLLIMPEXP_CORE wxRadioButtonBase : public W @@ -49,22 +52,22 @@ public: wxRadioButton* GetFirstInGroup() { - return wxGetFirstButtonInGroup( static_cast(this)); + return wxPrivate::wxGetFirstButtonInGroup( static_cast(this)); } wxRadioButton* GetLastInGroup() { - return wxGetLastButtonInGroup( static_cast(this)); + return wxPrivate::wxGetLastButtonInGroup( static_cast(this)); } wxRadioButton* GetPreviousInGroup() { - return wxGetPreviousButtonInGroup( static_cast(this)); + return wxPrivate::wxGetPreviousButtonInGroup( static_cast(this)); } wxRadioButton* GetNextInGroup() { - return wxGetNextButtonInGroup( static_cast(this)); + return wxPrivate::wxGetNextButtonInGroup( static_cast(this)); } private: diff --git a/src/common/containr.cpp b/src/common/containr.cpp index b418a3b8c2..9bcdbab781 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -240,6 +240,9 @@ void wxControlContainer::SetLastFocus(wxWindow *win) #if wxUSE_RADIOBTN +namespace wxPrivate +{ + wxRadioButton* wxGetPreviousButtonInGroup(wxRadioButton *btn) { if ( btn->HasFlag(wxRB_GROUP) || btn->HasFlag(wxRB_SINGLE) ) @@ -348,6 +351,8 @@ wxRadioButton* wxGetSelectedButtonInGroup(wxRadioButton *btn) return NULL; } +} // namespace wxPrivate + #endif // wxUSE_RADIOBTN // ---------------------------------------------------------------------------- @@ -468,7 +473,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event ) // If we are in a radio button group, start from the first item in the // group if ( event.IsFromTab() && wxIsKindOf(winFocus, wxRadioButton ) ) - winFocus = wxGetFirstButtonInGroup((wxRadioButton*)winFocus); + winFocus = wxPrivate::wxGetFirstButtonInGroup((wxRadioButton*)winFocus); #endif // USE_RADIOBTN_NAV // ok, we found the focus - now is it our child? start_node = children.Find( winFocus ); @@ -564,7 +569,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event ) if ( child->HasFlag(wxRB_GROUP) ) { // need to tab into the active button within a group - wxRadioButton *rb = wxGetSelectedButtonInGroup((wxRadioButton*)child); + wxRadioButton *rb = wxPrivate::wxGetSelectedButtonInGroup((wxRadioButton*)child); if ( rb ) child = rb; } @@ -586,20 +591,20 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event ) // find the correct radio button to focus if ( forward ) { - child = wxGetNextButtonInGroup(lastBtn); + child = wxPrivate::wxGetNextButtonInGroup(lastBtn); if ( !child ) { // no next button in group, set it to the first button - child = wxGetFirstButtonInGroup(lastBtn); + child = wxPrivate::wxGetFirstButtonInGroup(lastBtn); } } else { - child = wxGetPreviousButtonInGroup(lastBtn); + child = wxPrivate::wxGetPreviousButtonInGroup(lastBtn); if ( !child ) { // no previous button in group, set it to the last button - child = wxGetLastButtonInGroup(lastBtn); + child = wxPrivate::wxGetLastButtonInGroup(lastBtn); } } @@ -764,7 +769,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) wxRadioButton* btn = wxDynamicCast(child, wxRadioButton); if (btn) { - wxRadioButton* selected = wxGetSelectedButtonInGroup(btn); + wxRadioButton* selected = wxPrivate::wxGetSelectedButtonInGroup(btn); if (selected) child = selected; }