[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Use slider/scale to select extended range

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.