Table of Contents

Class SegmentedControl

Namespace
PluginUI
Assembly
PluginUI.dll

Row (or column) of mutually exclusive segments — radio buttons / tab switch in one shape. The selection highlight slides between segments. Segment texts come from Items or the parameter's state labels.

public class SegmentedControl : ValueControl
Inheritance
SegmentedControl
Inherited Members

Constructors

SegmentedControl()

Creates a segmented control.

public SegmentedControl()

SegmentedControl(params string[])

Creates a segmented control with local items.

public SegmentedControl(params string[] items)

Parameters

items string[]

Properties

Count

Number of segments.

public int Count { get; }

Property Value

int

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

Items

Segment texts (null = parameter state labels).

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

Property Value

IReadOnlyList<string>

Labels

Segment labels in effect.

public IReadOnlyList<string> Labels { get; }

Property Value

IReadOnlyList<string>

Orientation

Segments laid out horizontally or vertically.

public Orientation Orientation { get; set; }

Property Value

Orientation

SelectedIndex

Selected segment index.

public int SelectedIndex { get; set; }

Property Value

int

ValueText

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

public override string? ValueText { get; }

Property Value

string

Methods

OnAttached()

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

protected override void OnAttached()

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

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