

Hello,
Using w10 and scilab 6.1.0.
In a GUI, a spinner uicontrol with these arguments... "min",0 ,"max",45..."value","22",... "sliderStep", [0.001, 1]...
I have some questions about:
the "sliderStep" second argument "1" seems have no effect. One can use the uicontrol or the kbd arrow, the step is always 0.001 as the first argument.
Concerning the first argument "0.001": it works but if one try "0.0001" or less, there is a strange behaviour. The actual edit field would show only two figures: 22,0001 and 21,9999 (with a step=0.0002). It will never go any further up neither down. We still can edit the GUI uicontrol field to another gross value, the strange behaviour wil remain around the new edited figure.
There is another strange behaviour about the spinner edit field: it does not accept the decimal dot "." instead it is necessary to use the coma ",". If I want to put 21.4, I should write 21,4. If 21.4 was the "value" in the script file, the GUI would show 21,4 anyway.
By the way, if seems to be impossible to show more than five digits after the decimal point in this spinner edit field even with the actual scilab environment: format() answers 1,10 (try to apply format("v",16) has no effect)
Thank you for any help understanding for a newbie.
Scilab


It will be better if you could supplement your question with a small code.


Find the code after my comments. Code not that small but it shows the small problems:
1- Actually to get around the "0.0001" behaviour, I modified the code and use the "max" parameter as big as 1000000 or more and just divide it in my program. But in that case one would like to benefit from the second argument "bigstep".
2- The "," is visible in the spinner field not in the text. It is not possible to edit the spinner with an "." (it takes me some time before I found the "," must be used instead of ".")
function WUIcontrol() hUI = figure( ... "figure_name", "test uicontrol",... "dockable", "off", ... "infobar_visible", "off", ... "toolbar_visible", "off", ... "toolbar", "none", ... "menubar_visible", "on", ... "menubar", "none", ... "default_axes", "off", ... "layout", "gridbag", ... "visible", "on"); hUI.figure_id = 100001; hUI.background = -2; hUI.figure_position = [0 0]; hUI.axes_size = [250 150]; frame_D = uicontrol(hUI, ... "style", "frame", ... "backgroundcolor", [1 1 1], ... "constraints", createConstraints("gridbag", [1, 1, 2, 2], [1, 1], "horizontal", "center",... [0, 0], [120, 50]), "border", createBorder("titled", createBorder("line", "lightGray", 1),... _("Distance D"), "center", "top", createBorderFont("", 11, "normal"), "black"), "layout", "border"); uicontrol(frame_D, ... "style", "spinner", "min", 10,"max", 100 ,... "backgroundcolor", [1 1 1], ... "value", "20", ... "sliderStep", [.001,10],... // <<<<----- replaced by [.0001, 10] shows trouble "callback", "update_D", ... "tag", "D"); frame_xval = uicontrol(hUI, ... "style", "frame", ... "backgroundcolor", [1 1 1], ... "constraints", createConstraints("gridbag", [3, 1, 2, 2], [1, 1], "horizontal", "center",... [0, 0], [120, 50]), "border", createBorder("titled", createBorder("line", "lightGray", 1),... _("xval"), "center", "top", createBorderFont("", 11, "normal"), "black"), "layout", "border"); uicontrol(frame_xval, ... "style", "text", ... "backgroundcolor", [1 1 1], ... "string", "0", ... "tag", "xv"); endfunction function update_D() D = get(gcbo, "value"); hx = get("xv"); hx.string = string(D); endfunction WUIcontrol();


I dont have a solution as of now. Put a disp(D) at the end of your update_D() function to display the value on the Scilab Console for understanding the problem. Scilab in itself will have no problem displaying numbers with 0.00001 precesion. Also, see if making use of "SnapToTicks" property help.
Login to add comment