Mousewheel scrolls the wrong control. windows
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
In Lazarus the mousewheel scrolls the control, under the mouse (rather than the focused one).
In rev
Revision: 54498
Author: ondrej
Date: 29 March 2017 07:36:03
Message:
win32: send unhandled mouse wheel messages also to 2nd level parent. Issue 31608
B:\lazarus_latest_svn_2\lcl\interfaces\win32\win32winapi.inc line 238 maybe more.
code was added, so that a button inside a scrollbox would not block the scrollbox from scrolling. The button does not react to the mousewheel (if the mouse is above it) so the message is passed to the parent (to the scrollbox).
The passed message does not have its x/y adjusted.
In the example (attached) turning the wheel above the upper part of memo2 or button1, will send the mouse wheel messages to the paintbox (watch the forms caption, dots are added).
This is because x/y are relative to the memo (eg x=20, y= 30). For the form the coordinates 20/30 are where the paintbox is.
If you go to the lower part of memo2 or button1, then the form receives coordinates for the scrollbox. But those are not redirected, as the scrollbox is a wincontrol.
THe paintbox is not a wincontrol, so it gets the messages.
-------------------------------
If the message is forwarded to the parent, x/y must be adjusted by the controls Top/Left.
If the control is in a scrollbox, then the scroll offset may have to be taken into account to. (not tested, but a button4.top would be outside of the parents scrollbox.clientrect)
==============================
A 2nd issue may have to be decided.
Scroll the inner scrollbox. When you reached the bottom, it can no longer scroll, so if you continue scrolling, it scrolls the outer scrollbox.
Is that desired? (It may be ok)
Mantis conversion info:
- Mantis ID: 34504