From 50ff6b78903eb8642cbd9b02051b552fce133bbc Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 1 Oct 2011 13:16:37 +0000 Subject: [PATCH] LCL: TControl.Click: call OnClick if set and differs from Action for Delphi compatibility git-svn-id: trunk@32583 - --- lcl/include/control.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 2cd392d0ee..51a2822315 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -2299,10 +2299,13 @@ end; procedure TControl.Click; begin //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) - else - if Assigned(FOnClick) then + else if Assigned(FOnClick) then FOnClick(Self); end;