# HG changeset patch # User John Donoghue # Date 1427994536 14400 # Node ID 519eb032ac35e433c6415827715bbf40e34d84f7 # Parent ab825e51dc687f886110ff83b770a95751318c0a 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 diff -r ab825e51dc68 -r 519eb032ac35 libgui/graphics/ButtonControl.cc --- 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); diff -r ab825e51dc68 -r 519eb032ac35 libgui/graphics/PopupMenuControl.cc --- a/libgui/graphics/PopupMenuControl.cc Thu Apr 02 17:54:47 2015 +0200 +++ b/libgui/graphics/PopupMenuControl.cc Thu Apr 02 13:08:56 2015 -0400 @@ -112,6 +112,8 @@ { box->setCurrentIndex (newIndex); } + else + warning ("popupmenu value not within valid display range"); } } m_blockUpdate = false;