UIVirtualListBase Class
Definition
Namespace: Brine2D.UI
Non-generic base for UIVirtualList<T> that holds all rendering, scrolling, and hit-test logic. Use the typed subclass in application code.
C#
public abstract class UIVirtualListBase : Brine2D.UI.IUIComponent, Brine2D.UI.IAnchoredUIComponent
Inheritance System.Object → UIVirtualListBase
Derived
↳ UIVirtualList<T>
Implements IUIComponent, IAnchoredUIComponent
| Properties | |
|---|---|
| Anchor | The screen anchor point this component is positioned relative to. |
| AnchorOffset | Pixel offset from the resolved anchor point. |
| HoveredIndex | Index of the hovered row, or -1 if none. |
| ItemCount | Total number of items in the list. |
| ListAreaHeight | Height of the list content area \(excluding scrollbar\). |
| ListAreaWidth | Width of the content area \(excluding scrollbar when visible\). |
| MinThumbSize | Minimum scrollbar thumb height in pixels. Defaults to 10. |
| RowHeight | Pixel height of each row. Defaults to 24. |
| ScrollbarWidth | Width of the vertical scrollbar track in pixels. Defaults to 10. |
| ScrollOffsetY | Current scroll position in pixels. |
| SelectedIndex | Index of the selected row, or -1 if none. |
| Methods | |
|---|---|
| ClearHover() | Clears hover state \(called when mouse leaves the list\). |
| ClearSelection() | Clears the current selection. |
| HandleClick\(Vector2\) | Selects the hovered row on left-button press. Ignores clicks on the scrollbar. |
| HandlePageScroll\(float\) | Scrolls by one visible page \(positive = down\). |
| HandleScroll\(float\) | Scrolls by delta rows \(positive = down\). |
| NavigateDown() | Moves selection down by one row, scrolling into view. |
| NavigateUp() | Moves selection up by one row, scrolling into view. |
| RenderRow\(IRenderer, int, float, float, float, float, bool, bool\) | Implemented by the typed subclass to draw a single row. Called only for rows that are currently visible. |
| ScrollIntoView\(int\) | Ensures the row at index is fully visible. |
| Select\(int\) | Selects the row at index. |
| UpdateHover\(Vector2\) | Updates HoveredIndex and scrollbar thumb hover. |
| Events | |
|---|---|
| OnFocusGained | Fired when keyboard focus is gained. |
| OnFocusLost | Fired when keyboard focus is lost. |
| OnSelectionChanged | Fired when the selected row changes. Argument is the new selected index \(−1 = none\). |