X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/401eb3dec29c09b9afcc843842cba48b33a5089b..0e878cfcc6486c7903ae89b316bc71700320199d:/src/common/textcmn.cpp diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index de9a68979c..437334ff5d 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -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) ) {