Just use wxPrivate namespace
Writing "wxPrivate::wxFoo()" is a bit ugly, so just add a using directive for the namespace, it's not a problem to do it in this file.
This commit is contained in:
@@ -353,6 +353,8 @@ wxRadioButton* wxGetSelectedButtonInGroup(wxRadioButton *btn)
|
|||||||
|
|
||||||
} // namespace wxPrivate
|
} // namespace wxPrivate
|
||||||
|
|
||||||
|
using namespace wxPrivate;
|
||||||
|
|
||||||
#endif // wxUSE_RADIOBTN
|
#endif // wxUSE_RADIOBTN
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -473,7 +475,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
|
|||||||
// If we are in a radio button group, start from the first item in the
|
// If we are in a radio button group, start from the first item in the
|
||||||
// group
|
// group
|
||||||
if ( event.IsFromTab() && wxIsKindOf(winFocus, wxRadioButton ) )
|
if ( event.IsFromTab() && wxIsKindOf(winFocus, wxRadioButton ) )
|
||||||
winFocus = wxPrivate::wxGetFirstButtonInGroup((wxRadioButton*)winFocus);
|
winFocus = wxGetFirstButtonInGroup((wxRadioButton*)winFocus);
|
||||||
#endif // USE_RADIOBTN_NAV
|
#endif // USE_RADIOBTN_NAV
|
||||||
// ok, we found the focus - now is it our child?
|
// ok, we found the focus - now is it our child?
|
||||||
start_node = children.Find( winFocus );
|
start_node = children.Find( winFocus );
|
||||||
@@ -569,7 +571,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
|
|||||||
if ( child->HasFlag(wxRB_GROUP) )
|
if ( child->HasFlag(wxRB_GROUP) )
|
||||||
{
|
{
|
||||||
// need to tab into the active button within a group
|
// need to tab into the active button within a group
|
||||||
wxRadioButton *rb = wxPrivate::wxGetSelectedButtonInGroup((wxRadioButton*)child);
|
wxRadioButton *rb = wxGetSelectedButtonInGroup((wxRadioButton*)child);
|
||||||
if ( rb )
|
if ( rb )
|
||||||
child = rb;
|
child = rb;
|
||||||
}
|
}
|
||||||
@@ -591,20 +593,20 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
|
|||||||
// find the correct radio button to focus
|
// find the correct radio button to focus
|
||||||
if ( forward )
|
if ( forward )
|
||||||
{
|
{
|
||||||
child = wxPrivate::wxGetNextButtonInGroup(lastBtn);
|
child = wxGetNextButtonInGroup(lastBtn);
|
||||||
if ( !child )
|
if ( !child )
|
||||||
{
|
{
|
||||||
// no next button in group, set it to the first button
|
// no next button in group, set it to the first button
|
||||||
child = wxPrivate::wxGetFirstButtonInGroup(lastBtn);
|
child = wxGetFirstButtonInGroup(lastBtn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
child = wxPrivate::wxGetPreviousButtonInGroup(lastBtn);
|
child = wxGetPreviousButtonInGroup(lastBtn);
|
||||||
if ( !child )
|
if ( !child )
|
||||||
{
|
{
|
||||||
// no previous button in group, set it to the last button
|
// no previous button in group, set it to the last button
|
||||||
child = wxPrivate::wxGetLastButtonInGroup(lastBtn);
|
child = wxGetLastButtonInGroup(lastBtn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -769,7 +771,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
|
|||||||
wxRadioButton* btn = wxDynamicCast(child, wxRadioButton);
|
wxRadioButton* btn = wxDynamicCast(child, wxRadioButton);
|
||||||
if (btn)
|
if (btn)
|
||||||
{
|
{
|
||||||
wxRadioButton* selected = wxPrivate::wxGetSelectedButtonInGroup(btn);
|
wxRadioButton* selected = wxGetSelectedButtonInGroup(btn);
|
||||||
if (selected)
|
if (selected)
|
||||||
child = selected;
|
child = selected;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user