From dc296ba4c02cc450dfaa7e40dfba0783580ea23d Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 7 Jun 2007 21:40:36 +0000 Subject: 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 --- FL/Fl_Input_Choice.H | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'FL') 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(); -- cgit v1.2.3