Re: Mouse Wheel scrolling in Multiple FXText widgets
[email protected] Fri, 16 May 2025 14:43:03 -0500
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
On 2025-05-16 11:32, Pasquale via Foxgui-users wrote:
> I have 3 FXText widgets and a vertical FXScrollbar in a
> horizontalframe.
>
> I have the code so the scrollbars in the three FXText are hidden, and
> the vertical scrollbar moves all three fxtext areas together when you
> left click on the scrollbar.
>
> My issue is when you mousewheel scroll in 1 of the FXText. They get
> out of sync. I cannot figure out how to handle/capture the wheel mouse
> scroll in a FXText area so I can also code the movement for the other
> 2 FXText widgets and the FXScrollbar as well and stay synced.
>
> Also, moving the mousewheel over the FXScrollbar moves the scrollbar
> but doesn't update the scrolling for the FXText widgets.
>
> I have searched the forum for various phrases and found some
> information, but I was not able to figure it out or fully understand
> what was written. Any help would be greatly appreciated.
Perhaps we should bounce SEL_MOUSEWHEEL events to target prior to
handling it
in the widget, just like we do with Button and Key events. This way,
you can intercept them to handle them differently.
FYI, for most widgets, the sequence of events upon a mouse or keyboard
event is to:
(1) bounce to the widget's target (the message ID is the one from the
widget, not 0 anymore).
(2) if the target didn't handle it [i.e. target->handle() returned 0],
then
continue to handle it.
(3) if the target *did* handle it, end the SEL_MOUSEWHEEL processing
there.
It looks like for some reason the wheel event mostly doesn't get
processed that
way, but this is mot how it works for the other events. All other
events get
bounced to the target first, so that target can override the processing
w/o
having to subclass the widget.
Often, the bounce-processing is conditional; for example in the editor,
the
mouse right-release is only processed if there was no mouse movement
since the
mouse right-press. Then a popup is brought up. If there was a
movement, then
its not intercepted.
-- JVZ