Table of Contents

Class TuiButton

Namespace
AshConsoleGraphics.Interactive
Assembly
AshConsoleGraphics.dll

A label pressable with enter

public class TuiButton : TuiSelectable
Inheritance
TuiButton
Inherited Members

Constructors

TuiButton(string, Placement, int, int, CharFormat?, CharFormat?)

Initializes a new button with the same text color when selected and when not

public TuiButton(string t, Placement p, int x, int y, CharFormat? f = null, CharFormat? pf = null)

Parameters

t string

Text to display

p Placement
x int
y int
f CharFormat

Text format

pf CharFormat

Selector format

TuiButton(string, Placement, int, int, CharFormat?, CharFormat?, CharFormat?)

Initializes a new button with all colors

public TuiButton(string t, Placement p, int x, int y, CharFormat? f, CharFormat? sf, CharFormat? pf)

Parameters

t string

Text to display

p Placement
x int
y int
f CharFormat

Not selected text format

sf CharFormat

Selected text format

pf CharFormat

Selector format

Properties

SelectedTextFormat

Selected text charachter format

public CharFormat? SelectedTextFormat { get; set; }

Property Value

CharFormat

SelectorFormat

Format of the selectors that surround the element when selcted

public CharFormat? SelectorFormat { get; set; }

Property Value

CharFormat

Text

Text to show

public string Text { get; set; }

Property Value

string

TextFormat

Not selected text charachter format

public CharFormat? TextFormat { get; set; }

Property Value

CharFormat

Methods

GenerateBuffer()

The method that generates the element's buffer

protected override Buffer GenerateBuffer()

Returns

Buffer

SetAction(Action<TuiSelectable, ConsoleKeyInfo>)

Sets the enter action of the button

public TuiButton SetAction(Action<TuiSelectable, ConsoleKeyInfo> a)

Parameters

a Action<TuiSelectable, ConsoleKeyInfo>

Action

Returns

TuiButton