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

Armin Diehl ad at ardiehl.de
Sat Jul 9 16:25:58 CEST 2011


Hi Ludo,

  have tried setting the parent of the scrollbar to panal1 and this 
works fine.

Many thanks for the solution.



> 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
>
> constructor TPaintTest.Create(AOwner: Tcomponent; ParentControl:
> TWinControl);
> begin
>     inherited Create(AOwner);
>     self.Parent:=ParentControl;
>     self.width := 500; self.height := 500;
>
>     ScrollBar:= TScrollBar.Create(Self);
>     ScrollBar.Kind := sbVertical;
>     ScrollBar.left:=self.width+self.left;
>     ScrollBar.height :=self.height+self.top;
>     ScrollBar.LargeChange := 100;  ScrollBar.Max := 1000;
>     ScrollBar.Parent := ParentControl;
>
>     t := TTimer.create(self);  t.interval := 1000;
>     t.onTimer := @invalidateTest;  t.enabled := true;
> end;
>
> Create it as t:=TPaintTest.Create(self,panel1);
>
> Downside is that you have to create the code to move/resize the scrollbar
> when TPaintTest moves or resizes.
>
> Ludo
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


-- 

----------------
GrĂ¼sse
Armin Diehl
ad at ardiehl.de





More information about the Lazarus mailing list