]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Add placeholder for wxParseWildcard
[wxWidgets.git] / src / msw / textctrl.cpp
index e285303d8dca2e57c0c6f5d7f55370662b4f399a..82cc0b8e3ac05f0b8b1affeb5cdf8687a4f884a1 100644 (file)
@@ -1181,7 +1181,7 @@ bool wxTextCtrl::IsEditable() const
 
 void wxTextCtrl::SetSelection(long from, long to)
 {
-    // if from and to are both -1, it means (in wxWindows) that all text should
+    // if from and to are both -1, it means (in wxWidgets) that all text should
     // be selected - translate into Windows convention
     if ( (from == -1) && (to == -1) )
     {
@@ -1689,11 +1689,6 @@ 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.
-
             // ok, so this is getting absolutely ridiculous but I don't see
             // any other way to fix this bug: when a multiline text control is
             // inside a wxFrame, we need to generate the navigation event as
@@ -1708,15 +1703,19 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
             // the right thing to do would, of course, be to understand what
             // the hell is IsDialogMessage() doing but this is beyond my feeble
             // forces at the moment unfortunately
-            if ( FindFocus() == this )
+            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;
+                if ( FindFocus() == this )
+                {
+                    if (Navigate(!event.ShiftDown(), event.ControlDown()))
+                        return;
+                }
+            }
+            else
+            {
+                // Insert tab since calling the default Windows handler
+                // doesn't seem to do it
+                WriteText(wxT("\t"));
             }
             break;
     }
@@ -2306,7 +2305,7 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
             cf.dwEffects |= CFE_UNDERLINE;
         }
 
-        // strikeout fonts are not supported by wxWindows
+        // strikeout fonts are not supported by wxWidgets
     }
 
     if ( style.HasTextColour() )