]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textcmn.cpp
Applied patch [ 709618 ] fixes drawing position in wxPrinterDC::DoBlit()
[wxWidgets.git] / src / common / textcmn.cpp
index de9a68979c74aa898759beb12d857ce42d514d2f..0e194c6ba3c6bf38b431aaee5aaedae22a20078e 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     13.07.99
 // RCS-ID:      $Id$
 // Copyright:   (c) wxWindows team
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -173,7 +173,7 @@ bool wxTextCtrlBase::SaveFile(const wxString& filename)
     }
 
 #if wxUSE_FFILE
-    wxFFile file(filename, "w");
+    wxFFile file(filename, _T("w"));
     if ( file.IsOpened() && file.Write(GetValue()) )
     {
         // it's not modified any longer
@@ -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) )
             {