mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 02:10:35 +02:00
LCL: TControl.Click: call OnClick if set and differs from Action for Delphi compatibility
git-svn-id: trunk@32583 -
This commit is contained in:
parent
8cc6b6ba82
commit
50ff6b7890
@ -2299,10 +2299,13 @@ end;
|
|||||||
procedure TControl.Click;
|
procedure TControl.Click;
|
||||||
begin
|
begin
|
||||||
//DebugLn(['TControl.Click ',DbgSName(Self)]);
|
//DebugLn(['TControl.Click ',DbgSName(Self)]);
|
||||||
if (not (csDesigning in ComponentState)) and (ActionLink <> nil) then
|
if Assigned(FOnClick) and (Action<>nil)
|
||||||
|
and (not CompareMethods(TMethod(Action.OnExecute),TMethod(FOnClick))) then
|
||||||
|
// the OnClick is set and differs from the Action => call the OnClick
|
||||||
|
FOnClick(Self)
|
||||||
|
else if (not (csDesigning in ComponentState)) and (ActionLink <> nil) then
|
||||||
ActionLink.Execute(Self)
|
ActionLink.Execute(Self)
|
||||||
else
|
else if Assigned(FOnClick) then
|
||||||
if Assigned(FOnClick) then
|
|
||||||
FOnClick(Self);
|
FOnClick(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user