Class Slider | Terminal.Gui v2 (original) (raw)
Namespace
Assembly
Terminal.Gui.dll
Provides a slider control letting the user navigate from a set of typed options in a linear manner using the keyboard or mouse.
public class Slider<T> : View, IDisposable, ISupportInitializeNotification, ISupportInitialize, IOrientation
Type Parameters
T
Inheritance
Slider
Implements
Derived
Inherited Members
Constructors
Initializes a new instance of the Slider class.
Initializes a new instance of the Slider class.
Properties
Allow no selection.
The focused option (has the cursor).
Legends Orientation. Orientation
Gets or sets the minimum number of rows/columns between Options. The default is 1.
Set the slider options.
Gets or sets the Orientation. The default is Horizontal.
Allow range start and end be in the same option, as a single option.
Show/Hide spacing before and after the first and last option.
Show/Hide the options legends.
Slider styles. SliderStyle
Setting the Text of a slider is a shortcut to setting options. The text is a CSV string of the options.
Slider Type. SliderType
Gets or sets whether the minimum or ideal size will be used when calculating the size of the slider.
Methods
Sets or unsets optionIndex
based on set
.
Gets the ideal height of the slider. The ideal height is the minimum height required to display all options and inner spacing.
Gets the ideal width of the slider. The ideal width is the minimum width required to display all options and inner spacing.
Get the indexes of the set options.
Called when the View's content is to be drawn. The default implementation does nothing.
Called when a mouse event occurs within the view's Viewport.
OnOptionFocused(int, SliderEventArgs)
Overridable function that fires the OptionFocused event.
Overridable method called when the slider options have changed. Raises the OptionsChanged event.
OnOrientationChanged(Orientation)
Called when Orientation has been changed.
Positions the cursor in the right position based on the currently focused view in the chain.
Causes the specified option to be set and be focused.
Causes the specified option to be un-set and be focused.
Events
Event raised When the option is hovered with the keys or the mouse.
Event raised when the slider option/s changed. The dictionary contains: key = option index, value = T
Raised when Orientation has changed.
Raised when Orientation is changing. Can be cancelled.