summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2010-12-22 20:20:28 +0000
committerGreg Ercolano <erco@seriss.com>2010-12-22 20:20:28 +0000
commite86b65c80ae8f2dd653319ad0fc49ade467f0f04 (patch)
treed54c2ef6f8b706029d75efa33fb54479cf2886fb
parent843e1d8987b8efdcea95042088931aad4c0b3d82 (diff)
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
-rw-r--r--src/Fl_Input.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index d0e897a21..e29721c3c 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -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
}