[Lazarus] TControl.Click?

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sat Oct 1 18:22:42 CEST 2011


Mattias Gaertner schrieb:

>>>> Even if the 2 callbacks are pointing to the same method, calling 
>>>> Action.OnExecute, will call the callback with Sender=TheAction, while 
>>>> FOnClick gets the current object.
>> Looks as if Execute should be overridden in TControlActionLink!
> 
> Why? How?

To use the control as Sender, at least when it equals the control's OnClick.

At least everything would be more clear, when in the case of different 
control.OnClick and action.Execute the OnClick would take precedence. 
Then it can be assumed that the OnClick handler expects a control, while 
equal handlers more probably indicate and Execute handler, expecting an 
Action as Sender. Then Execute doesn't deserve an override.

DoDi





More information about the Lazarus mailing list