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
orientationOrientation
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
BipolarCenter
Origin of the bipolar fill (normalized).
public double BipolarCenter { get; set; }
Property Value
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
Handle
Handle shape.
public SliderHandle Handle { get; set; }
Property Value
HandleLength
Handle length along the track in DIPs (0 = automatic).
public float HandleLength { get; set; }
Property Value
IsBipolar
Fills from BipolarCenter instead of the minimum.
public bool IsBipolar { get; set; }
Property Value
JumpToClick
A click on the track moves the handle there before dragging.
public bool JumpToClick { get; set; }
Property Value
LabelWidth
Width of the side label column.
public float LabelWidth { get; set; }
Property Value
Orientation
Direction of travel.
public Orientation Orientation { get; set; }
Property Value
Parser
Text → normalized value parser for typed values (default: parameter parser, or percent).
[Browsable(false)]
public Func<string, double?>? Parser { get; set; }
Property Value
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
SupportsTextEntry
true if this control can open a text box to type its value (see BeginTextEntry()).
protected override bool SupportsTextEntry { get; }
Property Value
TickCount
Draws tick marks along the track (0 = none; discrete values use their step count when −1).
public int TickCount { get; set; }
Property Value
ValueWidth
Width of the side value column.
public float ValueWidth { get; set; }
Property Value
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
Returns
GetTrack(Rect)
Track segment (start = value 0, end = value 1) inside a widget rectangle.
public (Point Start, Point End) GetTrack(Rect widget)
Parameters
widgetRect
Returns
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
styleVectorStylelabelRectwidgetRectvalueRect
OnMouseDown(MouseEventArgs)
Mouse button pressed over the element (or captured).
protected override void OnMouseDown(MouseEventArgs e)
Parameters
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
PointAt(Rect, double)
Point of the track at a normalized value.
public Point PointAt(Rect widget, double normalized)
Parameters
Returns
RenderLabel(DrawingContext, Rect, VectorStyle)
Draws the label.
protected override void RenderLabel(DrawingContext dc, Rect area, VectorStyle style)
Parameters
dcDrawingContextareaRectstyleVectorStyle
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
dcDrawingContextareaRectstyleVectorStyle
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle