Vixen
feb85697
csharp
public sealed class Gauge

A reading on a dial: the same capacity a LevelIndicator shows, as an arc.

Read the guide page for this →

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 TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus
  • protected override AccessibleRole NativeRole
  • protected override string? NativeAccessibleValue
  • public float Value
  • public float Warning
  • public float Critical
  • public LevelDirection Direction
  • public float Sweep
  • public LevelReading Level

    What the reading currently amounts to.

  • public static readonly UiPropertyKey ValueProperty

    Identity for Value.

  • public static readonly UiPropertyKey WarningProperty

    Identity for Warning.

  • public static readonly UiPropertyKey CriticalProperty

    Identity for Critical.

  • public static readonly UiPropertyKey DirectionProperty

    Identity for Direction.

  • public static readonly UiPropertyKey SweepProperty

    Identity 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