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
bufferCharacterBufferThe character buffer to draw into.
xintThe left edge column.
yintThe row to draw on.
widthintThe total width of the row (including borders).
clipRectLayoutRectThe clipping rectangle.
boxBoxCharsThe box-drawing character set.
borderColorColorThe border foreground color.
bgColorColorThe interior background color.
contentCellsList<Cell>Optional content cells to render in the interior.
contentOffsetintThe 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
bufferCharacterBufferThe character buffer to draw into.
xintThe left edge column.
yintThe row to draw on.
widthintThe total width of the border row (including corners).
clipRectLayoutRectThe clipping rectangle.
boxBoxCharsThe box-drawing character set.
borderColorColorThe border foreground color.
bgColorColorThe 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
bufferCharacterBufferThe character buffer to draw into.
xintThe left edge column.
yintThe row to draw on.
widthintThe total width of the rule row.
clipRectLayoutRectThe clipping rectangle.
boxBoxCharsThe box-drawing character set.
borderColorColorThe rule foreground color.
bgColorColorThe rule background color.
headerstringOptional header text embedded in the rule (supports markup).
headerAlignmentTextJustificationThe 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
bufferCharacterBufferThe character buffer to draw into.
xintThe left edge column.
yintThe row to draw on.
widthintThe total width of the border row (including corners).
clipRectLayoutRectThe clipping rectangle.
boxBoxCharsThe box-drawing character set.
borderColorColorThe border foreground color.
bgColorColorThe border background color.
headerstringOptional header text embedded in the top border (supports markup).
headerAlignmentTextJustificationThe horizontal alignment of the header text.