Class TMenu

Unit

Declaration

type TMenu = class(TMenuEntryWithCaption)

Description

TMenuEntry that contains a list of menu entries. This is the basic class to represent a drop-down menu, a submenu etc.

Hierarchy

Overview

Methods

Protected procedure ClearHandles; override;
Public constructor Create(const ACaption: String);
Public destructor Destroy; override;
Public function Count: Integer;
Public procedure Insert(Index: Integer; Value: TMenuEntry);
Public procedure Append(Value: TMenuEntry);
Public procedure Delete(Index: Integer);
Public procedure Clear;
Public function EntriesCount: Integer; deprecated;
Public procedure EntryDelete(Index: Integer); deprecated;
Public procedure EntriesDeleteAll; deprecated;
Public procedure DeleteAll;
Public function AppendRadioGroup(const Items: array of string; BaseIntData: Cardinal; SelectedIndex: Integer; AAutoCheckedToggle: boolean; QuoteCaption: boolean = true): TMenuItemRadioGroup;

Properties

Public property Entries [Index:Integer]: TMenuEntry read GetEntries;

Description

Methods

Protected procedure ClearHandles; override;
 
Public constructor Create(const ACaption: String);
 
Public destructor Destroy; override;
 
Public function Count: Integer;
 
Public procedure Insert(Index: Integer; Value: TMenuEntry);
 
Public procedure Append(Value: TMenuEntry);

Add at the end. Same as Insert(Count, Value).

Public procedure Delete(Index: Integer);
 
Public procedure Clear;
 
Public function EntriesCount: Integer; deprecated;

Warning: this symbol is deprecated.

Deprecated name for Count.

Public procedure EntryDelete(Index: Integer); deprecated;

Warning: this symbol is deprecated.

Deprecated name for Delete.

Public procedure EntriesDeleteAll; deprecated;

Warning: this symbol is deprecated.

Deprecated name for Clear.

Public procedure DeleteAll;

Warning: this symbol is deprecated.

Deprecated name for Clear.

Public function AppendRadioGroup(const Items: array of string; BaseIntData: Cardinal; SelectedIndex: Integer; AAutoCheckedToggle: boolean; QuoteCaption: boolean = true): TMenuItemRadioGroup;

Append a number of radio menu items. This is a comfortable shortcut for an often task of adding many TMenuItemRadio items that create a new radio group (TMenuItemRadioGroup).

For each item of Items list, we'll add a new TMenuItemRadio instance.

  • TMenuItemRadio.Caption will be set to the Items[I] string. Additionally it will be quoted by SQuoteMenuEntryCaption to avoid interpreting underscore characters (if QuoteCaption).

  • TMenuItemRadio.IntData will be set to BaseIntData + the number of this item. (This is usually most comfortable, you can handle this radio group by "case" with a range.)

  • TMenuItemRadio.Group will be equal. More precisely: along with creating the first TMenuItemRadio, we will also create new TMenuItemRadioGroup. For the rest of TMenuItemRadio, we'll assign this group.

  • TMenuItemRadio.Checked will be set to True on only one item: the one numbered SelectedIndex. Pass SelectedIndex negative (or >= than items count) to have no radio item checked by default.

  • TMenuItemRadio.AutoCheckedToggle will be set according to ou parameter AAutoCheckedToggle.

We return the newly created TMenuItemRadioGroup. If Items is empty, this does nothing and returns Nil.

Properties

Public property Entries [Index:Integer]: TMenuEntry read GetEntries;

Items (entries) on the menu. Items are owned by this menu instance (are automatically freed at destruction, at Delete and such).


Generated by PasDoc 0.16.0.