Author: matt
Date: 2007-06-07 17:40:36 -0400 (Thu, 07 Jun 2007)
New Revision: 5891
Log:
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.

Modified:
   branches/branch-1.1/FL/Fl_Input_Choice.H

Modified: branches/branch-1.1/FL/Fl_Input_Choice.H
===================================================================
--- branches/branch-1.1/FL/Fl_Input_Choice.H    2007-06-07 17:38:49 UTC (rev 
5890)
+++ branches/branch-1.1/FL/Fl_Input_Choice.H    2007-06-07 21:40:36 UTC (rev 
5891)
@@ -68,7 +68,13 @@
 
   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 @@
     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();

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to