Table of Contents

Class Slider

Namespace
PluginUI
Assembly
PluginUI.dll

Linear fader, vertical or horizontal. Relative drag (or jump to the click with JumpToClick), Shift = fine, double-click/Ctrl+click resets, Alt+click types a value, wheel and arrow keys step. Bitmap looks: SliderHandleSkin or a FilmStripSkin.

public class Slider : ValueControl
Inheritance
Slider
Inherited Members

Constructors

Slider()

Creates a vertical slider.

public Slider()

Slider(Orientation)

Creates a slider with an orientation.

public Slider(Orientation orientation)

Parameters

orientation Orientation

Properties

AllowTextEntry

Allows typing the value in a text box (default true). The actions that open it are chosen by TextEntryTriggers: by default a double-click on the value text, Alt+click, a right double-click or Enter.

public bool AllowTextEntry { get; set; }

Property Value

bool

BipolarCenter

Origin of the bipolar fill (normalized).

public double BipolarCenter { get; set; }

Property Value

double

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

Handle

Handle shape.

public SliderHandle Handle { get; set; }

Property Value

SliderHandle

HandleLength

Handle length along the track in DIPs (0 = automatic).

public float HandleLength { get; set; }

Property Value

float

IsBipolar

Fills from BipolarCenter instead of the minimum.

public bool IsBipolar { get; set; }

Property Value

bool

JumpToClick

A click on the track moves the handle there before dragging.

public bool JumpToClick { get; set; }

Property Value

bool

LabelWidth

Width of the side label column.

public float LabelWidth { get; set; }

Property Value

float

Orientation

Direction of travel.

public Orientation Orientation { get; set; }

Property Value

Orientation

Parser

Text → normalized value parser for typed values (default: parameter parser, or percent).

[Browsable(false)]
public Func<string, double?>? Parser { get; set; }

Property Value

Func<string, double?>

SideLabels

Label left and value right of the track (horizontal sliders default to true), instead of above/below.

public bool SideLabels { get; set; }

Property Value

bool

SupportsTextEntry

true if this control can open a text box to type its value (see BeginTextEntry()).

protected override bool SupportsTextEntry { get; }

Property Value

bool

TickCount

Draws tick marks along the track (0 = none; discrete values use their step count when −1).

public int TickCount { get; set; }

Property Value

int

ValueWidth

Width of the side value column.

public float ValueWidth { get; set; }

Property Value

float

Methods

BeginTextEntry()

Opens the in-place text box over the value text (or over the slider when the value is hidden).

public override void BeginTextEntry()

GetHandleRect(Rect, Size, double)

Handle rectangle of a given size centered on the value position (used by skins).

public Rect GetHandleRect(Rect widget, Size handleSize, double normalized)

Parameters

widget Rect
handleSize Size
normalized double

Returns

Rect

GetTrack(Rect)

Track segment (start = value 0, end = value 1) inside a widget rectangle.

public (Point Start, Point End) GetTrack(Rect widget)

Parameters

widget Rect

Returns

(Point Start, Point End)

LayoutParts(VectorStyle, out Rect, out Rect, out Rect)

Splits the bounds into label (top), widget and value (bottom) areas according to the style. Override to change the arrangement (e.g. label on the left for sliders).

protected override void LayoutParts(VectorStyle style, out Rect label, out Rect widget, out Rect value)

Parameters

style VectorStyle
label Rect
widget Rect
value Rect

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

PointAt(Rect, double)

Point of the track at a normalized value.

public Point PointAt(Rect widget, double normalized)

Parameters

widget Rect
normalized double

Returns

Point

RenderLabel(DrawingContext, Rect, VectorStyle)

Draws the label.

protected override void RenderLabel(DrawingContext dc, Rect area, VectorStyle style)

Parameters

dc DrawingContext
area Rect
style VectorStyle

RenderValue(DrawingContext, Rect, VectorStyle)

Draws the value text (controls with a value override ValueText).

protected override void RenderValue(DrawingContext dc, Rect area, VectorStyle style)

Parameters

dc DrawingContext
area Rect
style VectorStyle

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