Table of Contents

Class PanelBorderRenderer

Namespace
SharpConsoleUI.Helpers
Assembly
SharpConsoleUI.dll

Shared box-border drawing primitives used by panel-style controls. Extracted from PanelControl so both it and CollapsiblePanel can render identical bordered chrome without duplicating the drawing logic.

public static class PanelBorderRenderer
Inheritance
PanelBorderRenderer
Inherited Members

Methods

DrawBorderedRow(CharacterBuffer, int, int, int, LayoutRect, BoxChars, Color, Color, List<Cell>?, int)

Draws a row with vertical borders and content between them.

public static void DrawBorderedRow(CharacterBuffer buffer, int x, int y, int width, LayoutRect clipRect, BoxChars box, Color borderColor, Color bgColor, List<Cell>? contentCells = null, int contentOffset = 0)

Parameters

buffer CharacterBuffer

The character buffer to draw into.

x int

The left edge column.

y int

The row to draw on.

width int

The total width of the row (including borders).

clipRect LayoutRect

The clipping rectangle.

box BoxChars

The box-drawing character set.

borderColor Color

The border foreground color.

bgColor Color

The interior background color.

contentCells List<Cell>

Optional content cells to render in the interior.

contentOffset int

The left padding offset before content begins.

DrawBottomBorder(CharacterBuffer, int, int, int, LayoutRect, BoxChars, Color, Color)

Draws the bottom border line.

public static void DrawBottomBorder(CharacterBuffer buffer, int x, int y, int width, LayoutRect clipRect, BoxChars box, Color borderColor, Color bgColor)

Parameters

buffer CharacterBuffer

The character buffer to draw into.

x int

The left edge column.

y int

The row to draw on.

width int

The total width of the border row (including corners).

clipRect LayoutRect

The clipping rectangle.

box BoxChars

The box-drawing character set.

borderColor Color

The border foreground color.

bgColor Color

The border background color.

DrawTitledRule(CharacterBuffer, int, int, int, LayoutRect, BoxChars, Color, Color, string?, TextJustification)

Draws a flat horizontal rule with the header text embedded, using the box horizontal character at both ends instead of corner glyphs. Used to render a collapsed bordered CollapsiblePanel header as a titled rule (no dangling corners).

public static void DrawTitledRule(CharacterBuffer buffer, int x, int y, int width, LayoutRect clipRect, BoxChars box, Color borderColor, Color bgColor, string? header, TextJustification headerAlignment)

Parameters

buffer CharacterBuffer

The character buffer to draw into.

x int

The left edge column.

y int

The row to draw on.

width int

The total width of the rule row.

clipRect LayoutRect

The clipping rectangle.

box BoxChars

The box-drawing character set.

borderColor Color

The rule foreground color.

bgColor Color

The rule background color.

header string

Optional header text embedded in the rule (supports markup).

headerAlignment TextJustification

The horizontal alignment of the header text.

DrawTopBorder(CharacterBuffer, int, int, int, LayoutRect, BoxChars, Color, Color, string?, TextJustification)

Draws the top border line with optional header text embedded.

public static void DrawTopBorder(CharacterBuffer buffer, int x, int y, int width, LayoutRect clipRect, BoxChars box, Color borderColor, Color bgColor, string? header, TextJustification headerAlignment)

Parameters

buffer CharacterBuffer

The character buffer to draw into.

x int

The left edge column.

y int

The row to draw on.

width int

The total width of the border row (including corners).

clipRect LayoutRect

The clipping rectangle.

box BoxChars

The box-drawing character set.

borderColor Color

The border foreground color.

bgColor Color

The border background color.

header string

Optional header text embedded in the top border (supports markup).

headerAlignment TextJustification

The horizontal alignment of the header text.