#include <vstcontrols.h>
class CSlider : public CControl;
Define a slider with a given background and handle. The range of variation of the handle should be defined. By default the handler is drawn with transparency (white color). By clicking Alt+Left Mouse the default value is used.
CSlider
|
2.2 |
Creates a slider object.
size |
The coordinates of the enclosing rectangle, relative to the parent frame. |
---|---|
listener |
The object responsible for handling events in this control. for this control. |
tag |
The index of the control. |
iMinPos |
The minimal position of the slider, in pixel relative to the parent frame. |
iMaxPos |
The maximal position of the slider, in pixel relative to the parent frame. |
handle |
The pixmap of the slider |
bk |
The pixmap of the background. |
offset |
The top-left point of the displayed area of the background, relative to the control. |
style |
Used to define the orientation and the zero position of the slider. For example
kLeft|kHorizontal defines an horizontal slider, with the 0 on the
left. See CControlEnum. |
myFaderBodyPixmap
= new CBitmap (kFaderBodyPixmapID);
myFaderHandlePixmap
= new CBitmap (kFaderHandlePixmapID);
size (
kMyFader_left,
kMyFader_top,
kMyFader_left + myFaderBodyPixmap->getWidth (),
kMyFader_top + myFaderBodyPixmap->getHeight ()
);
int minPos = kMyFader_top;
int maxPos = kMyFader_top
+ myFaderBodyPixmap->getHeight ()
- myFaderHandlePixmap->getHeight () - 1;
CPoint offset (0, 0);
myFader = new CSlider (
size,
this,
kMyParameter,
minPos,
maxPos,
myFaderHandlePixmap,
myFaderBodyPixmap,
offset,
kVertical | kBottom
);
myFader->setOffsetHandle (offset);
myFader->setValue (effect->getParameter (kMyParameter));
frame->addView (myFader);
CSlider
|
2.2 |
Creates a slider object.
size |
The coordinates of the enclosing rectangle, relative to the parent frame. |
---|---|
listener |
The object responsible for handling events in this control. for this control. |
tag |
The index of the control. |
offsetHandle |
The offset of the handle. |
rangeHandle |
The size of the handle range. |
handle |
The pixmap of the slider |
bk |
The pixmap of the background. |
offset |
The top-left point of the displayed area of the background, relative to the control. |
style |
Used to define the orientation and the zero position of the slider. For example
kLeft|kHorizontal defines an horizontal slider, with the 0 on the
left. See
CControlEnum. |
~CSlider |
2.2 |
Destroys a Slider object. The bitmaps are destroyed if there is no more reference on it.
attached |
2.2 |
Creates a COffscreenContext for the slider.
removed |
2.2 |
Removes the COffscreenContext created for the slider.
draw |
2.2 |
Called when this control object needs to be drawn.
mouse |
2.2 |
Called when there is a mouse-click inside this control object.
CControlListener
's valueChanged
method which is called when the value has changed.
onWheel |
2.2 |
onKeyDown |
2.2 |
setDrawTransparentHandle |
2.2 |
Allows to specify if the handle must be drawn with or without transparency.
setFreeClick |
2.2 |
With true
the current position is set at click position (default
behaviour), else you have to drag the handle.
getFreeClick |
2.2 |
Returns the current status of the handle mode.
setOffsetHandle |
2.2 |
Allows to specify the offset of the handle in the slider background.
setHandle |
2.2 |
Sets the handle pixmap.
getHandle |
2.2 |
Returns the handle pixmap.
setZoomFactor |
2.2 |
Sets the zoom factor for the shift mode (slower move).
getZoomFactor |
2.2 |
Returns the zoom factor.