Table of Contents

Class Switch

Namespace
PluginUI
Assembly
PluginUI.dll

N-position selector switch (waveform, range, mode). Vector look: a slotted track with a lever and position labels; bitmap look: a film-strip skin (new FilmStripSkin(strip, useStateIndex: true)).

public class Switch : ValueControl
Inheritance
Switch
Inherited Members

Constructors

Switch()

Creates a switch (3 positions unless bound or given items).

public Switch()

Switch(params string[])

Creates a switch with local position labels.

public Switch(params string[] items)

Parameters

items string[]

Properties

ClickMode

Click behavior.

public SwitchClickMode ClickMode { get; set; }

Property Value

SwitchClickMode

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

Items

Position labels (null = parameter state labels).

public IReadOnlyList<string>? Items { get; set; }

Property Value

IReadOnlyList<string>

Orientation

Track direction.

public Orientation Orientation { get; set; }

Property Value

Orientation

PositionCount

Number of positions.

public int PositionCount { get; }

Property Value

int

SelectedIndex

Selected position.

public int SelectedIndex { get; set; }

Property Value

int

ShowPositionLabels

Draws the position labels next to the track.

public bool ShowPositionLabels { get; set; }

Property Value

bool

ValueText

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

public override string? ValueText { get; }

Property Value

string

Methods

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

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