Sign in Join
FPDoc Onlineexperiment

TMenuItem.Click procedure

Member of TMenuItempublicIn unit Menus

Performs actions needed when the menu item is clicked.

Declaration

pascal
procedure Click; virtual

Description

Click is method used to perform actions needed when the menu item is clicked, or when the DoClick method is called. No actions are performed in the method if the menu item is not Enabled.

Click signals the OnMenuPopupHandler event handler variable (when assigned).

Properties in the TMenuItem instance are examined to determine whether an Action is used to execute the menu item, or if its OnClick event handler is signalled for the purpose. An action is used when the ActionLink property has been assigned for the class instance. The action is not executed if the menu item is clicked at design-time.

Otherwise, the OnClick event handler is used. When AutoCheck is enabled, the value for the Checked property is toggled when the menu item. If the menu item has been configured as a RadioItem, Checked cannot be set to False; that is handled using the logic for the radio button group.

The OnClick event handler is signalled to perform the actions for the menu item.

AutoCheck does not cause the item to become checked at design-time.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.