Progress
Programming
Handbook


Range and Size

When defining a slider, you must minimally specify the slider’s range. That is, you must specify a minimum and maximum value for the widget. Specify the range using the MIN–VALUE and MAX–VALUE options, each of which takes an integer constant. You can change these values by setting the MIN–VALUE and MAX–VALUE attributes of the slider before the slider is realized. Depending on the windowing system in use, the minimum value, maximum value, or both may be displayed with the slider.

The range you specify for a slider has no effect on the size of the slider. For example, a horizontal slider with range from 0 to 100 has the same default width as a slider with a range for 0 to 10. If a slider has a very wide range, you might want to increase its size so that you can precisely position the marker with the mouse. Also, in a graphical interface, you might consider using the TIC–MARKS option to display short hash marks on the outside of the slider. Used with the FREQUENCY option, TIC–MARKS help reference specific increments for these hash marks along the trackbar to provide a more precise indication of the value selected on your slider.

In a character interface, a horizontal slider is only 6 positions wide by default and a vertical slider slider is only 3 positions high. If you want the marker to accurately reflect the current value for a slider with a large range, you must make the slider bigger.

You can set the size of a slider by using the SIZE–CHARS or SIZE–PIXELS option of the VIEW–AS phrase. Each of these options take a width and height value. You can also adjust the size by setting the HEIGHT–CHARS and WIDTH–CHARS or HEIGHT–PIXELS and WIDTH–PIXELS attributes.

NOTE: In a character interface, specify a SIZE that is a multiple of the range
(MAX–VALUE – MIN–VALUE) to ensure that the marker moves in even increments.

When adjusting the size of a slider you are most concerned with the width for a horizontal slider and the height for a vertical slider. However, you should be careful about changing the other dimension. For example, if you make the height of a horizontal slider too small, the value displayed with the slider may be partially obscured.


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