Skip to content
ConsoleMonster
Class

ScrollView

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
sealed

A vertical viewport for ordinary widgets. Lists, grids and logs keep their own virtualized row windows.

Inheritance

  • object
  • ScrollView

Usage

Explore 8 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 4

Constructors

public ScrollView(IWidget content) #

Creates a viewport over one stable content tree.

Parameters

content ConsoleMonster.Layout.IWidget required
The content to clip and scroll.

Methods

public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.
public void ScrollBy(int rows) #

Moves the viewport by a number of rows.

Parameters

rows int required
Positive values move down.

Properties

public IWidget Content { get; } #

The content tree.

public int MaxContentHeight { get; set; } #

Maximum rows composed for non-virtualized content. Use a list, grid or log for larger data.

public int ScrollOffset { get; set; } #

The first visible content row, clamped after measurement.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

Extension Methods

public static ScrollView WithMaxContentHeight(ScrollView scrollView, int value) #

Sets ScrollView.MaxContentHeight: Maximum rows composed for non-virtualized content. Use a list, grid or log for larger data.

Parameters

scrollView ConsoleMonster.Widgets.ScrollView required
The instance.
value int required
The value.

Returns

ScrollView The same instance.
public static ScrollView WithScrollOffset(ScrollView scrollView, int value) #

Sets ScrollView.ScrollOffset: The first visible content row, clamped after measurement.

Parameters

scrollView ConsoleMonster.Widgets.ScrollView required
The instance.
value int required
The value.

Returns

ScrollView The same instance.