Fixes to ensure readonly() widget is not modified by destructive keyboard functions.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8106 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Greg Ercolano 2010-12-22 20:20:28 +00:00
parent 843e1d8987
commit e86b65c80a

View File

@ -138,6 +138,7 @@ int Fl_Input::kf_page_down() {
// Toggle insert mode
int Fl_Input::kf_insert_toggle() {
if (readonly()) { fl_beep(); return 1; }
return 1; // \todo: needs insert mode
}
@ -159,6 +160,7 @@ int Fl_Input::kf_delete_word_left() {
// Delete to start of line
int Fl_Input::kf_delete_sol() {
if (readonly()) { fl_beep(); return 1; }
if (mark() != position()) return cut();
cut(line_start(position()), position());
return 1;
@ -275,6 +277,7 @@ int Fl_Input::kf_undo() {
// Redo. (currently unimplemented.. toggles undo() instead)
int Fl_Input::kf_redo() {
if (readonly()) { fl_beep(); return 1; }
return kf_undo(); // currently we don't support multilevel undo
}