Progress
Language Tutorial
for Character


Working with Sliders

A slider is a graphical representation of a numeric range. It is composed of a rectangular area that contains a trackbar and a pointer. You can change the current value within a defined range by moving the pointer that resides on the trackbar. You can also choose to define tic marks for a slider. Tic marks are short hash marks that can be displayed on the outside of the trackbar to help define the movement of the pointer in the trackbar.

Figure 7–6 shows the parts of a slider.

Figure 7–6: Parts of a Slider

The slider shows the current value and the range of acceptable values for an INTEGER field or variable. This is the VIEW-AS syntax for defining a slider widget.

SYNTAX
VIEW-AS SLIDER
  MAX-VALUE max-value MIN-VALUE min-value
  [ HORIZONAL | VERTICAL ]
  [ NO-CURRENT-VALUE ]
  [ LARGE-TO-SMALL ]
  [ TIC-MARKS
    { NONE | TOP | BOTTOM | LEFT | RIGHT | BOTH }
     [ FREQUENCY n ]
  ]
  [ size-phrase ]
  [ TOOLTIP tooltip ] 

NOTE: A slider works best with a mouse. If your environment does not support the mouse, your users may prefer another data widget.

Table 7–6 explains the elements of the slider syntax.

Table 7–6: Slider Syntax
Element
Description
MAX-VALUE
Specify the MAX-VALUE keyword and an integer constant to set the upper limit of the slider’s range.
Consider using the MAX-VALUE option with the LARGE-TO-SMALL option to indicate that the slider’s maximum value displays first.
MIN-VALUE
Specify the MIN-VALUE keyword and an integer constant to set the lower limit of the slider’s range. You can use the MAX-VALUE and MIN-VALUE options with the LARGE-TO-SMALL option to indicate that the slider’s maximum value displays first and that the minimum value displays last as the pointer moves along the slider’s trackbar.
HORIZONTAL
VERTICAL
Sliders have horizontal orientation by default. The keyword VERTICAL defines a slider with vertical orientation.
If the orientation is VERTICAL, the slider displays with the minimum value at the bottom and the maximum value at the top. The user can change this value by moving the pointer in the trackbar up or down. If the orientation is HORIZONTAL, the slider displays with the minimum value at the left and the maximum value at the right. The user can change the value by moving the pointer in the trackbar left or right.
NO-CURRENT-
VALUE
The default is to display the current value for a given position on the slider ’s trackbar. The NO-CURRENT-VALUE option allows you to override this default behavior to indicate that the slider will not automatically display its current value.
LARGE-TO-
SMALL
The default numeric range that a slider displays is small (minimum) to large (maximum). The LARGE-TO-SMALL option allows you to override this default behavior as follows:
When the slider is positioned horizontally, the left most position on the trackbar displays the maximum value and the right most position displays the minimum value.
When the slider is positioned vertically, the bottom most position on the trackbar displays the maximum value and the top most position displays the minimum value.
TIC-MARKS
Enables short hash marks to display on the outside of the trackbar to help define the movement of the pointer in the trackbar. The default is not to display tic marks. However, if you want to define tic marks, you must also specify on which side, or sides, of the trackbar you want tic marks to display by using the additional TOP, BOTTOM, LEFT, RIGHT, or BOTH qualifying options.
FREQUENCY
This option is used only with the TIC-MARKS option to indicate how often tic marks will display. For example, if you indicate a frequency of 5, a tic mark displays in every fifth position along the track bar.
size-phrase
The size phrase has a few different syntaxes. The tutorial uses the most portable syntax:
SIZE-CHARS width BY height
where width and height are integer constants.
If the slider has horizontal orientation, the height has to accommodate the trackbar, pointer, and labels. For character interfaces, the width should be a multiple or factor of the range to ensure that the pointer moves in even increments.
If the slider has vertical orientation, the width has to accommodate the label. The height should be a multiple or factor of the range to ensure that the pointer moves in even increments.
TOOLTIP tooltip
You can optionally define a text message string that automatically displays when the mouse pointer pauses over the slider.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095