Download Sysquake User Manual

Transcript
Sysquake User Manual ©1999-2012, Calerga Sàrl
632
slider
Slider control for interactive manipulation of a scalar.
Syntax
slider(label,
slider(label,
slider(label,
slider(label,
x,
x,
x,
x,
[min,max])
[min,max], scale)
[min,max], scale, style)
[min,max], scale, style, id)
Description
The two main ways to manipulate variables in Sysquake consist in
moving an element of a figure or in entering new values in a dialog
box. The command slider provides an additional mean. It displays a
set of sliders in a subplot, i.e. user-interface objects with a cursor you
can drag to change continuously a scalar value. Like for any other user
manipulation in a subplot, the other subplots are updated continuously
if a mousedrag handler is provided.
You can display one or several sliders in a single subplot, and multiple thumbs (control element) per slider. You can mix them with text
and buttons (commands text and button), but not with other graphics.
The label argument is a string which contains the labels for each
slider, separated by a linefeed character (\n). Its width can be set with
the settabs command. Argument x is the current value of the slider.
It has one row per slider, and one column per thumb per slider. The
rows of the third argument, an array of two columns, contain the minimum and maximum values corresponding to each slider when they
are dragged to the left or right, respectively; it can be a 1-by-2 vector
if the minimum and maximum values are the same for all the sliders.
Argument scale is a string made of characters ’-’ for a linear scale,
and ’l’ or ’L’ for a logarithmic scale; each character corresponds to a
slider. If the string is empty, all sliders are linear; if the string contains
one character, it applies to all sliders.
The style argument has its usual meaning; but only the color is
used. Each color corresponds to a thumb. The corresponding thumbs
of each slider have the same color. The scale argument may be omitted if the style is a structure or a named argument.
Sliders are either read-only if the id argument is missing, or interactive if it is provided. In the mousedown, mousedrag, and mouseup
handlers, each slider is identified by _nb and each thumb by _ix. The
_x, _x0, and _x1 parameters can be used to obtain the value corresponding to the position of the click in the slider, the initial value, and
the current value. Note that contrary to other plot commands where
_x is always defined, _x is non-empty only if the click is made inside a
slider; this is so because the scale can be different for each slider.