public sealed class GaugeA reading on a dial: the same capacity a LevelIndicator shows, as an arc.
Remarks
⚠ The other half of doc 49 § 7.1's rank 6, and the same control drawn round a circle. A level indicator is a bar because it sits in a row; a gauge is a dial because it sits on its own — a CPU load in a status panel, a frame budget in an overlay, a tank on a HUD. What the reading means is identical, so Warning, Critical, Direction and Level are the level indicator's, computed by the same code, and a bar and a dial over one number cannot disagree about whether it is a problem.
⚠ The dial opens at the bottom and fills clockwise from its lower left. That is what a speedometer, a pressure gauge and every audio meter with a needle does, and the gap is where a caption goes. Sweep is how much of the turn it spans.
No needle and no text. The filled arc is the needle — a needle is one more thing to antialias at every angle and says nothing the arc's end does not — and the number in the middle is the application's, for LevelIndicator's reason: "87 %" is not a sentence this assembly can write without knowing what is being measured. Put a label over it.
⚠ Orientation means nothing to a dial and is ignored. It is inherited because the bounds, the step and the colours are, and those are the part of RangeBase a gauge needs.
Fields and properties (15)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusprotected override AccessibleRole NativeRoleprotected override string? NativeAccessibleValuepublic float Valuepublic float Warningpublic float Criticalpublic LevelDirection Directionpublic float Sweeppublic LevelReading LevelWhat the reading currently amounts to.
public static readonly UiPropertyKey ValuePropertyIdentity for Value.
public static readonly UiPropertyKey WarningPropertyIdentity for Warning.
public static readonly UiPropertyKey CriticalPropertyIdentity for Critical.
public static readonly UiPropertyKey DirectionPropertyIdentity for Direction.
public static readonly UiPropertyKey SweepPropertyIdentity for Sweep.
Methods (7)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
protected override void OnDraw(DrawContext context)public void ClearValue()Unsets Value, so it takes its default or its ancestor's value again.
public void ClearWarning()Unsets Warning, so it takes its default or its ancestor's value again.
public void ClearCritical()Unsets Critical, so it takes its default or its ancestor's value again.
public void ClearDirection()Unsets Direction, so it takes its default or its ancestor's value again.
public void ClearSweep()Unsets Sweep, so it takes its default or its ancestor's value again.
Used by (3)
- GalleryHelloUi
- GaugeTestsVixen.Ui.Controls.Tests
- LevelIndicatorImageTestsVixen.Graphics.Golden.Tests