]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.cpp.in
include wxWindows headers using "..." instead of <...>
[wxWidgets.git] / src / stc / stc.cpp.in
index 65c88c28fb6fde30becf30b9d432ccaa753a24a0..e4c51365a96defc6c8e5916266c4132bf4d634aa 100644 (file)
@@ -137,6 +137,7 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent,
 {
     m_swx = new ScintillaWX(this);
     m_stopWatch.Start();
+    m_lastKeyDownConsumed = FALSE;
 }
 
 
@@ -379,42 +380,39 @@ void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
 
 void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
     long key = evt.KeyCode();
-    if ((key > WXK_ESCAPE) &&
-        (key != WXK_DELETE) && (key < 255) &&
-        !evt.ControlDown() && !evt.AltDown()) {
-
+    if (key <= 0xff && !iscntrl(key) && !m_lastKeyDownConsumed) {
         m_swx->DoAddChar(key);
     }
-    else {
-        evt.Skip();
-    }
 }
 
+
 void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) {
     long key = evt.KeyCode();
-    //key = toupper(key);  //**** ????
-    bool consumed = FALSE;
     int processed = m_swx->DoKeyDown(key,
                                      evt.ShiftDown(),
                                      evt.ControlDown(),
                                      evt.AltDown(),
-                                     &consumed);
-    if (!processed && !consumed)
+                                     &m_lastKeyDownConsumed);
+    if (!processed && !m_lastKeyDownConsumed)
         evt.Skip();
 }
 
+
 void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
     m_swx->DoLoseFocus();
 }
 
+
 void wxStyledTextCtrl::OnGainFocus(wxFocusEvent& evt) {
     m_swx->DoGainFocus();
 }
 
+
 void wxStyledTextCtrl::OnSysColourChanged(wxSysColourChangedEvent& evt) {
     m_swx->DoSysColourChange();
 }
 
+
 void wxStyledTextCtrl::OnEraseBackground(wxEraseEvent& evt) {
     // do nothing to help avoid flashing
 }