Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

OnMouseWheel event issue

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Birger Jansen

Hi all,

I have a TPanel on a TForm and an event on the TForm.OnMouseWheel. This works when I use the mousewheel on the form. But as soon as the cursor is over the TPanel, the OnMouseWheel event on the parent form is not triggered. Since the TPanel has no OnMouseWheel there is no way to use a mousewheel on a panel.

In Delphi, the TPanel passes the event to the parent control (TForm).

Shall I report a bug or is this designed behaviour? I think it relates to this: http://bugs.freepascal.org/view.php?id=12361

Kind regards,
Birger Jansen

Reply by email

Vincent Snijders
to Birger Jansen

2010/11/19 Birger Jansen :

Show quoted text 9 lines
Hi all, I have a TPanel on a TForm and an event on the TForm.OnMouseWheel. This works when I use the mousewheel on the form. But as soon as the cursor is over the TPanel, the OnMouseWheel event on the parent form is not triggered. Since the TPanel has no OnMouseWheel there is no way to use a mousewheel on a panel. In Delphi, the TPanel passes the event to the parent control (TForm). Shall I report a bug or is this designed behaviour? I think it relates to this: http://bugs.freepascal.org/view.php?id=12361

What you describe is the same as the issue above.

Vincent

Reply by email

And3mD
to Birger Jansen: I have a TPanel on a TForm and an event on the TForm.OnMouseWheel. This works when I use…

Hello!

Some time ago I have the same problem.
Unfortunately this is windows design.

When you scroll then:
If focused control supports scrolling its get WM_MOUSEWHELL message, if it not support scrolling message is send to focused control parent.

To handle this message in Lazarus you must use SetWindowLong or SetWindowLongPtr something like this:

http://wiki.freepascal.org/Win32/64_Interface#Processing_non-user_messages_in_your_window

Greetings
Andrzej Kilijanski

Dnia 19-11-2010 o 10:03:58 Birger Jansen napisa?(a):

Show quoted text 21 lines
Hi all, I have a TPanel on a TForm and an event on the TForm.OnMouseWheel. This works when I use the mousewheel on the form. But as soon as the cursor is over the TPanel, the OnMouseWheel event on the parent form is not triggered. Since the TPanel has no OnMouseWheel there is no way to use a mousewheel on a panel. In Delphi, the TPanel passes the event to the parent control (TForm). Shall I report a bug or is this designed behaviour? I think it relates to this: http://bugs.freepascal.org/view.php?id=12361 Kind regards, Birger Jansen -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email