diff libgui/graphics/ButtonControl.cc @ 20015:519eb032ac35

Check value set for PopuMenuControl and ButtonControl * libgui/graphics/ButtonControl.cc (ButtonControl::update) if toggle button, check value is 0 or 1 and warn otherwise * libgui/graphics/PopupMenuControl.cc (PopupMenuControl::update) if value is outside valid index, show warning
author John Donoghue
date Thu, 02 Apr 2015 13:08:56 -0400
parents f0e61a67ad9f
children
line wrap: on
line diff
--- a/libgui/graphics/ButtonControl.cc	Thu Apr 02 17:54:47 2015 +0200
+++ b/libgui/graphics/ButtonControl.cc	Thu Apr 02 13:08:56 2015 -0400
@@ -79,7 +79,9 @@
             {
               double dValue = value(0);
 
-              if (dValue == up.get_min () && btn->isChecked ())
+              if (dValue != 0.0 && dValue != 1.0)
+                warning ("button value not within valid display range");
+              else if (dValue == up.get_min () && btn->isChecked ())
                 btn->setChecked (false);
               else if (dValue == up.get_max () && ! btn->isChecked ())
                 btn->setChecked (true);