Class ColorBar
A color bar control.
Inherited Members
Namespace: SadConsole.UI.Controls
Assembly: SadConsole.Extended.dll
Syntax
public class ColorBar : ControlBase
Constructors
ColorBar(int)
Creates a new color bar with the specified width.
Declaration
public ColorBar(int width)
Parameters
Type | Name | Description |
---|---|---|
int | width | The width of the bar. |
Fields
_colorSteps
Internal use by theme.
Declaration
public Color[] _colorSteps
Field Value
Type | Description |
---|---|
Color[] |
_positions
Internal use by theme.
Declaration
public int _positions
Field Value
Type | Description |
---|---|
int |
Properties
EndingColor
Gets or sets the color on the right-side of the bar.
Declaration
public Color EndingColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
SelectedColor
The selected color.
Declaration
public Color SelectedColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
SelectedPosition
The position on the bar currently selected.
Declaration
public int SelectedPosition { get; }
Property Value
Type | Description |
---|---|
int |
StartingColor
Gets or sets the color on the left-side of the bar.
Declaration
public Color StartingColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Methods
OnMouseIn(ControlMouseState)
Called as the mouse moves around the control area. Raises the MouseMove event and calls the DetermineState() method.
Declaration
protected override void OnMouseIn(ControlBase.ControlMouseState info)
Parameters
Type | Name | Description |
---|---|---|
ControlBase.ControlMouseState | info |
Overrides
ProcessMouse(MouseScreenObjectState)
Checks if the mouse is the control and calls the appropriate mouse methods.
Declaration
public override bool ProcessMouse(MouseScreenObjectState info)
Parameters
Type | Name | Description |
---|---|---|
MouseScreenObjectState | info |
Returns
Type | Description |
---|---|
bool | True when the control is enabled, set to use the mouse and the mouse is over it, otherwise false. |
Overrides
UpdateAndRedraw(TimeSpan)
Redraws the control if applicable.
Declaration
public override void UpdateAndRedraw(TimeSpan time)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | time | The duration of thecurrent frame. |
Overrides
Events
ColorChanged
Raised when the SelectedColor value changes.
Declaration
public event EventHandler? ColorChanged
Event Type
Type | Description |
---|---|
EventHandler |