RAD Studio VCL Reference
|
Allows the component editor to modify menu items as they are added to the context menu.
procedure PrepareItem(Index: Integer; const AItem: IMenuItem);
__fastcall PrepareItem(int Index, const IMenuItem AItem);
The form designer calls PrepareItem for each verb when it constructs the context menu. This method lets the component editor make any modifications to the menu item for each verb, including adding subitems or removing the item from the context menu.
Index identifies the current verb that the form designer is adding to the context menu. This is the same index as appears for the command in the GetVerb and ExecuteVerb methods.
AItem is an interface to the menu item created by the form designer for the current verb. To add subitems, call the AddItem method of this interface. To disable the item, set the Enabled property to false. To suppress the menu item altogether, set its Visible property to false.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|