Table of Contents

Getting started with TMS FNC Widget LED Bar

TTMSFNCWidgetLEDBar draws a horizontal row of discrete LED segments and lights the first N of them, where N is the control's Value. It is ideal for level meters, battery and signal-strength indicators, and any reading that reads well as a segmented strip.

Prerequisites

  • TMS FNC Core installed and the runtime package added to the project.
  • TMS FNC Dashboard Pack design-time package registered in the IDE.

Add the control

  1. Drop TTMSFNCWidgetLEDBar from the TMS FNC Dashboard palette page onto a form.
  2. The control starts with a sample set of six LEDs (InitSample). Add or remove entries in the Leds collection to set the segment count you want.
  3. Set Value to the number of LEDs that should be lit, counting from the left.

Build a bar in code

The shortest working path: create the bar, populate the Leds collection, set the Spacing, and assign Value (the count of lit LEDs).

procedure TForm1.SetupLEDBar;
var
  I: Integer;
begin
  FBar := TTMSFNCWidgetLEDBar.Create(Self);
  FBar.Parent := Self;
  FBar.SetBounds(20, 20, 280, 48);

  // Size the segment collection. Each Leds entry is one LED.
  FBar.Leds.BeginUpdate;
  try
    FBar.Leds.Clear;
    for I := 0 to 9 do
      FBar.Leds.Add;
  finally
    FBar.Leds.EndUpdate;
  end;

  // Gap in pixels between LEDs and at the bar edges.
  FBar.Spacing := 6;

  // Value is the COUNT of lit LEDs, counting from the left (0..Leds.Count).
  // Setting it updates the State of every LED automatically.
  FBar.Value := 7;
end;

Value is clamped to 0..Leds.Count and is a count of lit segments, not a percentage or a scaled range. There is no Min/Max and no orientation property.

Next steps

  • Guides — value display, per-segment colors, and custom drawing.
  • API reference — full class reference.