Table of Contents

Class CheckBox

Namespace
PluginUI
Assembly
PluginUI.dll

Check box with a caption on the right. Clicking the box or the caption toggles the value.

public class CheckBox : ValueControl
Inheritance
CheckBox
Inherited Members

Constructors

CheckBox()

Creates a check box.

public CheckBox()

CheckBox(string, bool)

Creates a check box with a caption.

public CheckBox(string text, bool isChecked = false)

Parameters

text string
isChecked bool

Properties

BoxSize

Box size in DIPs.

public float BoxSize { get; set; }

Property Value

float

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

IsChecked

true when checked.

public bool IsChecked { get; set; }

Property Value

bool

Text

Caption (null = Label or the parameter name).

public string? Text { get; set; }

Property Value

string

ValueText

Text drawn in the value area (null = no value area).

public override string? ValueText { get; }

Property Value

string

Methods

LayoutParts(VectorStyle, out Rect, out Rect, out Rect)

Splits the bounds into label (top), widget and value (bottom) areas according to the style. Override to change the arrangement (e.g. label on the left for sliders).

protected override void LayoutParts(VectorStyle style, out Rect label, out Rect widget, out Rect value)

Parameters

style VectorStyle
label Rect
widget Rect
value Rect

OnAttached()

Called when the element joins a host (subscribe to external events here).

protected override void OnAttached()

OnKeyDown(KeyEventArgs)

Key pressed while focused (bubbles to parents).

protected override void OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

OnMouseDown(MouseEventArgs)

Mouse button pressed over the element (or captured).

protected override void OnMouseDown(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseUp(MouseEventArgs)

Mouse button released.

protected override void OnMouseUp(MouseEventArgs e)

Parameters

e MouseEventArgs

OnRenderOverlay(DrawingContext)

Draws the keyboard focus ring.

protected override void OnRenderOverlay(DrawingContext dc)

Parameters

dc DrawingContext

Remarks

Adds the modulation drop highlight and the MIDI learn outline.

OnValueChanged()

Called after every value change; raises ValueChanged and repaints.

protected override void OnValueChanged()

RenderVector(DrawingContext, Rect, VectorStyle)

Vector rendering of the widget area.

protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)

Parameters

dc DrawingContext
widget Rect
style VectorStyle