Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-07 Thread Hans-Peter Diettrich
Mattias Gaertner schrieb: > > 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". See e.g. TControl

Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-07 Thread Mattias Gaertner
  Hans-Peter Diettrich 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;

Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-07 Thread Mattias Gaertner
  Hans-Peter Diettrich 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 cont

Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-07 Thread Hans-Peter Diettrich
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 Resu

Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-07 Thread Hans-Peter Diettrich
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,Rig

Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-07 Thread Mattias Gaertner
  Hans-Peter Diettrich hat am 7. Oktober 2011 um 11:52 geschrieben: > Felipe Monteiro de Carvalho schrieb: > > On Fri, Oct 7, 2011 at 6:34 AM, Hans-Peter Diettrich > > wrote: > >> The ambiguous use of TRect, with either BottomRight or WidthHeight in the > >> second TPoint, often leads to misu

Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-07 Thread Felipe Monteiro de Carvalho
On Fri, Oct 7, 2011 at 11:52 AM, Hans-Peter Diettrich wrote: > TControl.GetClientRect > (controls.inc 1525..) wow, what a nasty thing =D I was using it wrongly myself. Unfortunately it is Delphi-compatible: http://docwiki.embarcadero.com/VCL/en/Controls.TControl.ClientRect -- Felipe Monteiro

Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-07 Thread Hans-Peter Diettrich
Felipe Monteiro de Carvalho schrieb: On Fri, Oct 7, 2011 at 6:34 AM, Hans-Peter Diettrich wrote: The ambiguous use of TRect, with either BottomRight or WidthHeight in the second TPoint, often leads to misunderstandings and flawed code (as above). It were helpful when type alias would be introdu

Re: [Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-06 Thread Felipe Monteiro de Carvalho
On Fri, Oct 7, 2011 at 6:34 AM, Hans-Peter Diettrich wrote: > The ambiguous use of TRect, with either BottomRight or WidthHeight in the > second TPoint, often leads to misunderstandings and flawed code (as above). > It were helpful when type alias would be introduced and used, or when the > argume

[Lazarus] Inconsistent ScrolledClientRect calculation

2011-10-06 Thread Hans-Peter Diettrich
TControl.ScrolledClientRect offsets *all* fields in the TRect by the scroll offsets. This is *incorrect*, when the TRect is initialized to ClientRect, where the second set of coordinates is the Width and Heigth, not the BottomRight corner of the area. Obviously Width and Height are insensitive