CControl

#include <vstcontrols.h>

class CControl : public CView ;

Each control object (such as COnOffButton ) is derived from this class. This object manages the tag identification and the value of a control object.

Note :

In version 2.1, when an object uses the transparency for its background and draws on it (tranparency area) or the transparency area changes during different draws (CMovieBitmap ,...), the background will be false (not updated), you have to rewrite the draw function in order to redraw the background and then call the draw of the object.

[vst-gui


CControl

1.0

CControl (CRect &size, CControlListener *listener, int tag, CBitmap *pBackground = 0); );

Creates a control with a given rect, listener and tag.

size The enclosing rectangle, in relative to the parent frame.
listener The object responsible for handling events in this control.
tag The index of the control
pBackground An optional background pixmap (only available since vesrion 2.0).

[source] source


~CControl

1.0

virtual ~CControl ();

Destroys a control object.

[source] source


draw

1.0

virtual void draw (CDrawContext *context) ;

Draws the control.


update

1.0

virtual void update (CDrawContext *context);

Calls draw if the value is modified.


doIdleStuff

1.0

virtual void doIdleStuff ();

Calls editor's doIdleStuff.


setValue

1.0

virtual void setValue (float value);

Sets the current value.


getValue

1.0

virtual float getValue ();

Returns the current value.


setMin

1.0

virtual void setMin (float min);

Sets the control's minimal value.


getMin

1.0

virtual float getMin ();

Returns the control's minimal value;


setMax

1.0

virtual void setMax (float value);

Sets the control's maximal value.


getMax

1.0

virtual float getMax ();

Returns the control's maximal value.


setOldValue

1.0

virtual void setOldValue (float ov);

Sets the old value.


getOldValue

1.0

virtual float getOldValue (void);

Returns the old value.


setDefaultValue

1.0

virtual void setDefaultValue (float ov);

Sets the default value.


getDefaultValue

1.0

virtual float getDefaultValue (void);

Returns the default value.


setTag

2.0

virtual void setTag (long tag);

Sets the tag of this control.


getTag

1.0

int getTag ();

Returns the tag of this control. Use to know which control object (i.e. COnOffButton , ...) is concerned by this control.


isDirty

2.0

virtual bool isDirty ();

Returns true if dirty (oldValue != value).

[source] source


setDirty

2.0

virtual void setDirty (const bool val = true);

Sets the control to dirty (the next update will redraw it).

[source] source


setBackground

1.0

virtual void setBackground (CBitmap *background);

Sets the background pixmap.

[source] source


getBackground

2.0

virtual CBitmap *getBackground ();

Returns the background pixmap.


setBackOffset

2.2

virtual void setBackOffset (CPoint &offset);

Used to set the offset of the control's background.


copyBackOffset

2.0

virtual void copyBackOffset ();


setWheelInc

2.1

virtual void setWheelInc (float val);

Every control has a parameter called WheelInc which defines the step at which the control is affected by a mouse move (the control's value is modified by distance-of-the-move * WheelInc). This method lets you set this parameter.


getWheelInc

2.1

virtual float getWheelInc ();

Returns the WheelInc parameter. See above.


bounceValue

2.1

virtual void bounceValue ();

Used to make the control's value stay in the [vmin;vmax] range of the control.


getListener

2.2

CControlListener* getListener ();

Returns the listener for the control.


isDoubleClick

2.2

bool isDoubleClick ();

Checks whether the click is part of a double one.


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