[Lazarus] OnMouseWheel[Down/Up] support in TControl (patch included)

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Jun 8 22:54:59 CEST 2008


On Sat, 7 Jun 2008 14:11:27 +0300
"Kostas Michalopoulos" <badsector at slashstone.com> wrote:

> > In your example the gtk sends the message to Form1 and
> > TWinControl.IsControlMouseMsg sends it further to TPaintBox.
> >
> > Where does the win32 interface send the wheel messages to?
> 
> Ok, after this discussion i think i figured out whats wrong: Win32
> does indeed send the message to TForm (much like GTK does, as you
> say) *but* the coordinates are in screen space, not client space
> (which explains the incorrect translation i mentioned in my original
> post), so the IsControlMouseMsg thinks that the message is for TForm
> instead of TPaintBox because it gets incorrect coordinates (the rest
> of LCL seems to think that wheel messages are always in client
> space). Bringing them in client space when the WM_MOUSEWHEEL event
> decides that this is a message for us (at the end of the message
> handling in 'case') produces the correct behaviour for the test
> program (and my 3D app) under Windows. Also the received coordinates
> are in the same space with the rest of the mouse events.
> 
> I attached a patch against revision 15355 that does exactly that.
> This patch is in the Windows callback function, so the problem is
> probably now fixed where it began from.

I created a bug report for this:
http://bugs.freepascal.org/view.php?id=11442

Mattias



More information about the Lazarus mailing list