- See also:
- Class ICustomControl, Class ISpinnerControl.
- Description:
- Important Note: The slider control ensures that it only
displays, and the user is only allowed to input, values within the
specified ranges. However the slider is just a front end to a
controller which actually controls the value. The user can thus
circumvent the slider constraints by editing the controller
directly (via function curves in track view, key info, etc.).
Therefore, when a plug-in gets a value from a controller (or a
parameter block, which may use a controller) it is its
responsibility to clamp the value to a valid range.
Slider Control
'Bracketed' Slider Control
The custom slider control is functionality similar to the custom
spinner control. It supports the following features:
- can link to custom edit box.
- right click reset of value.
if not dragging, resets to default reset value.
if dragging, resets to previous value.
- shift+right click sets an animation key.
- red highlight for animated key positions.
It also supports the following functionality:
- dynamically set tick marks segment the slider track.
- default reset value and last value are visually
indicated.
- left click in slider track moves button to that position.
- ctrl key snaps to nearest tick mark.
Also Note: Developers should use the functions
Get/SetSpinnerPrecision() for controlling precision of edit
boxes linked to slider controls. Those functions affect both
spinners and sliders.
To initialize the pointer to the control call:
ISliderControl *GetISlider(HWND
hCtrl);
To release the control call:
void ReleaseISlider(ISliderControl *isc);
The value to use in the Class field of the Custom Control Properties dialog is:
SliderControl
The following messages may be sent by the slider control:
This message is sent when the value of a slider changes.
CC_SLIDER_CHANGE
lParam contains a pointer to the slider control. You can cast this
pointer to a ISliderControl type and then call
methods of the control.
LOWORD(wParam) contains the ID of the slider. This is the ID
established in the ID field of the Custom Control Properties dialog.
HIWORD(wParam) is TRUE if the user is dragging the slider
interactively.
This message is sent when the user presses down on the
slider.
CC_SLIDER_BUTTONDOWN
lParam contains a pointer to the slider control. You can cast this
pointer to a ISliderControl type and then call
methods of the control.
LOWORD(wParam) contains the ID of the slider. This is the ID
established in the ID field of the Custom Control Properties dialog.
This message is sent when the user releases a slider.
CC_SLIDER_BUTTONUP
lParam contains a pointer to the slider control. You can cast this
pointer to a ISliderControl type and then call
methods of the control.
LOWORD(wParam) contains the ID of the slider. This is the ID
established in the ID field of the Custom Control Properties dialog.
HIWORD(wParam) is FALSE if the user canceled and TRUE
otherwise.