Show / Hide Table of Contents

Class ColorBar

A color bar control.

Inheritance
object
ControlBase
ColorBar
Inherited Members
ControlBase.MouseState_IsMouseOver
ControlBase.MouseState_EnteredWithButtonDown
ControlBase.MouseState_IsMouseLeftDown
ControlBase.MouseState_IsMouseRightDown
ControlBase.OnUnfocused()
ControlBase.OnFocused()
ControlBase.OnIsDirtyChanged()
ControlBase.ProcessKeyboard(Keyboard)
ControlBase.LostMouse(MouseScreenObjectState)
ControlBase.OnParentChanged()
ControlBase.OnPositionChanged()
ControlBase.PlaceRelativeTo(ControlBase, Direction.Types, int)
ControlBase.DetermineState()
ControlBase.OnStateChanged(ControlStates, ControlStates)
ControlBase.OnSurfaceChanged(ICellSurface, ICellSurface)
ControlBase.FindThemeFont()
ControlBase.FindThemeColors()
ControlBase.SetThemeColors(Colors)
ControlBase.HasThemeColors()
ControlBase.Resize(int, int)
ControlBase.OnResized()
ControlBase.CreateControlSurface()
ControlBase.RefreshThemeStateColors(Colors)
ControlBase.OnMouseEnter(ControlBase.ControlMouseState)
ControlBase.OnMouseExit(ControlBase.ControlMouseState)
ControlBase.OnLeftMouseClicked(ControlBase.ControlMouseState)
ControlBase.OnRightMouseClicked(ControlBase.ControlMouseState)
ControlBase.ThemeState
ControlBase.UseKeyboard
ControlBase.UseMouse
ControlBase.CanFocus
ControlBase.CanResize
ControlBase.AlternateFont
ControlBase.Surface
ControlBase.MouseArea
ControlBase.IsMouseButtonStateClean
ControlBase.Position
ControlBase.AbsolutePosition
ControlBase.IsVisible
ControlBase.Tag
ControlBase.TabStop
ControlBase.TabIndex
ControlBase.IsDirty
ControlBase.Name
ControlBase.FocusOnMouseClick
ControlBase.Width
ControlBase.Height
ControlBase.IsFocused
ControlBase.IsEnabled
ControlBase.Bounds
ControlBase.Parent
ControlBase.State
ControlBase.IsDirtyChanged
ControlBase.Focused
ControlBase.Unfocused
ControlBase.PositionChanged
ControlBase.MouseEnter
ControlBase.MouseExit
ControlBase.MouseMove
ControlBase.MouseButtonClicked
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
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
ControlBase.OnMouseIn(ControlBase.ControlMouseState)

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
ControlBase.ProcessMouse(MouseScreenObjectState)

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
ControlBase.UpdateAndRedraw(TimeSpan)

Events

ColorChanged

Raised when the SelectedColor value changes.

Declaration
public event EventHandler? ColorChanged
Event Type
Type Description
EventHandler

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX