ProgressBar class
Namespace: Arlecchino.Widgets.Readouts · Assembly: Arlecchino
A filled bar showing how far along something is, with an optional readout beside it.
public sealed class ProgressBar : IArlecchinoWidget
Implements IArlecchinoWidget
Constructors
| Member | Summary |
|---|---|
ProgressBar() |
Properties
| Member | Summary |
|---|---|
Caption | Builds the text drawn after the bar, given the value. Supplied as a delegate so the wording and units stay with the application rather than the widget. |
Fraction | How full the bar is, from 0 to 1. An empty range reads as 0. |
Maximum | Value at which the bar is full. |
Minimum | Value at which the bar is empty. |
Style | Color of the filled part. The theme's active color when left alone. |
Value | How far along it is now. |
Methods
| Member | Summary |
|---|---|
Draw(SurfaceRegion) | Draws the bar across the first row of the region, leaving room for the caption when there is one, and returns the rows below it. |
Constructors in detail
ProgressBar()
public ProgressBar();
Properties in detail
Caption
public Func<decimal, string>? Caption { get; init; }
Builds the text drawn after the bar, given the value. Supplied as a delegate so the wording and units stay with the application rather than the widget.
Type Func<T, TResult><decimal, string>
Fraction
public decimal Fraction { get; }
How full the bar is, from 0 to 1. An empty range reads as 0.
Type decimal
Maximum
public decimal Maximum { get; init; }
Value at which the bar is full.
Type decimal
Minimum
public decimal Minimum { get; init; }
Value at which the bar is empty.
Type decimal
Style
public IArlecchinoColor? Style { get; init; }
Color of the filled part. The theme's active color when left alone.
Type IArlecchinoColor
Value
public decimal Value { get; set; }
How far along it is now.
Type decimal
Methods in detail
Draw(SurfaceRegion)
public SurfaceRegion Draw(SurfaceRegion region);
Draws the bar across the first row of the region, leaving room for the caption when there is one, and returns the rows below it.
Parameters
| Name | Type | Description |
|---|---|---|
region | SurfaceRegion | Where to draw; only its first row is used. |
Returns SurfaceRegion — The region below the bar.