SLIDER Gadget
- Last UpdatedNov 07, 2024
- 3 minute read
Members
|
Name |
Type |
Purpose |
|---|---|---|
|
visible |
BOOLEAN |
Visibility. |
|
active |
BOOLEAN |
Active (grayed-in) status. |
|
callback |
STRING |
Callback string. |
|
tag |
STRING |
Tag text - not displayed for this gadget. |
|
val |
REAL |
Current value as integer. |
|
background |
REAL |
Background Color Number. |
|
background |
STRING |
Background Color Name. |
|
range |
REAL ARRAY |
Range Start, End and optional Step(>0) as integers. The start value may be less than the end value. Array size must be 2 or more. |
|
tickstyle |
REAL |
Tick style as integer. 0 ‑ none, 1 ‑ right or bottom, 2 - top or left, 3 ‑ both 1 and 2. |
Note:
-
The Val member represents the current value of the slider as a PML REAL (in fact always an integer).
-
The Range member allows the slider range and optionally the step value to be set or queried. The granularity of the slider movement is determined by the specified step increment, that is, a move event is generated at each step increment within the slider’s range. The range limits must each be an integral multiple of the step size (else an error is flagged).
-
The RESET action of a form (from reset, CANCEL or QUIT actions) will only reset the slider current value not other slider properties. So if you redefine the range while a form is displayed, and press the RESET button, the range will not revert to the previous settings. You will have to do this from reset button’s callback and/or the form’s CANCELCALL callback.
-
Tick marks, if present, occur at every step value in the range.
Methods
|
Name |
Result |
Purpose |
|---|---|---|
|
FullName() |
STRING |
Get the full gadget name, for example, '!!Form.gadget'. |
|
Name() |
STRING |
Get the gadget's name, for example, 'gadget'. |
|
Owner() |
FORM |
Get owning form. |
|
SetToolTip(STRING) |
NO RESULT |
Sets or edits the text of the Tooltip. |
|
Shown() |
BOOLEAN |
Get ‘shown’ status. |
|
Type() |
STRING |
Get the gadget type as a string, like 'SLIDER'. |
|
Refresh() |
NO RESULT |
Refresh gadget image. |
|
Background() |
STRING |
Get Background Color Name. Some gadgets do not support this property in all circumstances, e.g. gadgets which are showing a pixmap. Gadgets whose color has not been set explicitly, may not have a color with a known colorname. In this case, an error is raised. |
|
SetFocus() |
NO RESULT |
Set keyboard focus to gadget. Allows arrow keys to drive slider. |
Command
.-------<-------------------.
/ |
>-- SLIDER gname -+- tagtext -------------------|
+- <fgpos> -------------------|
+- CORE ----------------------| Core managed gadget
+- <fganch> ------------------|
+- BACKGround <colno> --------|
+- CALLback text -------------|
+- TOOLTIP text --------------|
+- VERTical ------------------|
+- HORIZontal ----------------*
|
| .-------<-------------------.
|/ |
+- RANGE int int -------------|
+- STEP int ------------------|
+- VALue int -----------------*
|
‘- <vshap> -+- TOOLTIP text -.
‘----------------‘-->
Figure 2:4. Syntax Graph: Creating a SLIDER Object
Note:
You can specify the range as start, end and optional step and value integer values.
The <vshap> graph allows the specification of the WIDTH and/or HEIGHT for sliders,
in grid units. The width must be specified for a horizontal slider, and the height
must be specified for a vertical slider. If the other dimension is not specified then
a default size will be assumed.
The tag text is not displayed for a slider gadget.