Skip to content

TTMSFNCWidgetGauge

TTMSFNCWidgetGauge

Introduction

TTMSFNCWidgetGauge is an Instrumentation control to visualize data as a meter with optionally smooth animation.

Features

  • Specify any range to show on the meter with Divisions and subdivisions.
  • Set a Value for the main Needle.
  • Specify a Threshold subrange to be shown on the rim.
  • Specify additional ranges with colored Sections with custom margins.
  • Add Extra Needles to show multiple values.
  • Enable Animation to move needles in animated motion.
  • Get an LCD display of the value at the bottom. Hide this display by the Digit property group.
  • Set a Dial text for short description.
  • Completely customize the color and size of various items like needles, arcs, marks, sections and more as shown in the screenshots on this page.

Demo

A Demo is included in the source in a subfolder “Demo\WidgetGauge.” It shows a customized Gauge that shows Temperature. You can change the Temperature on the track bar to see how it works. Switch ON Animation to see how the change is animated. Also see how the feature to show Sections with custom margin works.

TTMSFNCWidgetGauge1

Code Snippets

Min and max values with a different color scheme:

 TMSFNCWidgetGauge1.Value := 0;
 TMSFNCWidgetGauge1.MinimumValue := 0;
 TMSFNCWidgetGauge1.MaximumValue := 100;
 TMSFNCWidgetGauge1.OuterCircle.Color := gcDarkslategray;
 TMSFNCWidgetGauge1.InnerCircle.Color := gcLightgray;
 TMSFNCWidgetGauge1.OuterRim.Color := gcLightgray;
 TMSFNCWidgetGauge1.Arc.Color := gcMedGray;
 TMSFNCWidgetGauge1.Arc.Threshold.Color := gcDarkslategray;
 TMSFNCWidgetGauge1.Digit.BackGroundColor := gcWhite;
 TMSFNCWidgetGauge1.DialText := 'Temperature';
 TMSFNCWidgetGauge1.Font.Color := gcBlack;

Add Sections to show different subranges

 TMSFNCWidgetGauge1.Sections.BeginUpdate;
 try
 aSection := TMSFNCWidgetGauge1.Sections.Add;
 aSection.StartValue := 20;
 aSection.EndValue := 30;
 aSection.Color := gcLime;
 aSection.SectionType := stBorder;
 aSection := TMSFNCWidgetGauge1.Sections.Add;
 aSection.StartValue := 30;
 aSection.EndValue := 100;
 aSection.Color := gcOrangeRed;
 aSection.SectionType := stBorder;
 finally
 TMSFNCWidgetGauge1.Sections.EndUpdate;
 end;

Add an Extra Needle

 aNeedle := TMSFNCWidgetGauge1.ExtraNeedles.Add;
 aNeedle.ShineColor := gcDarkGreen;
 aNeedle.ShineColorTo := gcLime;
 aNeedle.Value := 25;