]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/textctrl.cpp
invalidate best size cache when GTK style changes
[wxWidgets.git] / src / mac / classic / textctrl.cpp
index 811e00268b0e3ef0546f51512df1f3213adc5a8a..078f722035c69b79786ba092615cc0463184ed60 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     1998-01-01
 // RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -1649,22 +1649,22 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
             break;
 
         case WXK_TAB:
-            // always produce navigation event - even if we process TAB
-            // ourselves the fact that we got here means that the user code
-            // decided to skip processing of this TAB - probably to let it
-            // do its default job.
+            if ( !(m_windowStyle & wxTE_PROCESS_TAB))
             {
-                wxNavigationKeyEvent eventNav;
-                eventNav.SetDirection(!event.ShiftDown());
-                eventNav.SetWindowChange(event.ControlDown());
-                eventNav.SetEventObject(this);
-
-                if ( GetParent()->GetEventHandler()->ProcessEvent(eventNav) )
-                    return;
-
-                event.Skip() ;
+                int flags = 0;
+                if (!event.ShiftDown())
+                    flags |= wxNavigationKeyEvent::IsForward ;
+                if (event.ControlDown())
+                    flags |= wxNavigationKeyEvent::WinChange ;
+                Navigate(flags);
                 return;
             }
+            else
+            {
+                // This is necessary (don't know why) or the tab will not
+                // be inserted.
+                WriteText(wxT("\t"));
+            }
             break;
     }