IMenuItem.AdditionalShortCuts

Syntax

AdditionalShortCuts: IShortCutCollection;

Description

The AdditionalShortCuts property returns the collection of additional combinations of hot keys that are connected with this menu item.

Comments

If the menu item uses the Action object, the value of the AdditionalShortCuts property of the menu item is determined automatically by the value of the AdditionalShortCuts property of the Action object.

In object inspector the special editor is implemented for this property. After the cursor has been set in the editor, all key pressings and key combinations should be captured automatically. Pressed keys and key combinations should be set as the additional hot keys for this menu item. The following keys are ignored in this editor:

The combinations of hot keys are separated by the ";" character in the list.

Example

Executing the example requires a form, the Button1 button on this form and the MainMenu component that implements the main menu of the form. Several items have been created in the menu.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

SCCollect: IShortCutCollection;

Begin

MenuItem1.Text := "Copy";

MenuItem1.ShortCut := Self.MakeShortcut(KeyModifiers.Ctrl, Keys.C);

SCCollect := MenuItem1.AdditionalShortCuts;

SCCollect.Add(Self.MakeShortcut(KeyModifiers.Ctrl, Keys.Insert));

End Sub Button1OnClick;

After executing the example pressing the button changes name for the item of the MenuItem1 main menu and sets two combinations of hot keys. The first combination is set in the ShortCut main property, the second one is added to the collection of additional combinations of hot keys.

See also:

IMenuItem