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.
Source: window/castlewindowmenu.inc (line 123).
Hierarchy
- TObject
- TMenuEntry
- TMenuEntryWithCaption
- TMenu
Overview
Methods
| Public | procedure MenuUpdateBegin; |
| Public | procedure MenuUpdateEnd; |
| 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 ParentMenu: TMenu read FParentMenu; |
| Public | property ParentMenuPosition: Cardinal read FParentMenuPosition; |
| Public | property Caption: String read FCaption write SetCaption; |
| Public | property Enabled: boolean read FEnabled write SetEnabled
default true; |
| Public | property Entries [Index: Integer]: TMenuEntry read GetEntries; default; |
Description
Methods
| Public | procedure MenuUpdateBegin; |
|
This item is declared in ancestor TMenuEntry.
For optimization purposes, you may surround many menu changes inside | |
| Public | procedure MenuUpdateEnd; |
|
This item is declared in ancestor TMenuEntry. This item has no description. | |
| Protected | procedure ClearHandles; override; |
|
This item has no description. Showing description inherited from TMenuEntry.ClearHandles. Recursively clear TMenuEntry.Handle values. | |
| Public | constructor Create(const ACaption: String); |
|
This item has no description. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Public | function Count: Integer; |
|
This item has no description. | |
| Public | procedure Insert(Index: Integer; Value: TMenuEntry); |
|
This item has no description. | |
| Public | procedure Append(Value: TMenuEntry); |
|
Add at the end. Same as Insert(Count, Value). | |
| Public | procedure Delete(Index: Integer); |
|
This item has no description. | |
| Public | procedure Clear; |
|
This item has no description. | |
| 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.
We return the newly created TMenuItemRadioGroup. If Items is empty, this does nothing and returns | |
Properties
| Public | property ParentMenu: TMenu read FParentMenu; |
|
This item is declared in ancestor TMenuEntry.
This is the parent TMenu that has this item in it's Entries list. | |
| Public | property ParentMenuPosition: Cardinal read FParentMenuPosition; |
|
This item is declared in ancestor TMenuEntry.
Position on ParentMenu. Indexed from 0, so ParentMenu.Entries[ | |
| Public | property Caption: String read FCaption write SetCaption; |
|
This item is declared in ancestor TMenuEntryWithCaption. Caption of this menu entry. Will be shown to user. To indicate that some letter of a caption is a mnemonic for this menu item put '_' (underscore) char before this letter. Depending on CastleWindow-backend-dependent, mnemonics should allow user to easier activate this menu item with keyboard (e.g. Alt+mnemonic to dropdown item in MainMenu). You can put two consecutive underscore chars in Caption to indicate that here Caption should display literally one underscore character. (Convention to mark mnemonics with '_' is just copied from gtk, from gtk_label_new_with_mnemonic. So no, I didn't invent another new convention here.) It is undefined what will happen if you put underscore chars before *two* or more letters in Caption. I.e. you can't define multiple mnemonics for one menu item. I.e. this will not crash your program, but results may be CastleWindow-backend-dependent. Just like in GTK toolkit gtk_label_new_with_mnemonic and gtk_menu_item_new_with_mnemonic. | |
| Public | property Enabled: boolean read FEnabled write SetEnabled
default true; |
|
This item is declared in ancestor TMenuEntryWithCaption. This item has no description. | |
| Public | property Entries [Index: Integer]: TMenuEntry read GetEntries; default; |
|
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.17.0.snapshot.