Skip to content

Commit

Permalink
Fix STR #52 - Fl_Text_Editor didn't set changed() nor did it call cal…
Browse files Browse the repository at this point in the history
…lbacks

for composed characters.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3007 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed May 27, 2003
1 parent fdfa3f0 commit 3bad53a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
8 changes: 8 additions & 0 deletions 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
Expand Down
8 changes: 4 additions & 4 deletions 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).
//
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 $".
//
15 changes: 9 additions & 6 deletions 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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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:
Expand All @@ -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;
}

Expand All @@ -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();}
}
Expand Down Expand Up @@ -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 $".
//

0 comments on commit 3bad53a

Please sign in to comment.