[Lazarus] Why is TCustomControl.Canvas public?

Luiz Americo Pereira Camara luizmed at oi.com.br
Thu Jul 14 12:12:06 CEST 2011


On 14/7/2011 01:08, Flávio Etrusco wrote:
>> (...)
>> TCustomControl is to be a base class not for quick hacks. Adding more
>> functions would blow the code for most components that don't use it
> Oh my. I suppose it's not be used directly in TCustomControl, but on
> descendants.
>

What about descendants that dont use it? Dont need it?

>> OnPaint can be even undesired in some controls
>>
>> If some descendants needs OnPaint is pretty simple to add with the benefit
>> of choosing where to call.
> This is not in question. It's already there.
>

Yes but is useless. Even delphi does not has.

For an descendant overriding Paint is easier then assigning an OnPaint 
handler. And the descendant may not want to expose OnPaint to users case 
when will just be using extra memory

Luiz




More information about the Lazarus mailing list