Table of Contents

Class WindowLayoutManager

Namespace
SharpConsoleUI.Layout
Assembly
SharpConsoleUI.dll

Manages layout calculations and coordinate translations for all controls in a window

public class WindowLayoutManager
Inheritance
WindowLayoutManager
Inherited Members

Constructors

WindowLayoutManager(Window)

Initializes a new instance of the WindowLayoutManager class.

public WindowLayoutManager(Window window)

Parameters

window Window

The window to manage layout for.

Exceptions

ArgumentNullException

Thrown when window is null.

Methods

GetControlAtWindowPosition(Point)

Finds the control at a specific window coordinate

public (IWindowControl? control, Point localPosition) GetControlAtWindowPosition(Point windowPosition)

Parameters

windowPosition Point

Returns

(IWindowControl control, Point localPosition)

GetControlBounds(IWindowControl)

Gets the bounds information for a specific control

public ControlBounds? GetControlBounds(IWindowControl control)

Parameters

control IWindowControl

Returns

ControlBounds

GetOrCreateControlBounds(IWindowControl)

Gets or creates bounds for a control

public ControlBounds GetOrCreateControlBounds(IWindowControl control)

Parameters

control IWindowControl

Returns

ControlBounds

TranslateLogicalCursorToWindow(IWindowControl)

Translates a control's logical cursor position to window coordinates by walking up the parent container hierarchy and accumulating offsets

public Point? TranslateLogicalCursorToWindow(IWindowControl control)

Parameters

control IWindowControl

Returns

Point?

UpdateLayout(int, int)

Calculates and updates the layout for all controls in the window

public void UpdateLayout(int availableWidth, int availableHeight)

Parameters

availableWidth int
availableHeight int