Class TFormList (unit WinMenuExpert)

Inherits from

TStringList

The TFormList type stores a list of form references and the form captions. The captions are munged to add menu item short cuts by inserting an '&' character. The associated object for each item is the index into the Screen.Forms[] array. For the caller's convenience, the Forms[] array of this list returns a TForm reference by looking up the form index.

Constructors


constructor Create;



Functions

procedure AddForm(Index: Integer);

Add a form to the list.

procedure Clear;

Clear the list, and reset it for adding a new list of forms.

procedure MungCaptionNames;

Update all the captions in the list to add an '&' short cut for a unique character in each caption.

function GetForms(Index: Integer): TForm;

Return a form reference.

function GetItemName(Index: Integer): string;

Return a suitable component name for a menu item at Index.

Properties

property Forms : TForm


property ItemName : string


Events

Variables


Constructors


constructor Create;


Functions


procedure AddForm(Index: Integer);

Add a form to the list. Store the index as the associated object, so we can retrieve the original TForm reference. Note that this Index is an index into Screen.Forms[].


procedure Clear;

Clear the list, and reset it for adding a new list of forms. Munging the names sets Sorted to False. To reset the list, reset Sorted to True. Duplicates are allowed, although Delphi's IDE ensures that windows have unique captions. There is no reason for this wizard to be extra restrictive.


procedure MungCaptionNames;

Update all the captions in the list to add an '&' short cut for a unique character in each caption.


function GetForms(Index: Integer): TForm;

Return a form reference.


function GetItemName(Index: Integer): string;

Return a suitable component name for a menu item at Index. Because indices start at 0, add 1 so the names start at 1, which is nicer for the programmer who might need to refer to these names. The end-user never sees the menu item component names.


Properties


property Forms : TForm


property ItemName : string


Events


Variables