]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextctrl.cpp
fixed python-related files names after they had been apparently renamed in the cvs...
[wxWidgets.git] / src / richtext / richtextctrl.cpp
index 36a885aa2b7832cd18b6f9aeda66c7ea45016f30..f09732ccd2322a7caa8eec86aa2dbc6e88129dba 100644 (file)
@@ -432,8 +432,18 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
         event.GetKeyCode() == WXK_END)
     {
         KeyboardNavigate(event.GetKeyCode(), flags);
+        return;
+    }
+
+    // all the other keys modify the controls contents which shouldn't be
+    // possible if we're read-only
+    if ( !IsEditable() )
+    {
+        event.Skip();
+        return;
     }
-    else if (event.GetKeyCode() == WXK_RETURN)
+
+    if (event.GetKeyCode() == WXK_RETURN)
     {
         BeginBatchUndo(_("Insert Text"));
 
@@ -527,10 +537,6 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
         SetDefaultStyleToCursorStyle();
         ScrollIntoView(m_caretPosition, WXK_RIGHT);
     }
-#if 0
-    else
-        event.Skip();
-#endif
 }
 
 /// Delete content if there is a selection, e.g. when pressing a key.