Mercurial > octave-nkf
comparison libgui/graphics/ButtonControl.cc @ 20050: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 |
comparison
equal
deleted
inserted
replaced
20049:ab825e51dc68 | 20050:519eb032ac35 |
---|---|
77 | 77 |
78 if (value.numel () > 0) | 78 if (value.numel () > 0) |
79 { | 79 { |
80 double dValue = value(0); | 80 double dValue = value(0); |
81 | 81 |
82 if (dValue == up.get_min () && btn->isChecked ()) | 82 if (dValue != 0.0 && dValue != 1.0) |
83 warning ("button value not within valid display range"); | |
84 else if (dValue == up.get_min () && btn->isChecked ()) | |
83 btn->setChecked (false); | 85 btn->setChecked (false); |
84 else if (dValue == up.get_max () && ! btn->isChecked ()) | 86 else if (dValue == up.get_max () && ! btn->isChecked ()) |
85 btn->setChecked (true); | 87 btn->setChecked (true); |
86 } | 88 } |
87 } | 89 } |