]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textcmn.cpp
moved OLE files group under MSW files -- this is more logical
[wxWidgets.git] / src / common / textcmn.cpp
index bf4de031f140d7e9302f0c262e06453c4d8ef941..c7bb1f7f46205c6996b57c04693e9a66de67bc54 100644 (file)
@@ -327,13 +327,33 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
             ch = _T('/');
             break;
 
+        case WXK_DELETE:
+        case WXK_NUMPAD_DELETE:
+            // delete the character at cursor
+            {
+                const long pos = GetInsertionPoint(),
+                           last = GetLastPosition();
+                if ( pos < last )
+                    Remove(pos, pos + 1);
+            }
+            break;
+
+        case WXK_BACK:
+            // delete the character before the cursor
+            {
+                const long pos = GetInsertionPoint();
+                if ( pos > 0 )
+                    Remove(pos - 1, pos);
+            }
+            break;
+
         default:
-            if ( keycode < 256 && keycode >= 0 && isprint(keycode) )
+            if ( keycode < 256 && keycode >= 0 && wxIsprint(keycode) )
             {
                 // FIXME this is not going to work for non letters...
                 if ( !event.ShiftDown() )
                 {
-                    keycode = tolower(keycode);
+                    keycode = wxTolower(keycode);
                 }
 
                 ch = (wxChar)keycode;