]> git.saurik.com Git - wxWidgets.git/commitdiff
Navigate corrections
authorJulian Smart <julian@anthemion.co.uk>
Tue, 15 Jun 2004 21:55:18 +0000 (21:55 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 15 Jun 2004 21:55:18 +0000 (21:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/window.tex
include/wx/window.h
src/common/wincmn.cpp
src/gtk/window.cpp
src/gtk1/window.cpp
src/mac/carbon/textctrl.cpp
src/mac/classic/textctrl.cpp
src/msw/textctrl.cpp

index 24cb67196612b3c4d252f6052e115df8c2e213f9..e32ce366dd77c6f626fcac32e511536d970ef85c 100644 (file)
@@ -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}
 
index 3370fa75b28c033050202d985b64a053ddc29ca7..8b53af60c05b2f5ba75667ab4382517defe14f87 100644 (file)
@@ -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
     // -------------------------
index 382bcbec6d56060e892262aaf3da4eee2663433d..5ba278de5fcd4b9a3611b4d46c102789ced2455a 100644 (file)
@@ -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) )
     {
index 82cdcb61f20cc284f6502e30cd957c51a812325d..b000562cc06d908fbd19ca88562b91fd997cea21 100644 (file)
@@ -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)) )
     {
index 82cdcb61f20cc284f6502e30cd957c51a812325d..b000562cc06d908fbd19ca88562b91fd997cea21 100644 (file)
@@ -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)) )
     {
index 86d6e450d405e8666282dc39bc6de5663648f0d6..b1ae31ebe5eae8db343d3d6f4873eea58b71591c 100644 (file)
@@ -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
index 18ebe8307f56d3ae89885e08e143aa42b994cce8..078f722035c69b79786ba092615cc0463184ed60 100644 (file)
@@ -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
index 82cc0b8e3ac05f0b8b1affeb5cdf8687a4f884a1..c4c015a3df0024bea86a8f923faf61cf37972178 100644 (file)
@@ -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;
                 }
             }