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
itemsstring[]
Properties
Count
Number of segments.
public int Count { get; }
Property Value
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
Items
Segment texts (null = parameter state labels).
public IReadOnlyList<string>? Items { get; set; }
Property Value
Labels
Segment labels in effect.
public IReadOnlyList<string> Labels { get; }
Property Value
Orientation
Segments laid out horizontally or vertically.
public Orientation Orientation { get; set; }
Property Value
SelectedIndex
Selected segment index.
public int SelectedIndex { get; set; }
Property Value
ValueText
Text drawn in the value area (null = no value area).
public override string? ValueText { get; }
Property Value
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
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
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
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
dcDrawingContextwidgetRectstyleVectorStyle