Class ControlBounds
- Namespace
- SharpConsoleUI.Layout
- Assembly
- SharpConsoleUI.dll
Represents the complete bounds and coordinate information for a control within a window
public class ControlBounds
- Inheritance
-
ControlBounds
- Inherited Members
Constructors
ControlBounds(IWindowControl, Window)
Initializes a new instance of the ControlBounds class.
public ControlBounds(IWindowControl control, Window parentWindow)
Parameters
controlIWindowControlThe control these bounds apply to.
parentWindowWindowThe window containing this control.
Exceptions
- ArgumentNullException
Thrown when
controlorparentWindowis null.
Properties
Control
The control these bounds apply to
public IWindowControl Control { get; }
Property Value
ControlContentBounds
The actual control rendering area (excluding margins, padding)
public Rectangle ControlContentBounds { get; set; }
Property Value
HasInternalScrolling
Whether the control supports internal scrolling
public bool HasInternalScrolling { get; set; }
Property Value
IsVisible
Whether the control is currently visible within the window viewport
public bool IsVisible { get; set; }
Property Value
ParentWindow
The window containing this control
public Window ParentWindow { get; }
Property Value
ScrollOffset
Current scroll offset within the control content
public Point ScrollOffset { get; set; }
Property Value
ViewportSize
The viewport size available for control content (considering scrollbars)
public Size ViewportSize { get; set; }
Property Value
WindowContentBounds
Total area allocated to the control within the window content area (including margins)
public Rectangle WindowContentBounds { get; set; }
Property Value
Methods
ControlToViewport(Point)
Converts a control-local position to viewport-relative coordinates
public Point ControlToViewport(Point controlPosition)
Parameters
controlPositionPoint
Returns
ControlToWindow(Point)
Converts a control-local position to window coordinates (including borders)
public Point ControlToWindow(Point controlPosition)
Parameters
controlPositionPoint
Returns
ControlToWindowContent(Point)
Converts a position from control-local coordinates to window content coordinates
public Point ControlToWindowContent(Point controlPosition)
Parameters
controlPositionPoint
Returns
GetVisibleContentBounds()
Gets the visible portion of the control within the window
public Rectangle GetVisibleContentBounds()
Returns
IsPositionVisible(Point)
Checks if a control-local position is within the visible viewport
public bool IsPositionVisible(Point controlPosition)
Parameters
controlPositionPoint
Returns
WindowContentToControl(Point)
Converts a position from window content coordinates to control-local coordinates
public Point WindowContentToControl(Point windowContentPosition)
Parameters
windowContentPositionPoint
Returns
WindowToControl(Point)
Converts a window coordinate (including borders) to control-local coordinates
public Point WindowToControl(Point windowPosition)
Parameters
windowPositionPoint