Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Use slider/scale to select extended range
Use slider/scale to select extended range [message #463051] Wed, 26 October 2005 08:24 Go to next message
ian mayo is currently offline ian mayoFriend
Messages: 17
Registered: July 2009
Junior Member
Hi all.
I'm using a scale to allow user-control of time. It works just fine.

I'd like to introduce a user control/controls to allow users to select a
period of time (start/stop points).

I picture a UI whereby the user holds down the shift-key and drags the
scale, with the selected portion of the scale appearing shaded/highlighted.

This functionality doesn't appear to be in the API, and the scale widget
isn't meant to be sub-classed (wherein I could implement my chosen
behaviour - even though I'd rather not...).

Can anybody provide me with any pointers?

Cheers,
Ian.
Re: Use slider/scale to select extended range [message #463052 is a reply to message #463051] Wed, 26 October 2005 09:36 Go to previous message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
Not sure this will work but you can try...

Try adding a PaintListener to the scale and paint the shaded region on
top of it. You have to make sure that your painter is called after the
component is rendered. (Not sure how you can achieve this but maybe
somebody else does!)
The trick is to know where to start drawing and where to stop. Look into
the scale component to see how you can determine the points.

Hope that helps and report back if you get it to work

Stefan

Ian Mayo wrote:
> Hi all.
> I'm using a scale to allow user-control of time. It works just fine.
>
> I'd like to introduce a user control/controls to allow users to select a
> period of time (start/stop points).
>
> I picture a UI whereby the user holds down the shift-key and drags the
> scale, with the selected portion of the scale appearing shaded/highlighted.
>
> This functionality doesn't appear to be in the API, and the scale widget
> isn't meant to be sub-classed (wherein I could implement my chosen
> behaviour - even though I'd rather not...).
>
> Can anybody provide me with any pointers?
>
> Cheers,
> Ian.
>
Previous Topic:Multiple Selection for CheckboxTreeViewer
Next Topic:adding links to treeviewer using providers
Goto Forum:
  


Current Time: Sun Sep 22 20:15:24 GMT 2024

Powered by FUDForum. Page generated in 0.03395 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top