The Slider (

) is a form object for choosing a numerical input using a slider control. Enter the name of the Slider object in the
Name field.
From the Value type list, choose
Integer or
Real (the default), depending on the type of data in the data source for the slider.
In the Minimum value (default: 0) and
Maximum value (default: 1) fields, enter the minimum and maximum values that define the range of the data covered by the slider.
In the Tooltip field, enter a text that will appear as a tooltip when the user hovers the pointer over the slider.
You can append a unit to the number for the slider’s value by selecting the Append unit to number check box and typing a unit in the associated text field. Units are only applicable to sources that are string declarations and parameters.
In addition, the Settings window contains the following sections:
In this section you define the variable to use as the data source for the slider. The section contains a tree with a filtered view of the trees in the Application Builder and
Model Builder windows. The nodes either represent some sort of data or have children that do. For a Slider, you can use a scalar value from a variable in the model or a variable defined under
Declarations. You can extend the list of available data nodes by clicking the
Switch to Model Builder and Activate Model Data Access button (

) in the
Source section header, which takes you to the Model Builder, and then selecting a node in the
Model Builder branch whose data you want to access. With this button active, the
Settings window of the selected node displays a
Select Data Source check box (a green square) next to the settings that you can include. Click to select the check box to include that data as an available source node for sliders.
When you select a node that represents data, the Use as Source toolbar button (

) below the tree becomes enabled. You can right-click the node and choose
Use as Source. You can also click the
Create button (

) in the
Source section header to create a new variable declaration for the source and use it as the source. A
Create and Use Variable dialog box opens, so that you can select the data type of the source (if applicable), its name, and its initial value. The name cannot be in conflict with any existing variable declaration. Click the
Edit Node toolbar button (

) below the tree to move to the corresponding node. If necessary, the program switches to the Model Builder.
From the Initial value list, select
From data source to use the value specified by the selected data source, or select
Custom value to enter the initial value (starting value) for the slider (default: 0) in the
Value field below. Typically the initial value and the minimum value are the same.
From the Method list, select one of the following methods to specify the unit for the slider:
•
|
Append unit to number. The unit that you type in the Unit expression field is appended to the number corresponding to the slider’s position.
|
•
|
Append unit from unit set. Using this method, the slider appends a unit from a Unit Set node added under Declarations (see The Unit Set Node). You specify the unit set to use from the Unit set list and the unit to use from Unit list, which lists all defined properties and their units from the select unit tests. There is also a No unit option.
|
Under Appearance, you can control the initial state of the slider when users run the application. By default, the slider is visible and enabled. Clear the
Visible or
Enabled check box if you want to make the initial state so that the slider is hidden or unavailable. You can then make it visible or enable it using a method.
•
|
From the Horizontal alignment list, choose Left, Center, Right, or Fill, which automatically expands the form object to fill the cell in the horizontal or vertical direction (where applicable).
|
•
|
From the Vertical alignment list, choose Middle, Top, Bottom, or Fill, which automatically expands the form object to fill the cell in the horizontal or vertical direction (where applicable).
|
The need to specify the alignment is most obvious when working in the grid mode, as it controls how the form object is aligned in its grid cell. Aligning the form object can be useful in the sketch mode too, and you can then use the alignment tools on the Arrange menu in the
Form toolbar’s
Sketch section. When running the application in any client other than the Windows client, the form objects may not be positioned exactly as seen in the form windows. This is because the form objects may have a different size in other clients, giving them a slightly different positioning. Specifying the alignment ensures that the form objects are aligned as you want them to be in all clients.
You can also specify the width of the slider. Enter a width (in points) in the Width field. If you have chosen
Fill from the
Horizontal alignment list, you can instead specify a
Minimum width. Choose
Automatic to compute the minimum width automatically (typically this means a minimum size of 0), or choose
Manual to specify a minimum width in the text field underneath. The
Height field is unavailable because the height of the slider is determined by the software.
Additionally, in the sketch mode, you can specify the form object’s absolute position using the Position x and
Position y fields. In the grid mode, you can position the object in the grid and see the grid position as the
Row,
Column,
Row span, and
Column span values.
Under Cell margin (in grid mode only), you can control the margins around the form object. By default, the margins are taken from the parent form. From the
Cell margin list, choose:
•
|
None, to use no margin around the form object.
|
•
|
Custom, to specify the margins for the form object in the Horizontal and Vertical text fields.
|
For certain types of form objects, you can specify a method to run when an event such as data entry occurs. The On data change list contains
None (the default) and any available methods. To add a local method for an event, click the
Create Local Method button (

) to the right of the
On data change list, or right-click the slider object. The selected method in the
On data change list then changes to
Local method and an empty
onDataChange editor window for the new method opens automatically. To open the local method in a method editor window later, click the
Go to Source button (

). Click the
Remove Local Method button (

) to delete the local method. Methods called from the Slider support a double argument holding the new value of the data source.
•
|
If the On data change list is set to a method, Ctrl+Alt-click opens that method’s editor window.
|
•
|
If the On data change list is set to None, Ctrl+Alt-click creates a local method if needed, sets the list to Local method, and opens the local method’s editor window.
|