mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 21:59:16 +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;
|
function TMenuActionLink.IsOnExecuteLinked: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := inherited IsOnExecuteLinked
|
Result := inherited IsOnExecuteLinked
|
||||||
and (@FClient.OnClick = @Action.OnExecute);
|
and CompareMethods(TMethod(FClient.OnClick),TMethod(Action.OnExecute));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMenuActionLink.SetAutoCheck(Value: Boolean);
|
procedure TMenuActionLink.SetAutoCheck(Value: Boolean);
|
||||||
|
@ -394,6 +394,8 @@ begin
|
|||||||
ShortCut := NewAction.ShortCut;
|
ShortCut := NewAction.ShortCut;
|
||||||
if (not CheckDefaults) or (Visible = True) then
|
if (not CheckDefaults) or (Visible = True) then
|
||||||
Visible := NewAction.Visible;
|
Visible := NewAction.Visible;
|
||||||
|
if (not CheckDefaults) or not Assigned(OnClick) then
|
||||||
|
OnClick := NewAction.OnExecute;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user