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
windowWindowThe window to manage layout for.
Exceptions
- ArgumentNullException
Thrown when
windowis null.
Methods
GetControlAtWindowPosition(Point)
Finds the control at a specific window coordinate
public (IWindowControl? control, Point localPosition) GetControlAtWindowPosition(Point windowPosition)
Parameters
windowPositionPoint
Returns
GetControlBounds(IWindowControl)
Gets the bounds information for a specific control
public ControlBounds? GetControlBounds(IWindowControl control)
Parameters
controlIWindowControl
Returns
GetOrCreateControlBounds(IWindowControl)
Gets or creates bounds for a control
public ControlBounds GetOrCreateControlBounds(IWindowControl control)
Parameters
controlIWindowControl
Returns
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
controlIWindowControl
Returns
UpdateLayout(int, int)
Calculates and updates the layout for all controls in the window
public void UpdateLayout(int availableWidth, int availableHeight)