Let the backspace also delete the selection.

Baufo wondered why the backspace doesn't delete the selection, like the
delete key. Not sure why I implemented the current behaviour and tested
with various application, which all delete the selection on the
backspace. So also implemented that behaviour for the new widgets.
This commit is contained in:
Mark de Wever 2009-01-04 10:49:09 +00:00
parent 68bcc66d53
commit c6fb8ef694
2 changed files with 4 additions and 1 deletions

View File

@ -22,6 +22,7 @@ Version 1.5.7+svn:
* Added the sunset feature to the new dialogs.
* Fix the calculate feature in the test scenario.
* Fix an endian issue which rendered text wrong on big endian machines.
* A backspace in a textbox with selection, now clears the selection.
Version 1.5.7:
* Campaigns:

View File

@ -369,7 +369,9 @@ void ttext_::handle_key_backspace(SDLMod /*modifier*/, bool& handled)
DBG_G_E << "Text: key press: backspace.\n";
handled = true;
if(selection_start_){
if(selection_length_ != 0) {
delete_selection();
} else if(selection_start_){
delete_char(true);
}
}