[Lazarus] Inconsistent ScrolledClientRect calculation

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


 


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

> Mattias Gaertner schrieb:
>
> >  > > Where exactly is TRect used to hold the Width and Height? File and
> > Line.
> >  >
> >  > TControl.GetClientRect
> >  > (controls.inc 1525..)
> >  >
> >  > BoundsRect and ClientRect contain different information, despite the
> >  > similar name and type.
> >
>> >
> > They both return a Left,Top,Right,Bottom.
> >
> > ClientRect Left,Top is 0,0, so Right=ClientWidth and Bottom=ClientHeight.
>
> Is this really consistent with a scrolled client area, inner borders,
> swapped scrollbars in BiDi mode etc.? 
I'm not sure what you mean with "inner borders". 
The ClientRect excludes scrollbars and is relative to the left, top of the
visible client area (so Left,Top are almost always 0,0). So for almost all uses
it is simply the size of the visible area, where a control can paint and gets
mouse events. 
 

 
> But I agree that client areas *could* be described by TopLeft and
> BottomRight points, when the implementation is consistent.
> AFAIR there exist (derived) controls with a client origin <> (0,0)... 
That is possible, but I don't know any.  
 
 
Mattias
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111007/347d8aee/attachment-0003.html>


More information about the Lazarus mailing list