Table of Contents

Class SelectorBase

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

The abstract base class for OptionSelector<TEnum> and FlagSelector<TFlagsEnum>.

public abstract class SelectorBase : View, IDisposable, ISupportInitializeNotification, ISupportInitialize, IOrientation
Inheritance
SelectorBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

SelectorBase()

Initializes a new instance of the SelectorBase class.

Properties

AssignHotKeys

If true each label will automatically be assigned a unique hotkey. UsedHotKeys will be used to ensure unique keys are assigned. Set UsedHotKeys before setting Labels with any hotkeys that may conflict with other Views.

DoubleClickAccepts

Gets or sets whether double-clicking on an Item will cause the Accepting event to be raised.

HorizontalSpace

Gets or sets the horizontal space for this OptionSelector if the Orientation is Horizontal

Labels

Gets or sets the list of labels for each value in Values.

Orientation

Gets or sets the Orientation for this SelectorBase. The default is Vertical.

Styles

Gets or sets the styles for the flag selector.

UsedHotKeys

Gets or sets the set of hotkeys that are already used by labels or should not be used when AssignHotKeys is enabled.

This property is used to ensure that automatically assigned hotkeys do not conflict with hotkeys used elsewhere in the application. Set UsedHotKeys before setting Labels if there are hotkeys that may conflict with other views.

Value

Gets or sets the value of the selector. Will be null if no value is set.

Values

Gets or sets the option values. If Values is null, get will return values based on the Labels property.

Methods

CreateCheckBox(string, int)

INTERNAL: Creates a checkbox subview

CreateSubViews()

Creates the subviews for this selector.

OnClearingViewport()

Called when the Viewport is to be cleared.

OnCreatedSubViews()

Called after CreateSubViews() creates the default subviews (Checkboxes and ValueField).

OnCreatingSubViews()

Called before CreateSubViews() creates the default subviews (Checkboxes and ValueField).

OnHandlingHotKey(CommandEventArgs)

Called when the View is handling the user pressing the View's HotKey. Set CommandEventArgs.Handled to true to indicate the event was handled and processing should stop.

OnOrientationChanged(Orientation)

Called when Orientation has changed.

OnSelecting(CommandEventArgs)

Called when the user has performed an action (e.g. Select) causing the View to change state. Set CommandEventArgs.Handled to true and return true to indicate the event was handled and processing should stop.

OnValueChanged(int?, int?)

Called when Value has changed.

RaiseValueChanged(int?)

Raised the ValueChanged event.

SetValuesAndLabels<TEnum>()

Set Values and Labels from an enum type.

UpdateChecked()

Called when the checked state of the checkboxes needs to be updated.

Events

OrientationChanged

Raised when Orientation has changed.

OrientationChanging

Raised when Orientation is changing. Can be cancelled.

ValueChanged

Raised when Value has changed.