Skip to content

Class ListView

A scrolling list with one selected row. The arrows, Page Up, Page Down, Home, End, the wheel, and a click move the selection; Enter or a second click on the selected row runs DarkEffekt.Terminal.UI.ListView.OnActivate.

Declaration
public sealed class ListView : Element

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

Declaration
public List<string> Items { get; }

When the bar at the right edge shows. Auto shows it while the items overflow the rows.

Declaration
public ScrollBarMode ScrollBar { get; set; }

The bar’s glyphs. Null takes the interface’s DarkEffekt.Terminal.UI.TerminalUI.ScrollBarStyle.

Declaration
public ScrollBarStyle ScrollBarStyle { get; set; }
Declaration
public override int ChildCount { get; }
Declaration
public int SelectedIndex { get; set; }
Declaration
public string SelectedItem { get; }
Declaration
public Action<int> OnSelected { get; set; }
Declaration
public Action<int> OnActivate { get; set; }

True for an element that takes keyboard focus.

Declaration
public override bool Focusable { get; }
Declaration
public override Element GetChild(int index)

DarkEffekt.Terminal.UI.Element

Type Name
System.Int32 index

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

Places the children inside this element’s rectangle.

Declaration
protected override void ArrangeCore(CellRect rect)
Type Name
DarkEffekt.Terminal.UI.CellRect rect
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 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