Skip to main content

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

MemberSummary
ProgressBar()

Properties

MemberSummary
CaptionBuilds 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.
FractionHow full the bar is, from 0 to 1. An empty range reads as 0.
MaximumValue at which the bar is full.
MinimumValue at which the bar is empty.
StyleColor of the filled part. The theme's active color when left alone.
ValueHow far along it is now.

Methods

MemberSummary
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

NameTypeDescription
regionSurfaceRegionWhere to draw; only its first row is used.

Returns SurfaceRegion — The region below the bar.