Interface IScrollableContainer
- Namespace
- SharpConsoleUI.Controls
- Assembly
- SharpConsoleUI.dll
Interface for containers that can scroll to bring children into view. Used by BringIntoFocus to notify parent containers when nested child receives focus.
public interface IScrollableContainer
- Extension Methods
Methods
ScrollChildIntoView(IWindowControl)
Scrolls the container to bring the specified child control into view. Should also show/highlight scrollbars if applicable.
void ScrollChildIntoView(IWindowControl child)
Parameters
childIWindowControlThe child control to bring into view (may be deeply nested)
Remarks
Implementation should use child.AbsoluteBounds to calculate position, which works correctly for deeply nested children (grandchildren, etc).
ScrollChildRegionIntoView(IWindowControl, int, int)
Scrolls so that a sub-region of child is visible. The region is given in the
child's own content coordinates: childRelativeTop rows from the child's top,
spanning regionHeight rows. Used to bring a focused element's row into view when
the child itself does not scroll. Default implementation degrades to ScrollChildIntoView(IWindowControl).
void ScrollChildRegionIntoView(IWindowControl child, int childRelativeTop, int regionHeight)
Parameters
childIWindowControlThe (direct) child whose sub-region should be made visible.
childRelativeTopintRow offset of the region from the child's top edge. A negative value is clamped to 0.
regionHeightintHeight of the region in rows. A value less than 1 is treated as 1.