[Lazarus] 0019723: Implement TControl.InvalidateRect?

Martin lazarus at mfriebe.de
Fri Jul 15 22:47:11 CEST 2011


On 15/07/2011 20:33, Flávio Etrusco wrote:
> 2011/7/15 Martin<lazarus at mfriebe.de>:
>> http://bugs.freepascal.org/view.php?id=19723
>>
>> It would be nice to have TControl.InvalidateRect, so that component
>> developers can avoid calls to LCLIntf.InvalidateRect :-)
...
>> There is the question of drawing a lie, to how much to put on TWinControl.
>> There are more Handle related functions... So there could be an additional
>> HandleObject property, with an object representing the handle.
>> Though, IMHO that would be too much...
>>
>>
>> What is the specific use case for it?
>> I can only really see use, if you develop your own component. But then you
>> can add it there...
>>
>> --
> The intended use is for component developers, yes. But actually I
> thought about it while checking a bug report and having to offset for
> InvalidateRect with a TPaintBox, so I'd prefer it was implemented in
> TControl ;-) It's just a matter of extract the method from
> TContol.Invalidate.
> I guess it's impossible to draw line, they need to be indeed discussed
> on a case-by-case basis. That's why I posted the RFE as a question ;-)

Well, one other think is, the current function would still have to 
remain. (or compatibility would be broken badly).
So doing this would simply be a duplicate.


I am definitely with the comment on mantis. I wouldn't want to add to 
many more things to T(Win)Control. That would speak for a 
TWinControl.HandleObj.InvalidateRect(x,y,x2,y2)

I do see the point of wanting to access it in context of a 
T(Graphic)Control, but there is no handle. there could be a handle 
object; but it probably wouldn't work for all functions...

Also TGraphicControl, and TCustomControl(inherit TWinControl)  introduce 
a Canvas, maybe then it could go there?
TCanvas, has other handle related functions, like GetClipRect.


Just some ideas....




More information about the Lazarus mailing list