Table of Contents

Class MultiToggle

Namespace
PluginUI
Assembly
PluginUI.dll

Row or grid of on/off cells, each bound to its own parameter (or to a local state array): step-sequencer gate rows, channel enables, harmonic switches. Press a cell to flip it and drag across the others to paint the same state. PlayPosition highlights the current step.

public class MultiToggle : Control
Inheritance
MultiToggle
Inherited Members

Constructors

MultiToggle(IReadOnlyList<IParameter>)

Creates a multi-toggle bound to parameters (one cell per parameter).

public MultiToggle(IReadOnlyList<IParameter> parameters)

Parameters

parameters IReadOnlyList<IParameter>

MultiToggle(int)

Creates a multi-toggle with count local cells.

public MultiToggle(int count = 16)

Parameters

count int

Properties

CellSpacing

Space between cells in DIPs.

public float CellSpacing { get; set; }

Property Value

float

Columns

Columns per row (0 = single row).

public int Columns { get; set; }

Property Value

int

Count

Number of cells.

public int Count { get; set; }

Property Value

int

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

GroupSize

Highlights every n-th column more strongly (beats in a 16-step row). 0 = off.

public int GroupSize { get; set; }

Property Value

int

this[int]

State of a cell.

public bool this[int index] { get; set; }

Parameters

index int

Property Value

bool

Parameters

Bound parameters (null = local states).

[Browsable(false)]
public IReadOnlyList<IParameter>? Parameters { get; set; }

Property Value

IReadOnlyList<IParameter>

PlayPosition

Index of the playing step (−1 = none).

public int PlayPosition { get; set; }

Property Value

int

Methods

OnAttached()

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

protected override void OnAttached()

OnCaptureLost()

The mouse capture was lost without a button release.

protected override void OnCaptureLost()

OnDetached()

Called when the element leaves its host (unsubscribe here).

protected override void OnDetached()

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

OnMouseLeave()

The mouse left the element.

protected override void OnMouseLeave()

OnMouseMove(MouseEventArgs)

Mouse moved over the element (or captured).

protected override void OnMouseMove(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseUp(MouseEventArgs)

Mouse button released.

protected override void OnMouseUp(MouseEventArgs e)

Parameters

e MouseEventArgs

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

Events

CellChanged

Raised when the user changes a cell.

public event Action<MultiToggle, int, bool>? CellChanged

Event Type

Action<MultiToggle, int, bool>