Skip to content

Class Button

A push button. Enter, Space, or a click runs DarkEffekt.Terminal.UI.Button.OnClick.

Declaration
public sealed class Button : Element

Inheritance: System.Object -> DarkEffekt.Terminal.UI.Element

Declaration
public string Text { get; set; }
Declaration
public Action OnClick { get; set; }

True for an element that takes keyboard focus.

Declaration
public override bool Focusable { get; }

The size this element wants, within the room given.

Declaration
protected override CellSize MeasureCore(CellSize available)

DarkEffekt.Terminal.UI.CellSize

Type Name
DarkEffekt.Terminal.UI.CellSize available
Declaration
protected override void RenderCore(CellCanvas canvas)
Type Name
DarkEffekt.Terminal.UI.CellCanvas canvas

A key for this element. Return true when it was used; false passes it to the parent.

Declaration
public override bool OnKey(in TermKeyEvent e)

System.Boolean

Type Name
DarkEffekt.Terminal.TermKeyEvent e

A typed character for this element. Return true when it was used.

Declaration
public override bool OnChar(char c, TermModifiers modifiers)

System.Boolean

Type Name
System.Char c
DarkEffekt.Terminal.TermModifiers modifiers

A pointer event on this element. Return true when it was used.

Declaration
public override bool OnMouse(in TermMouseEvent e)

System.Boolean

Type Name
DarkEffekt.Terminal.TermMouseEvent e