Class ToggleButton
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
On/off button (bypass, enable, mode toggles). Toggles on press; the "on" state is drawn with the accent color, or with a glowing LED when ShowLed is set. Text can differ between states.
public class ToggleButton : ValueControl
- Inheritance
-
ToggleButton
- Inherited Members
Constructors
ToggleButton()
Creates a toggle button.
public ToggleButton()
ToggleButton(string)
Creates a toggle button with a caption.
public ToggleButton(string text)
Parameters
textstring
Properties
CurrentText
Caption for the current state.
protected string? CurrentText { get; }
Property Value
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
IsOn
true in the on state.
public bool IsOn { get; set; }
Property Value
OffText
Caption in the off state.
public string? OffText { get; set; }
Property Value
OnColor
LED / on color (null = style accent).
public Color? OnColor { get; set; }
Property Value
OnText
Caption in the on state.
public string? OnText { get; set; }
Property Value
ShowLed
Draws an LED left of the caption instead of filling the button with the accent color.
public bool ShowLed { get; set; }
Property Value
Text
public string? Text { get; set; }
Property Value
TextStyle
Text style (null = theme normal text, centered).
public TextStyle? TextStyle { get; set; }
Property Value
ValueText
Text drawn in the value area (null = no value area).
public override string? ValueText { get; }
Property Value
Methods
OnKeyDown(KeyEventArgs)
Key pressed while focused (bubbles to parents).
protected override void OnKeyDown(KeyEventArgs e)
Parameters
OnMouseDown(MouseEventArgs)
Mouse button pressed over the element (or captured).
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle