Re: [Lazarus] Why is TCustomControl.Canvas public?

2011-07-14 Thread Flávio Etrusco
On Thu, Jul 14, 2011 at 3:00 AM, Felipe Monteiro de Carvalho wrote: > 2011/7/14 Flávio Etrusco : >> I guess you mean the current behavior is as it is for Delphi >> compatibility, right? >> I supposed so, but isn't it worth changing? > > No, there are many component sets which work with both the VC

Re: [Lazarus] Why is TCustomControl.Canvas public?

2011-07-14 Thread Luiz Americo Pereira Camara
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 th

Re: [Lazarus] Why is TCustomControl.Canvas public?

2011-07-13 Thread Felipe Monteiro de Carvalho
2011/7/14 Flávio Etrusco : > I guess you mean the current behavior is as it is for Delphi > compatibility, right? > I supposed so, but isn't it worth changing? No, there are many component sets which work with both the VCL and the LCL. Creating incompatibilities generates problems for component de

Re: [Lazarus] Why is TCustomControl.Canvas public?

2011-07-13 Thread Flávio Etrusco
> (...) > 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. > OnPaint can be even undesired in some controls > > If some des

Re: [Lazarus] Why is TCustomControl.Canvas public?

2011-07-13 Thread Luiz Americo Pereira Camara
On 13/7/2011 21:03, Flávio Etrusco wrote: IMHO it does not makes sense since TCustomControl is not supposed to be used directly. It's supposed to be derived and override Paint. The same for SetColor. Color should not be public so not handled by default in TCustomControl. I kind of agree; that mu

Re: [Lazarus] Why is TCustomControl.Canvas public?

2011-07-13 Thread Flávio Etrusco
On Wed, Jul 13, 2011 at 8:37 PM, Luiz Americo Pereira Camara wrote: > On 13/7/2011 05:42, Flávio Etrusco wrote: >> >> Hello, >> Wouldn't it better to make Canvas protected and pass it on the OnPaint >> event? > > Yes. It seems a Delphi compatible design I guess you mean the current behavior is as

Re: [Lazarus] Why is TCustomControl.Canvas public?

2011-07-13 Thread Luiz Americo Pereira Camara
On 13/7/2011 20:37, Luiz Americo Pereira Camara wrote: but... BTW why is OnPaint called inside TCustomControl.Paint instead of TCustomControl.PaintWindow? PaintWindow -> Paint -> OnPaint I forgot http://docwiki.embarcadero.com/VCL/XE/en/Controls.TCustomControl.Paint Luiz -- _

Re: [Lazarus] Why is TCustomControl.Canvas public?

2011-07-13 Thread Luiz Americo Pereira Camara
On 13/7/2011 05:42, Flávio Etrusco wrote: Hello, Wouldn't it better to make Canvas protected and pass it on the OnPaint event? Yes. It seems a Delphi compatible design I'm almost sure is was also public in Delphi, Yes it is. and I don't even remember Delphi having OnPaint in TCustomCont

[Lazarus] Why is TCustomControl.Canvas public?

2011-07-13 Thread Flávio Etrusco
Hello, Wouldn't it better to make Canvas protected and pass it on the OnPaint event? I'm almost sure is was also public in Delphi, and I don't even remember Delphi having OnPaint in TCustomControl, but... BTW why is OnPaint called inside TCustomControl.Paint instead of TCustomControl.PaintWindow?