Chapter 21. SliderControl Class

Table of Contents
Pos=
setPos
Pos
InitRange
SetMin
SetMax
Range
ClearTicks
CountTicks
GetTick
SetTickAt
SetTickFrequency
GetLineStep
GetPageStep
SetLineStep
SetPageStep
InitSelRange
SetSelStart
SetSelEnd
ClearSelRange
SelRange

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.

Requires:

The SliderControl class requires the class definition file oodwin32.cls:

::requires "oodwin32.cls"

Methods:

Instances of the SliderControl class implement the methods listed in the SliderControl Instance Methods table.

Table 21-1. SliderControl Instance Methods

Method......on page
ClearSelRangeClearSelRange
ClearTicksClearTicks
CountTicksCountTicks
GetLineStepGetLineStep
GetPageStepGetPageStep
GetTickGetTick
InitRangeInitRange
InitSelRangeInitSelRange
PosPos
Pos=Pos=
RangeRange
SelRangeSelRange
SetLineStepSetLineStep
SetMaxSetMax
SetMinSetMin
SetPageStepSetPageStep
setPossetPos
SetSelEndSetSelEnd
SetSelStartSetSelStart
SetTickAtSetTickAt
SetTickFrequencySetTickFrequency

Pos=

>>-aSliderControl~Pos=--value----------------------------------><


The Pos= method sets the new logical position of the slider and redraws the slider.

Arguments:

The only argument is:

value

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.