\membersection{wxWindow::Navigate}\label{wxwindownavigate}
-\func{bool}{Navigate}{\param{bool}{ direction = true}, \param{bool}{ windowChange = false}}
+\func{bool}{Navigate}{\param{int}{ flags = wxNavigationKeyEvent::IsForward}}
Does keyboard navigation from this window to another, by sending
a wxNavigationKeyEvent.
\wxheading{Parameters}
-\docparam{direction}{{\tt true} to navigate forwards, {\tt false} to navigate backwards.}
-
-\docparam{windowChange}{{\tt true} if the navigation is a window change.}
+\docparam{flags}{A combination of wxNavigationKeyEvent::IsForward and wxNavigationKeyEvent::WinChange.}
\wxheading{Remarks}
virtual void SetTmpDefaultItem(wxWindow * WXUNUSED(win)) { }
// Navigates in the specified direction by sending a wxNavigationKeyEvent
- virtual bool Navigate(bool direction = true, bool windowChange = false);
+ virtual bool Navigate(int flags = wxNavigationKeyEvent::IsForward);
// parent/children relations
// -------------------------
// ----------------------------------------------------------------------------
// Navigates in the specified direction.
-bool wxWindowBase::Navigate(bool direction, bool windowChange)
+bool wxWindowBase::Navigate(int flags)
{
wxNavigationKeyEvent eventNav;
- eventNav.SetDirection(direction);
- eventNav.SetWindowChange(windowChange);
+ eventNav.SetFlags(flags);
eventNav.SetEventObject(this);
if ( GetParent()->GetEventHandler()->ProcessEvent(eventNav) )
{
// JS: enabling again to make consistent with other platforms
// (with wxTE_PROCESS_TAB you have to call Navigate to get default
// navigation behaviour)
-#if 1
- !win->HasFlag(wxTE_PROCESS_TAB) &&
+#if wxUSE_TEXTCTRL
+ (! (win->HasFlag(wxTE_PROCESS_TAB) && IsKindOf(CLASSINFO(wxTextCtrl)) )) &&
#endif
win->GetParent() && (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) )
{
// JS: enabling again to make consistent with other platforms
// (with wxTE_PROCESS_TAB you have to call Navigate to get default
// navigation behaviour)
-#if 1
- !win->HasFlag(wxTE_PROCESS_TAB) &&
+#if wxUSE_TEXTCTRL
+ (! (win->HasFlag(wxTE_PROCESS_TAB) && IsKindOf(CLASSINFO(wxTextCtrl)) )) &&
#endif
win->GetParent() && (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) )
{
case WXK_TAB:
if ( !(m_windowStyle & wxTE_PROCESS_TAB))
{
- Navigate(!event.ShiftDown(), event.ControlDown());
+ int flags = 0;
+ if (!event.ShiftDown())
+ flags |= wxNavigationKeyEvent::IsForward ;
+ if (event.ControlDown())
+ flags |= wxNavigationKeyEvent::WinChange ;
+ Navigate(flags);
return;
}
else
case WXK_TAB:
if ( !(m_windowStyle & wxTE_PROCESS_TAB))
{
- Navigate(!event.ShiftDown(), event.ControlDown());
+ int flags = 0;
+ if (!event.ShiftDown())
+ flags |= wxNavigationKeyEvent::IsForward ;
+ if (event.ControlDown())
+ flags |= wxNavigationKeyEvent::WinChange ;
+ Navigate(flags);
return;
}
else
{
if ( FindFocus() == this )
{
- if (Navigate(!event.ShiftDown(), event.ControlDown()))
+ int flags = 0;
+ if (!event.ShiftDown())
+ flags |= wxNavigationKeyEvent::IsForward ;
+ if (event.ControlDown())
+ flags |= wxNavigationKeyEvent::WinChange ;
+ if (Navigate(flags))
return;
}
}