ScrollPanel class Core
Scrolls one child vertically inside its bounds, with the grid's own self-drawn scrollbar (thumb drag, track paging, auto-hide). The child is measured at the panel's width and may be as tall as it likes; the wheel over any part of it scrolls, and a control that takes the keyboard focus is brought into view.
public sealed class ScrollPanel : Control
- Namespace
- ArionUI.Presentation.Controls
- Package
- ArionUI.Presentation ·
dotnet add package ArionUI.Presentation --prerelease - Inherits
- Control
Constructors
ScrollPanel
public ScrollPanel(Control content);
Properties
Background
public Func<Rgba>? Background { get; init; }The colour behind the content; the bottom edge fades into it while more follows below. Null takes the theme's card fill.
ChildClip
public override LogRect? ChildClip { get; }The box this control shows its children in (a scrolling panel's viewport); null when it does not clip them. Parts outside it are offscreen to a reader.
Children
public override IEnumerable<Control> Children { get; }The controls inside this one, in tree order (visual order, tab order). A host keeps the tree it adopted: a control whose children change once it is adopted says so with Control.TreeChanged (on a shown board inside Board.Mutate), or its new children get no host and Tab, ticks and the wheel do not find them.
Offset
public double Offset { get; }How far the content is scrolled, 0 at the top.
WantsTick
public override bool WantsTick { get; }The control animates and wants Control.Tick on every frame.
WheelStep
public double WheelStep { get; init; }Pixels one wheel notch moves: three text lines.
Methods
Arrange
public override void Arrange(LogRect bounds);
BringIntoView
public void BringIntoView(LogRect box);Scrolls just enough to show box (panel coordinates as arranged, i.e. already shifted by the current offset).
HitTest
public override Control? HitTest(LogPoint p);The bar zone at the right edge is the panel's own; elsewhere the content answers, and the panel takes what the content leaves (so the wheel and a press on plain text still reach it).
Measure
public override LogSize Measure(LogSize available);Fills what it is given: a scrolling panel has no height of its own. Asked without a limit (an auto-sized board track) it wants its whole content.
OnPointerLeft
public override void OnPointerLeft();The pointer stopped hovering this control (moved on or left the pane).
OnPointerMoved
public override void OnPointerMoved(LogPoint p, bool buttonDown);
OnPointerPressed
public override void OnPointerPressed(LogPoint p, ArionModifiers mods, int clickCount);
OnPointerReleased
public override void OnPointerReleased(LogPoint p);
OnWheel
public override bool OnWheel(LogPoint p, double delta);
Render
public override void Render(IRenderSurface s, ControlFrame frame);
ScrollTo
public void ScrollTo(double y);Scrolls to y, clamped to the content.
Tick
public override void Tick(double dtMs);One frame of the animation. What it changes on screen it marks itself (Control.Invalidate): on a board only the marked area is drawn again.
