Show / Hide Table of Contents

Class Button

Simple button control with a height of 1.

Inheritance
object
ControlBase
ButtonBase
Button
SelectionButton
Inherited Members
ButtonBase._textAlignment
ButtonBase.OnClick()
ButtonBase.InvokeClick(bool)
ButtonBase.ProcessKeyboard(Keyboard)
ButtonBase.OnMouseIn(ControlBase.ControlMouseState)
ButtonBase.OnLeftMouseClicked(ControlBase.ControlMouseState)
ButtonBase.OnMouseExit(ControlBase.ControlMouseState)
ButtonBase.Text
ButtonBase.AutoSize
ButtonBase.TextAlignment
ButtonBase.Click
ControlBase.MouseState_IsMouseOver
ControlBase.MouseState_EnteredWithButtonDown
ControlBase.MouseState_IsMouseLeftDown
ControlBase.MouseState_IsMouseRightDown
ControlBase.OnUnfocused()
ControlBase.OnFocused()
ControlBase.OnIsDirtyChanged()
ControlBase.ProcessMouse(MouseScreenObjectState)
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.OnMouseEnter(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.dll
Syntax
[DataContract]
public class Button : ButtonBase

Constructors

Button(int, int)

Creates an instance of the button control with the specified width and height.

Declaration
public Button(int width, int height = 1)
Parameters
Type Name Description
int width

Width of the control.

int height

Height of the control (default is 1).

Button(string)

Creates an auto sizing button with the specified text.

Declaration
public Button(string text)
Parameters
Type Name Description
string text

The text to display on the button.

Properties

EndsThemeState

The theme state used with the left end of the button.

Declaration
public ThemeStates EndsThemeState { get; protected set; }
Property Value
Type Description
ThemeStates

LeftEndGlyph

The theme state used with the left end of the button.Defaults to '<'.

Declaration
[DataMember]
public int LeftEndGlyph { get; set; }
Property Value
Type Description
int

RightEndGlyph

The theme state used with the right end of the button. Defaults to '>'.

Declaration
[DataMember]
public int RightEndGlyph { get; set; }
Property Value
Type Description
int

ShowEnds

When true, renders the "end" glyphs on the button.

Declaration
[DataMember]
public bool ShowEnds { get; set; }
Property Value
Type Description
bool

Methods

CreateControlSurface()

Resizes the control surface based on AutoSize or the Width and Height properties.

Declaration
protected override ICellSurface CreateControlSurface()
Returns
Type Description
ICellSurface

The control's surface.

Overrides
ControlBase.CreateControlSurface()

RefreshThemeStateColors(Colors)

Updates the ThemeState by calling RefreshTheme(Colors) with the provided colors. Override this method to adjust how colors are used by the ThemeState.

Declaration
protected override void RefreshThemeStateColors(Colors colors)
Parameters
Type Name Description
Colors colors

The colors to apply to the theme state.

Overrides
ControlBase.RefreshThemeStateColors(Colors)

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)

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX