Navigate corrections
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
03d51a2d40
commit
eedc82f4e9
@ -1450,16 +1450,14 @@ implements the following methods:\par
|
||||
|
||||
\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}
|
||||
|
||||
|
@ -490,7 +490,7 @@ public:
|
||||
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
|
||||
// -------------------------
|
||||
|
@ -2405,11 +2405,10 @@ bool wxWindowBase::TryParent(wxEvent& event)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// 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) )
|
||||
{
|
||||
|
@ -1197,8 +1197,8 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
|
||||
// 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)) )
|
||||
{
|
||||
|
@ -1197,8 +1197,8 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
|
||||
// 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)) )
|
||||
{
|
||||
|
@ -1987,7 +1987,12 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
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
|
||||
|
@ -1651,7 +1651,12 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
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
|
||||
|
@ -1707,7 +1707,12 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user