FLTK logo

Re: [RFE] STR #3521: Allow shift+scroll for horizontal scrolling

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.bugs  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [RFE] STR #3521: Allow shift+scroll for horizontal scrolling Albrecht Schlosser May 05, 2019  
 
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: https://www.fltk.org/str.php?L3521
Version: 1.4-feature


Some thoughts about possible implementations:

A very simple implementation of this feature would be that a vertical
scrollbar would use the scroll event only if the shift key is currently NOT
pressed and a horizontal scrollbar would use the event only if the shift
key IS pressed.

However, this could break existing programs - for instance if there is only
one (horizontal) scrollbar which would usually react on all scroll events,
no matter if the shift key is actually pressed or not.

We could instead restrict only horizontal scrollbars to use the SHIFT
state, but the order of event delivery is significant: order of children in
a group, or from nested groups to parent groups if one group ignores the
event. The latter is typical behavior so scrollbars can catch events that
are delivered to inner groups and propagated to parent (outer) groups. In
this case the vertical scrollbar could also consume the event even if the
shift key is pressed because it is the first scrollbar child of a group.

Possible solutions:

(1) make sure that vertical scrollbars are always first in a group. This is
not always true in FLTK's Fl_Scroll widget and would IMHO be too hard a
restriction for user programs.

(2) add a flag to the Fl_Scrollbar widget that must be set if the
particular scrollbar uses the shift key to determine whether it shall use
or ignore the scroll event.

Solution (2) needs code changes but would be 100% backwards compatible.

That said, I believe that (2) would be an acceptable solution, but all
comments and proposals for better implementations would be appreciated.


Link: https://www.fltk.org/str.php?L3521
Version: 1.4-feature


Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.