FMX.ActnList.TShortCutList.Add

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Add(const S: String): Integer; override;

C++

virtual int __fastcall Add(const System::UnicodeString S);

Properties

Type Visibility Source Unit Parent
function public
FMX.ActnList.pas
FMX.ActnList.hpp
FMX.ActnList TShortCutList

Description

Adds a new shortcut to the shortcut list.

Call Add to add a TShortCut shortcut to the TShortCutList shortcut list.

FMX.ActnList.TShortCutList.Add and Vcl.ActnList.TShortCutList.Add are the FMX and VCL framework-specific implementations of the method that adds a shortcut to the shortcut list.

S is the string representation of the shortcut to add. Add uses FMX.ActnList.TextToShortCut to convert S into an integer representing a shortcut key. If FMX.ActnList.TextToShortCut cannot convert S to a shortcut, then it raises the error "An unknown combination of keys %s".

The list is not sorted, and the shortcut is added to the end of the list. Therefore, Add returns the index of the last element in the list (position of the appended shortcut), where the first item in the list has a 0 index.

Add saves the S string as a new string in the System.Actions.TCustomShortCutList list, and the corresponding shortcut as an Object associated with that string.

See Also