Sign in Join
FPDoc Onlineexperiment

TToolButton.CopyPropertiesFromMenuItem procedure

Member of TToolButtonprotectedIn unit ComCtrls

Copies properties from the specified menu item.

Declaration

pascal
procedure CopyPropertiesFromMenuItem(const Value: TMenuItem)

Arguments

Value

Menu item with the properties copied in the method.

Description

CopyPropertiesFromMenuItem is a method used to copy property value from the menu item in Value into the current class instance. This ensures that the button has the same settings and behavior as the menu item assigned to the button.

No actions are performed in the method when Value has not been assigned (Nil). Calls BeginUpdate on entry, and EndUpdate when the method is completed.

The following properties are copied from the menu item in Value:

Source Property (in TMenuItem)Target Property (in TToolButton)
Action Action
Caption Caption
Checked Down
Enabled Enabled
Enabled Enabled
Hint Hint
ImageIndex ImageIndex
Visible Visible

CopyPropertiesFromMenuItem is called from the Loaded method when LCL component streaming has been completed, and when a new value is assigned to the MenuItem property.

See also

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