Using the Memo Components

The memo component which is available on each tab of the Chartbook is a simple text component which can be used to display unformatted text. This is typically used for providing explanations or hints to the user.

The memo on a particular tab can be accessed via the array property Memos[idx] and its subproperties (with idx as the tab number). Its layout can be configured by the method Configure.

As the memo component is only a simple text component just a few properties are necessary to control it. Access to the text of the memo is provided by the property Lines, which is a TStringList. All operations available for the string list are also available to the memo component. The properties Alignment, ScrollBars and WordWrap control the appearance of the text. The property Color controls the background color, the property Font controls the font of the text and its color, The property ReadOnly can be set TRUE to prevent the user from changing the displayed text.

The following code shows a simple program to display a few lines in the memo component of tabsheet 1 and switches the memo component into readonly mode. Please note that the memo component is automatically resized to fit the entire client area of Chartbook, because neither the chart nor the table component are visible.

program ShowMemoOnly;

  PAGE = 1;

ChartBook.TabCaption[PAGE] := 'Tab 1';
   (PAGE,               // page 1
    false, false, true, // only the memo is visible
    250, 250);          // default width & height

with ChartBook.Memos[PAGE] do
  Font.Color := clBlue;
  Lines.Add ('first line');
  Lines.Add ('second line');
  ReadOnly := true;