Mercurial > hg > octave-nkf
changeset 20225: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 | ab825e51dc68 |
children | 47d420d769ba |
files | libgui/graphics/ButtonControl.cc libgui/graphics/PopupMenuControl.cc |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/graphics/ButtonControl.cc +++ b/libgui/graphics/ButtonControl.cc @@ -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);