Table of Contents

Getting started with TMS FNC Widget Matrix Label

TTMSFNCWidgetMatrixLabel displays text as a grid of LED-style cells, like a classic dot-matrix display board. This page gets a panel rendering text in a few steps; the Guides cover appearance and scrolling in depth.

Prerequisites

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

Add the control

  1. Drop TTMSFNCWidgetMatrixLabel from the TMS FNC Dashboard palette page onto a form.
  2. Set Text to the message to display on the panel.
  3. Set Leds to the number of character cells and pick an Appearance.LedStyle (mls9x13, mls14x20, or mls19x27) for the cell size.

Build it in code

The widget draws as soon as Text is assigned. Batch property changes between BeginUpdate/EndUpdate so the control lays out and repaints once.

procedure TForm1.FormCreate(Sender: TObject);
var
  Matrix: TTMSFNCWidgetMatrixLabel;
begin
  Matrix := TTMSFNCWidgetMatrixLabel.Create(Self);
  Matrix.Parent := Self;
  Matrix.Position.X := 20;
  Matrix.Position.Y := 20;

  Matrix.BeginUpdate;
  try
    // Number of character cells along the primary axis.
    Matrix.Leds := 8;
    Matrix.Orientation := mloHorizontal;

    // Larger cell grid for a crisper, more readable panel.
    Matrix.Appearance.LedStyle := mls19x27;

    // Lit and unlit dot colors recreate a classic amber LED board.
    Matrix.Appearance.High := gcOrange;
    Matrix.Appearance.Low := gcMaroon;
    Matrix.Appearance.LedsVisible := True;

    // Static text is positioned with the alignment setting.
    Matrix.Appearance.TextStyle := mtsUpperCase;
    Matrix.Appearance.Alignment := mlaCenter;

    // The control auto-sizes to the cells, spacing, and margin.
    Matrix.Appearance.AutoSize := True;
    Matrix.Appearance.Spacing := 3;
    Matrix.Appearance.Margin := 12;

    Matrix.Text := 'READY';
  finally
    Matrix.EndUpdate;
  end;
end;

Display and update text

Text is the rendered string; assign it at any time to change the message. Appearance.TextStyle controls casing (mtsUpperCase is the LED-board default). Appearance.High and Appearance.Low are the lit and unlit dot colors — plain color values, assigned directly:

{ Inside an event handler: }
WidgetMatrixLabel1.Text := 'HELLO';
WidgetMatrixLabel1.Appearance.High := gcLime;
WidgetMatrixLabel1.Appearance.Low := gcGreen;

Enable scrolling

For messages longer than the panel is wide, turn it into a marquee:

{ Inside an event handler: }
WidgetMatrixLabel1.Scroll.Enabled := True;
WidgetMatrixLabel1.Scroll.Direction := msdLeftToRight;
WidgetMatrixLabel1.Scroll.Interval := 150;

Next steps