[Lazarus] Inconsistent ScrolledClientRect calculation

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Oct 7 13:06:20 CEST 2011


 


Hans-Peter Diettrich <DrDiettrich1 at aol.com> hat am 7. Oktober 2011 um 13:33
geschrieben:

> Mattias Gaertner schrieb:
>
> > ClientRect Left,Top is 0,0, so Right=ClientWidth and Bottom=ClientHeight.
>
> What about the determination of the ScrollOffset:
>
> function TScrollingWinControl.GetClientScrollOffset: TPoint;
> begin
>    if (HorzScrollBar <> nil) and (VertScrollBar <> nil) then
>    begin
>      Result.X := HorzScrollBar.Position;
>      Result.Y := VertScrollBar.Position;
>    end else
>    begin
>      Result.X := 0;
>      Result.Y := 0;
>    end;
> end;
>
> Does a scrolling control really *always* have two or zero scrollbars? 
Yes.
During Creation and Destruction they may have less than two. 
They have a Visible property. 
 

> If so, a check of only one scrollbar would be sufficient,
> otherwise every scrollbar must be checked individually! 
Mattias
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111007/df1cef91/attachment-0003.html>


More information about the Lazarus mailing list