ConsoleForge 0.3.0
Elm-architecture TUI framework for .NET 8
Loading...
Searching...
No Matches
ConsoleForge.Core.FocusManager Class Reference

Stateless helper that traverses a widget tree depth-first and finds all IFocusable instances in declaration order. More...

Static Public Member Functions

static IReadOnlyList< IFocusableCollectFocusable (IWidget root)
 Collect all IFocusable widgets from the tree rooted at root in depth-first, declaration order.
static ? IFocusable FindFocusableAt (IWidget root, ResolvedLayout layout, int col, int row)
 Returns the IFocusable whose allocated region in layout contains the point (col , row ), or null if none.
static ? IFocusable GetNext (IFocusable? current, IReadOnlyList< IFocusable > all)
 Return the next focusable after current (wrapping).
static ? IFocusable GetPrev (IFocusable? current, IReadOnlyList< IFocusable > all)
 Return the previous focusable before current (wrapping).

Detailed Description

Stateless helper that traverses a widget tree depth-first and finds all IFocusable instances in declaration order.

Member Function Documentation

◆ FindFocusableAt()

? IFocusable ConsoleForge.Core.FocusManager.FindFocusableAt ( IWidget root,
ResolvedLayout layout,
int col,
int row )
static

Returns the IFocusable whose allocated region in layout contains the point (col , row ), or null if none.

When multiple widgets overlap (e.g. inside a ZStack), the last one in depth-first order wins (topmost layer).

◆ GetNext()

? IFocusable ConsoleForge.Core.FocusManager.GetNext ( IFocusable? current,
IReadOnlyList< IFocusable > all )
static

Return the next focusable after current (wrapping).

If current is null or not found, returns the first item. Returns null if all is empty.

◆ GetPrev()

? IFocusable ConsoleForge.Core.FocusManager.GetPrev ( IFocusable? current,
IReadOnlyList< IFocusable > all )
static

Return the previous focusable before current (wrapping).

If current is null or not found, returns the last item. Returns null if all is empty.


The documentation for this class was generated from the following file:
  • src/ConsoleForge/Core/FocusManager.cs