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
tstringText to display
pPlacementxintyintfCharFormatText format
pfCharFormatSelector 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
tstringText to display
pPlacementxintyintfCharFormatNot selected text format
sfCharFormatSelected text format
pfCharFormatSelector format
Properties
SelectedTextFormat
Selected text charachter format
public CharFormat? SelectedTextFormat { get; set; }
Property Value
SelectorFormat
Format of the selectors that surround the element when selcted
public CharFormat? SelectorFormat { get; set; }
Property Value
Text
Text to show
public string Text { get; set; }
Property Value
TextFormat
Not selected text charachter format
public CharFormat? TextFormat { get; set; }
Property Value
Methods
GenerateBuffer()
The method that generates the element's buffer
protected override Buffer GenerateBuffer()
Returns
SetAction(Action<TuiSelectable, ConsoleKeyInfo>)
Sets the enter action of the button
public TuiButton SetAction(Action<TuiSelectable, ConsoleKeyInfo> a)
Parameters
aAction<TuiSelectable, ConsoleKeyInfo>Action