made generic EmulateKeyPress() to work with Delete and BackSpace (closes bug 658409)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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) )
|
||||
{
|
||||
|
Reference in New Issue
Block a user