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:
juha 2013-04-28 21:35:20 +00:00
parent 3964d7f1f3
commit ca340b95bb
2 changed files with 3 additions and 1 deletions

View File

@ -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);

View File

@ -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;