#include <vstcontrols.h>
class COnOffButton : public CControl;
Define a button with 2 positions. The pixmap includes the 2 subpixmaps (i.e the rectangle used for the display of this button is half-height of the pixmap). When its value changes, the listener is called.
COnOffButton |
1.0 |
Create an onOffButton with a given size, listener, tag and pixmap.
size |
The enclosing rectangle of the control, relative to the parent frame. |
---|---|
listener |
The object responsible for handling events inn this control. |
tag |
The index of this control. |
bitmap |
A pixmap containing 2 images representing the different states of the button, stacked in height. |
CBitmap myBitmap (kMyBitmapID);
CRect size (
kMyButton_x,
kMyButton_y,
kMyButton_x + myBitmap->getWidth (),
kMyButton_y + myBitmap->getHeight () / 2
);
COnOffButton myButton (
size,
this,
kMyParameter,
myBitmap
);
myButton->setValue (
effect->getParameter (kMyParameter));
frame->addView (myButton);
~COnOffButton |
1.0 |
Destroy an onOffButton object. The pixmap is destroyed if there is no more reference on it.
draw |
1.0 |
Called when this control object needs to be drawn.
mouse |
1.0 |
Called when there is a mouse-click inside this control object.