A slider control, which is also called a trackbar, is a window that contains a slider and optional tick marks. When the user moves the slider, using either the mouse or the direction keys, the slider sends notification messages to indicate the change.
Sliders are useful if you want the user to select a specific value or a set of consecutive values within a specific range. For example, you might use a slider to enable the user to set the repeat rate of the keyboard by moving the slider to a given tick mark.
The slider in a trackbar moves in increments that you specify when you create it. For example, if you specify that the trackbar should have a range from 0 to 10, the slider can occupy only eleven positions: a position at the left side of the slider and one position for each increment in the range. Typically, each of these positions is identified by a tick mark.
After you have created a slider, you can use the SliderControl methods to set and retrieve its properties. Refer to PROPDEMO.REX in the OODIALOG\SAMPLES directory for an example.
The SliderControl class sends notification messages to notify about the event. For information about notification messages, refer to ConnectListNotify.
The SliderControl class requires the class definition file oodwin32.cls:
::requires "oodwin32.cls"
Instances of the SliderControl class implement the methods listed in the SliderControl Instance Methods table.
Table 26-1. SliderControl Instance Methods
Method... | ...on page |
---|---|
ClearSelRange | ClearSelRange |
ClearTicks | ClearTicks |
CountTicks | CountTicks |
GetLineStep | GetLineStep |
GetPageStep | GetPageStep |
GetTick | GetTick |
InitRange | InitRange |
InitSelRange | InitSelRange |
Pos | Pos |
Pos= | Pos= |
Range | Range |
SelRange | SelRange |
SetLineStep | SetLineStep |
SetMax | SetMax |
SetMin | SetMin |
SetPageStep | SetPageStep |
SetPos | SetPos |
SetSelEnd | SetSelEnd |
SetSelStart | SetSelStart |
SetTickAt | SetTickAt |
SetTickFrequency | SetTickFrequency |
>>-aSliderControl~Pos=--value----------------------------------><
The Pos= method sets the new logical position of the slider and redraws the slider.
The only argument is:
The new logical position. A valid position is an integer value within the range of the minimum and maximum positions of the slider. If you specify a value outside this range, the position is set to the maximum or minimum position.