FLTK logo

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

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.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

RE: Scroll without scrollbar - [General Use] "'MacArthur, Ian (Leonardo, UK)' via fltk.general" Mar 09, 2021  
 
> 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.
********************************************************************

-- 
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/16e5b6813de742c382d6c8b1c111950e%40leonardocompany.com.
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'.