COnOffButton

#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

COnOffButton (CRect &size, CControlListener *listener, int tag, CBitmap *bitmap);

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.

[source] source

Example :

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

~COnOffButton ();

Destroy an onOffButton object. The pixmap is destroyed if there is no more reference on it.

[source] source


draw

1.0

void draw (CDrawContext*);

Called when this control object needs to be drawn.

[source] source


mouse

1.0

void mouse (CDrawContext *context, CPoint &where);

Called when there is a mouse-click inside this control object.

[source] source


Copyright ©2003 Steinberg Media Technologies GmbH. All Rights Reserved.