Author: matt
Date: 2007-06-07 13:38:49 -0400 (Thu, 07 Jun 2007)
New Revision: 5890
Log:
Making sure that the 'changed' flag is set on every menu pulldown. (STR #1693)

Modified:
   branches/branch-1.1/FL/Fl_Input_Choice.H
   branches/branch-1.1/test/input_choice.cxx

Modified: branches/branch-1.1/FL/Fl_Input_Choice.H
===================================================================
--- branches/branch-1.1/FL/Fl_Input_Choice.H    2007-06-07 17:28:43 UTC (rev 
5889)
+++ branches/branch-1.1/FL/Fl_Input_Choice.H    2007-06-07 17:38:49 UTC (rev 
5890)
@@ -62,6 +62,7 @@
     const Fl_Menu_Item *item = o->menubutton()->mvalue();
     if ( item && item->flags & (FL_SUBMENU|FL_SUBMENU_POINTER) ) return;       
// ignore submenus
     o->inp_->value(o->menu_->text());
+    o->inp_->set_changed();
     o->do_callback();
   }
 
@@ -101,6 +102,12 @@
   int changed() const { 
     return inp_->changed();
   }
+  void clear_changed() { 
+    return inp_->clear_changed();
+  }
+  void set_changed() { 
+    return inp_->set_changed();
+  }
   void clear() {
     menu_->clear();
   }

Modified: branches/branch-1.1/test/input_choice.cxx
===================================================================
--- branches/branch-1.1/test/input_choice.cxx   2007-06-07 17:28:43 UTC (rev 
5889)
+++ branches/branch-1.1/test/input_choice.cxx   2007-06-07 17:38:49 UTC (rev 
5890)
@@ -32,6 +32,10 @@
     flag ^= 1;
     if ( flag ) in->activate();
     else        in->deactivate();
+    if (in->changed()) {
+        printf("Callback: changed() is set\n");
+        in->clear_changed();
+    }
 }
 
 void input_choice_cb(Fl_Widget*,void*data) {

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

Reply via email to