[Lazarus] RE : RE : RE : gtk2 TCustomControl.Paint, InvalidateRect

Ludo Brands ludo.brands at free.fr
Sat Jul 9 20:00:35 CEST 2011


> > The scrollbar invalidates indeed the whole region, even if it is located

> > outside the customcontrol (and thus invisible). If nobody else has

> > another idea I would suggest to create a bug report.

> > 

> > In the mean time, a workaround is to parent the scrollbox to the parent

> > of TPaintTest. The constructor becomes then




OK, let's stop a bit here.

It invalidates some area (parent in this case), and part of that area isn't
exposed (visible) then gtk2 will not paint that part. if it's opposite then
it's an ugly gtk2 bug. 

 

No, "it" in " if it is located outside the customcontrol "is the scrollbar.
In Armin's testprogram change  ScrollBar.Align := alRight; to
ScrollBar.Left:=510, ScrollBar.Height :=500 , so that scrollbar doesn't
cover any area of  TPaintTest and isn't shown at all. Even in this extreme
case, the whole TPaintTest area is invalidated.

Let me see one more time what's exact problem:

Any visible scrollbar in TCustomControl sends update for whole parent (eg.
form) ? IMO, it's fixable under gtk2lcl by intercepting expose event in
scrollbar and reduce area which is marked as exposed, but then another
question raises , what if I move scrollbar by mouse (and I have already
cutted exposed area to the size of scrollbar) ? My TCustomControl will get
an update since it's viewport is moved ?



Why does a scrollbar invalidate the complete parent area if nothing has
changed for the scrollbar (exposition, location, scroll, mouseclick,...)? 
 
Having the area under the scrollbar marked as exposed isn't an issue, I
think. The parent is aware of the scrollbar position and wouldn't draw
underneath anyways. So, no reason to reduce the exposed area. 
 
Aren't scrollbar mouse movements signaled by special gtk events? That is
where I would expect the whole parent area to be invalidated. How are
windows and gtk solving this? 
 
Ludo
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110709/c8135e74/attachment-0003.html>


More information about the Lazarus mailing list