Skip to content

Class ScrollView

A viewport over one child larger than the room, with a bar along each side that scrolls. The content extends down by default; set DarkEffekt.Terminal.UI.ScrollView.Horizontal for content wider than the view. The wheel, the arrows, Page Up, Page Down, Home, and End scroll, and a change of focus brings the focused element into view. A view that cannot move any further leaves the wheel or the key to the view around it.

The view itself takes focus only when nothing inside it can, so a pane of text is reachable from the keyboard and a pane of controls adds no stop of its own.

Declaration
public sealed class ScrollView : Element

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

Declaration
public Element Child { get; set; }

True when the content may extend past the right edge. Off, the child takes the view’s width.

Declaration
public bool Horizontal { get; set; }

True when the content may extend past the bottom edge. Off, the child takes the view’s height.

Declaration
public bool Vertical { get; set; }
Declaration
public ScrollBarMode VerticalBar { get; set; }
Declaration
public ScrollBarMode HorizontalBar { get; set; }

The content cell at the view’s left edge.

Declaration
public int OffsetX { get; set; }

The content cell at the view’s top edge.

Declaration
public int OffsetY { get; set; }

The cells one wheel notch moves.

Declaration
public int WheelStep { get; set; }

The glyphs of this view’s bars. Null takes the interface’s DarkEffekt.Terminal.UI.TerminalUI.ScrollBarStyle.

Declaration
public ScrollBarStyle ScrollBarStyle { get; set; }

The child’s size at the last layout.

Declaration
public CellSize ContentSize { get; }

The cells the content shows through at the last layout, inside the bars.

Declaration
public CellSize ViewportSize { get; }

True for an element that takes keyboard focus.

Declaration
public override bool Focusable { get; }
Declaration
public override int ChildCount { get; }
Declaration
public void ScrollTo(int x, int y)
Type Name
System.Int32 x
System.Int32 y
Declaration
public void ScrollBy(int dx, int dy)
Type Name
System.Int32 dx
System.Int32 dy

Scrolls so that an element inside the view shows, as a change of focus does.

Declaration
public void ScrollIntoView(Element element)
Type Name
DarkEffekt.Terminal.UI.Element element
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