Vcl.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
Vcl.ActnList.pas
Vcl.ActnList.hpp
Vcl.ActnList TShortCutList

Description

Adds a new shortcut to the list.

Call Add to add a shortcut to the list. If the list is sorted, the shortcut is added to the appropriate position in the sort order. If the list is not sorted, the shortcut is added to the end of the list. Add returns the position of the shortcut in the list, where the first item in the list has a value of 0.

S is the string representation of the shortcut to add. You can obtain this from a shortcut using the global ShortCutToText function. TShortCutList saves the string S as a new string in the list and the corresponding shortcut as an Object associated with that string.

Note: For sorted lists, Add raises an EListError exception if the string S already appears in the list and Duplicates is set to dupError. If Duplicates is set to dupIgnore, trying to add a duplicate string to a sorted list does nothing.

See Also