]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textcmn.cpp
linking fix for wxUSE_WCHAR_T=0: always provide wxStrtok() unless HAVE_STRTOK_R is...
[wxWidgets.git] / src / common / textcmn.cpp
index de9a68979c74aa898759beb12d857ce42d514d2f..c7bb1f7f46205c6996b57c04693e9a66de67bc54 100644 (file)
@@ -327,6 +327,26 @@ 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 && wxIsprint(keycode) )
             {