Luiz Americo Pereira Camara wrote:
While debugging scrolling bugs in LCL i found that ClientToScreen acts differently according to the widget set.

These are the behaviors:

1) The returned value is related to the actual position, i.e., it does not consider the scroll offset. If you pass Point(0,0) the value will be the same regardless of the scroll position. (Gtk1)

2) The returned value is related to the virtual position, i.e, it takes into account the scroll offset. If you pass Point(0, 0) the value changes inversely to scrollbar position. (Gtk2) 3) The returned value is related to the virtual position, i.e, it takes into account the scroll offset. If you pass Point(0, 0) the value changes the same amount of scrollbar position. (Win32)

4) Nothing. Qt has no visible scrollbars so...

Notes:

Delphi does the same as (1)/Gtk1

Not really, internally Delphi does it like 2. All controls are moved.


(3) is clearly buggy.

Between (1) and (2) is a design decision.

We started like delphi, move controls and report corrected values when asked. However this aproach is very inefficient on all widgetsets except win32. So the new approach is that controls stay at their position and only the "virtual parent" gets an offset. This means that the top/left of a control on a say scrollbox are allways the same, an offset to the "virtual parent" top/left.

So now ClientToScreen.
The top/left of a scrolled control needs to get a scrolled offset, so that is reflects the "real" position relative to the "real" parent of the control.

Marc




Attached is a patch that makes win32 acts like (2)/gtk2. It changes the offset signal when calculating the LCL bounds. With the change it becomes consistent with the TCustomGroupBox signal convention (LCL bounds at Right/Down of win32 +, at Left/Up -).
It also fixes the scrolling paint and setcursor of non TWincontrol.

Luiz




_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to