views:

204

answers:

2

I have an HSlider with a minimum of 1 and a maximum of 6. Is there a way I can disable the range 3 - 6, so the user can only select from the range 1-3 on the slider.

Note: Your first thought might be to tell me to set the maximum to 3. I dont want to change the maximum to 3, I want the user to know there is more, but currently not selectable.

Thanks!!

A: 

You can create a listener for the CHANGE event. When it sees that the new slider position is greater than 3, you can reset the slider to 3.

CookieOfFortune
+2  A: 

I would try to override the getValueFromX method in Slider. It's marked mx_internal, so you'll need to add the necessary import and use statements.

As with the Event.CHANGE suggestion, it won't show a disabled UI for the remainder of the track, which would be ideal. For that you'll need to override more of Slider or draw your own component.

Michael Brewer-Davis