diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2007-06-07 21:40:36 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2007-06-07 21:40:36 +0000 |
| commit | dc296ba4c02cc450dfaa7e40dfba0783580ea23d (patch) | |
| tree | 72bc73292504c7f35d10e0f2ea23ea58a56b1178 | |
| parent | 5d7d16cc8c106a2af8dc1985cb5d331c4aa6e62e (diff) | |
Second take at retrieving the correct 'hanged()' value for the Fl_Input_Choice. Fl_Widget::changed() clears our flag where it should not, so we have to some trickery and set a second 'changed' flag that will not be cleared by Fl_Widget::do_callback. I did not see any side effects in doing this, but it is definetley a Kludge.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5891 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/Fl_Input_Choice.H | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H index ce228b780..cf7f8e54c 100644 --- a/FL/Fl_Input_Choice.H +++ b/FL/Fl_Input_Choice.H @@ -68,7 +68,13 @@ class Fl_Input_Choice : public Fl_Group { static void inp_cb(Fl_Widget*, void *data) { Fl_Input_Choice *o=(Fl_Input_Choice *)data; + if (o->inp_->changed()) + o->Fl_Widget::set_changed(); + else + o->Fl_Widget::clear_changed(); o->do_callback(); + if (o->callback() != default_callback) + o->Fl_Widget::clear_changed(); } // Custom resize behavior -- input stretches, menu button doesn't @@ -100,13 +106,15 @@ public: menu_->add(s); } int changed() const { - return inp_->changed(); + return inp_->changed() | Fl_Widget::changed(); } void clear_changed() { - return inp_->clear_changed(); + inp_->clear_changed(); + Fl_Widget::clear_changed(); } void set_changed() { - return inp_->set_changed(); + inp_->set_changed(); + // no need to call Fl_Widget::set_changed() } void clear() { menu_->clear(); |
