RE: [fltk.general] Scroll without scrollbar - [General Use]

12 views
Skip to first unread message

MacArthur, Ian (Leonardo, UK)

unread,
Mar 9, 2021, 5:25:16 AM3/9/21
to fltkg...@googlegroups.com
> I have a list, currently in a Fl_Scroll. Now I use the scrollbar to move the list up/down.
> I want this to be scrollable by clicking+dragging like I do on my mobile-phone.

> What would be the best approach to achieve this ?

(ASIDE: I'm not clear why you need a scroll to contain your list - an Fl_Browser can contain a list, and will handle scroll bars and etc. "automatically" for you anyway...)

Anyway:

You have to subclass your widget, then in the handle() method catch the drag operations and use them to move the view about...

I was going to say that the "offscreen" test does this, but in fact it doesn’t use a Fl_Scroll as the container so it's not exactly what you want. The basic mechanism would be very similar, though.

Also, Greg's draggable box demo : http://www.seriss.com/people/erco/fltk/#DraggableBoxes address the same sort of thing, though again not using an Fl_Scroll.


"Somewhere" (AKA "on a machine I do not have access too because of lockdown"...) I have some widgets I made for touch interaction, scroll wheels and the like, that again might be useful, but... It is possible I have posted some of those here in the past, but I have no clue what terms to search for!

Leonardo MW Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
Reply all
Reply to author
Forward
0 new messages