when setting the background color of a uicontrol with wrong values, a weird erro
Reported by Yann COLLETTE
-- Bug description --
when setting the background color of a uicontrol with wrong values, a weird error message is printed.
The color value must be checked.
-- Scilab error message --
-->set(h_tb, 'backgroundcolor', [10 10 10]);
Attention !!!
Scilab a subi une erreur critique (Unknown exception).
Sauvez vos données et redémarrez Scilab.
Exception when calling Java method : Color parameter outside of expected range: Red Green Blue
at java.awt.Color.testColorValueRange(Color.java:314)
at java.awt.Color.<init>(Color.java:398)
at java.awt.Color.<init>(Color.java:373)
at org.scilab.modules.gui.bridge.CallScilabBridge.setWidgetBackgroundColor(Unknown Source)
Color parameter outside of expected range: Red Green Blue
at java.awt.Color.testColorValueRange(Color.java:314)
at java.awt.Color.<init>(Color.java:398)
at java.awt.Color.<init>(Color.java:373)
at org.scilab.modules.gui.bridge.CallScilabBridge.setWidgetBackgroundColor(Unknown Source)
Attention: problème avec la pile ... nettoyé.
-- How to reproduce the bug --
// create a figure
h = gcf();
width = 100;
height = 50;
step = 60;
///////////////
// TEXT TEST //
///////////////
// create a text box
h_tb = uicontrol(h,'style','text', 'position', [10 2*step width height]);
my_text = "text box";
set(h_tb, 'string', my_text);
set(h_tb,'backgroundcolor',[1 1 1]); // OK, this call works fine.
// color must be between 0 and 1
set(h_tb,'backgroundcolor',[10 10 10]); // This one fails