mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 18:20:00 +02:00
LCL: Copy TAction.OnExecute to TMenuItem.OnClick when assigning TAction. Issue #22644, patch from Anton
git-svn-id: trunk@40919 -
This commit is contained in:
parent
3964d7f1f3
commit
ca340b95bb
@ -83,7 +83,7 @@ end;
|
||||
function TMenuActionLink.IsOnExecuteLinked: Boolean;
|
||||
begin
|
||||
Result := inherited IsOnExecuteLinked
|
||||
and (@FClient.OnClick = @Action.OnExecute);
|
||||
and CompareMethods(TMethod(FClient.OnClick),TMethod(Action.OnExecute));
|
||||
end;
|
||||
|
||||
procedure TMenuActionLink.SetAutoCheck(Value: Boolean);
|
||||
|
@ -394,6 +394,8 @@ begin
|
||||
ShortCut := NewAction.ShortCut;
|
||||
if (not CheckDefaults) or (Visible = True) then
|
||||
Visible := NewAction.Visible;
|
||||
if (not CheckDefaults) or not Assigned(OnClick) then
|
||||
OnClick := NewAction.OnExecute;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user