summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2003-05-27 20:20:20 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2003-05-27 20:20:20 +0000
commit3bad53ae79367a595fa598ed8c38634ec2db215d (patch)
treefca9340a4505e9d473e3f51f86af4254085addaa
parentfdfa3f0add5cd27680008d45d0ac0fc67318a41c (diff)
Fix STR #52 - Fl_Text_Editor didn't set changed() nor did it call callbacks
for composed characters. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3007 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES8
-rw-r--r--fluid/Fl_Widget_Type.cxx8
-rw-r--r--src/Fl_Text_Editor.cxx15
3 files changed, 21 insertions, 10 deletions
diff --git a/CHANGES b/CHANGES
index 8358064c2..9db94f18b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+CHANGES IN FLTK 1.1.4
+
+ - The Fl_Text_Editor widget did not set changed() nor
+ did it call the widget's callback function for
+ FL_WHEN_CHANGED when processing characters that
+ Fl::compose() handles (STR #52)
+
+
CHANGES IN FLTK 1.1.4rc1
- The file chooser did not reset the click count when
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index dfa7a46cc..083e7ad66 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.24 2003/05/18 22:12:19 easysw Exp $"
+// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.25 2003/05/27 20:20:17 easysw Exp $"
//
// Widget type code for the Fast Light Tool Kit (FLTK).
//
@@ -955,8 +955,8 @@ void callback_cb(Fl_Text_Editor* i, void *v) {
if (i->window()) i->window()->make_current();
haderror = 1;
}
- for (Fl_Type *o = Fl_Type::first; o; o = o->next) if (o->selected) {
- o->callback(c);
+ for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
+ if (o->selected) o->callback(c);
}
free(c);
}
@@ -1978,5 +1978,5 @@ int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) {
}
//
-// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.24 2003/05/18 22:12:19 easysw Exp $".
+// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.25 2003/05/27 20:20:17 easysw Exp $".
//
diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx
index 5c1cbb102..095219f91 100644
--- a/src/Fl_Text_Editor.cxx
+++ b/src/Fl_Text_Editor.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Text_Editor.cxx,v 1.9.2.15 2003/04/01 20:14:16 easysw Exp $"
+// "$Id: Fl_Text_Editor.cxx,v 1.9.2.16 2003/05/27 20:20:20 easysw Exp $"
//
// Copyright 2001-2003 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@@ -187,7 +187,8 @@ int Fl_Text_Editor::kf_default(int c, Fl_Text_Editor* e) {
if (e->insert_mode()) e->insert(s);
else e->overstrike(s);
e->show_insert_position();
- if (e->when()&FL_WHEN_CHANGED) e->do_callback(); else e->set_changed();
+ if (e->when()&FL_WHEN_CHANGED) e->do_callback();
+ else e->set_changed();
return 1;
}
@@ -401,8 +402,7 @@ int Fl_Text_Editor::kf_undo(int , Fl_Text_Editor* e) {
}
int Fl_Text_Editor::handle_key() {
-
- // Call fltk's rules to try to turn this into a printing character.
+ // Call FLTK's rules to try to turn this into a printing character.
// This uses the right-hand ctrl key as a "compose prefix" and returns
// the changes that should be made to the text, as a number of
// bytes to delete and a string to insert:
@@ -415,6 +415,8 @@ int Fl_Text_Editor::handle_key() {
else overstrike(Fl::event_text());
}
show_insert_position();
+ if (when()&FL_WHEN_CHANGED) do_callback();
+ else set_changed();
return 1;
}
@@ -423,13 +425,14 @@ int Fl_Text_Editor::handle_key() {
Key_Func f;
f = bound_key_function(key, state, global_key_bindings);
if (!f) f = bound_key_function(key, state, key_bindings);
-
if (f) return f(key, this);
if (default_key_function_ && !state) return default_key_function_(c, this);
return 0;
}
void Fl_Text_Editor::maybe_do_callback() {
+// printf("Fl_Text_Editor::maybe_do_callback()\n");
+// printf("changed()=%d, when()=%x\n", changed(), when());
if (changed() || (when()&FL_WHEN_NOT_CHANGED)) {
clear_changed(); do_callback();}
}
@@ -483,5 +486,5 @@ int Fl_Text_Editor::handle(int event) {
}
//
-// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.15 2003/04/01 20:14:16 easysw Exp $".
+// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.16 2003/05/27 20:20:20 easysw Exp $".
//