Browse Source

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
pull/49/head
Greg Ercolano 15 years ago
parent
commit
e86b65c80a
  1. 3
      src/Fl_Input.cxx

3
src/Fl_Input.cxx

@ -138,6 +138,7 @@ int Fl_Input::kf_page_down() { @@ -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() { @@ -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() { @@ -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
}

Loading…
Cancel
Save