[Lazarus] TControl.Click?

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Oct 1 18:32:14 CEST 2011


On Sat, 01 Oct 2011 18:22:42 +0200
Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:

> 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. 

That is the case since revision 32583.


> 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.


Mattias




More information about the Lazarus mailing list