[Lazarus] Mouse wheel scroll bar increment size?

Bruce Tulloch bruce at causal.com
Mon Jun 29 16:40:42 CEST 2009


Vincent Snijders wrote:
> I am confused, do you want to use the scrollbar for scrolling or the
> mouse wheel?
I want to use the scrollbar because it provides visual feedback about
the location of the section of the visible data in a larger buffer of
displayable data. I prefer that the scrollbar perform this function
regardless of whether the mouse wheel is moved (with the mouse pointer
hovering over the scrollbar) or the scrollbar handle is dragged with the
mouse or the arrow or page up/down buttons are used. All methods should
to the same thing; move the data display in response to scrollbar events.
> If you want to use the mouse wheel, then use one of the OnMouseWheel*
> events.
I can see that this is possible (at the application level) but it
complicates the software design to have to handle these independently of
the scrollbar (events from which are the canonic source of movement
control in this application).
> If you want to use the scrollbar, use the events of the scrollbar, if
> necessary.
This is what I'd like to do but the problem is that the scale at which
the scrollbar moves in response to mousewheel events does not seem to be
under my control (via properties or events of TScrollBar) other than via
some rough relationship to PageSize. I can't set PageSize arbitrarily
(to control the mousewheel movement scaling) because it's also used to
indicate how much of the available data is being displayed at the
present time.
> If you don't handle the mouse wheel events, then the LCL widgetset
> interface or the underlying widget may translate the mousewheel to a
> scroll message.
This it indeed does (in GTK2 and Win32 at least). It's just not clear
the mechanism by which the widget decides how far to move the scrollbar
for each mousewheel event it translates.

Cheers, Bruce.




More information about the Lazarus mailing list