Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
AlexXF
Posts: 287
Registered: ‎03-10-2010
My Carrier: Vodafone CZ
Accepted Solution

Slider with integer values only?

I want to create slider that accepts integer values only.

 

For example: from 1.0 to 5.0, step: 1.0

 

How to do this?

Please use plain text.
Developer
tonygluk
Posts: 30
Registered: ‎11-06-2012
My Carrier: MegaFon

Re: Slider with integer values only?

In a word, DIY :smileyhappy: There is no integer slider in Cascades.

Wrap the standard floating-point (continuous) Slider into you own class.
Listen to the valueChanged(float) and immediateValueChanged(float) signals.
Emit your own signals when slider moves from one discrete value to another.
Fix continuous slider position to the nearest discrete value in the valueChanged(float) signal handler.

For each continuous slider position you'll need to find the nearest discrete value.

Please use plain text.