A horizontal progress bar widget. More...
Public Member Functions | |
| ProgressBar () | |
| Object-initializer constructor. | |
| ProgressBar (double value, double maximum=100, bool showPercent=true, char fillChar='█', char emptyChar='░', Style? style=null) | |
| Positional constructor for inline usage. | |
| void | Render (IRenderContext ctx) |
| Renders the progress bar into ctx 's allocated region. | |
Properties | |
| char | EmptyChar = '░' [get] |
| Character used for the empty portion. Default '░'. | |
| Style | EmptyStyle = Style.Default [get] |
| Style applied to the empty portion. Inherits widget style when unset. | |
| char | FillChar = '█' [get] |
| Character used for the filled portion. Default '█'. | |
| Style | FillStyle = Style.Default [get] |
| Style applied to the filled portion. Inherits widget style when unset. | |
| SizeConstraint | Height = SizeConstraint.Fixed(1) [get] |
| Vertical size constraint. Defaults to SizeConstraint.Fixed(int) 1 (single row). | |
| double | Maximum = 100 [get] |
| Maximum value. Must be > 0. Default 100. | |
| bool | ShowPercent = true [get] |
| When true, a percentage label (e.g. | |
| Style | Style = Style.Default [get] |
| Base style applied to the entire widget. Inherits from the active theme when unset. | |
| double | Value [get] |
| Current progress value. Clamped to [0, Maximum]. | |
| SizeConstraint | Width = SizeConstraint.Flex(1) [get] |
| Horizontal size constraint. Defaults to SizeConstraint.Flex(int) weight 1 (fill available width). | |
| void ConsoleForge.Widgets.ProgressBar.Render | ( | IRenderContext | ctx | ) |
Renders the progress bar into ctx 's allocated region.
Draws a filled portion followed by an empty portion, then an optional percentage label at the right edge.
| ctx | The render context providing the target region, theme, and write methods. |
Implements ConsoleForge.Layout.IWidget.
|
get |
When true, a percentage label (e.g.
" 42%") is rendered at the right edge of the bar.