Class TMenuEntryWithCaption

Unit

Declaration

type TMenuEntryWithCaption = class(TMenuEntry)

Description

This item has no description. Showing description inherited from TMenuEntry.

A basic class representing basic menu building block. This can be a separator, clickable menu item or something that expands to submenu.

Source: window/castlewindowmenu.inc (line 79).

Hierarchy

Show Additional Members:

Overview

Methods

Protected procedure ClearHandles; virtual;
Public procedure MenuUpdateBegin;
Public procedure MenuUpdateEnd;
Public constructor Create(const ACaption: String);

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;

Description

Methods

Protected procedure ClearHandles; virtual;

This item is declared in ancestor TMenuEntry.

Recursively clear TMenuEntry.Handle values.

Source: window/castlewindowmenu.inc (line 56).

Public procedure MenuUpdateBegin;

This item is declared in ancestor TMenuEntry.

For optimization purposes, you may surround many menu changes inside MenuUpdateBegin + MenuUpdateEnd calls. Make sure window is not closed / opened between them.

Source: window/castlewindowmenu.inc (line 62).

Public procedure MenuUpdateEnd;

This item is declared in ancestor TMenuEntry.

This item has no description.

Source: window/castlewindowmenu.inc (line 63).

Public constructor Create(const ACaption: String);

This item has no description.

Source: window/castlewindowmenu.inc (line 87).

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. Nil is there is not parent menu yet (e.g. because it's not assigned yet, or because this is the main menu).

Source: window/castlewindowmenu.inc (line 69).

Public property ParentMenuPosition: Cardinal read FParentMenuPosition;

This item is declared in ancestor TMenuEntry.

Position on ParentMenu. Indexed from 0, so ParentMenu.Entries[ParentMenuPosition] should be always equal to Self (as long as ParentMenu <> Nil.

Source: window/castlewindowmenu.inc (line 74).

Public property Caption: String read FCaption write SetCaption;

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.

Source: window/castlewindowmenu.inc (line 113).

Public property Enabled: boolean read FEnabled write SetEnabled default true;

This item has no description.

Source: window/castlewindowmenu.inc (line 115).


Generated by PasDoc 0.17.0.snapshot.