I have a slider, range from 0 to 10, but the number of marks that under the slider are one less than the highest value. I tried different max value, but the marks are always one less.
Is this done on purpose?
Thanks!
Number of slider marks not match with the scale
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Dear proza,
I don't know why, but Revolution always creates one tick too few and it doesn't allow you to create ticks at distances that are unequal to an integer.
To solve the problem as well as possible, create a slider with startValue 0 and endValue 10, just as you did. Type 0.909 in the message box or in a field and copy the number. Open the property inspector and paste 0.909 in the pageInc field (labeled "On bar click"). You can also set this property by entering the following in the message box:
set the pageInc of scrollbar 1 to 0.909
and hitting enter. Now, when the thumb is on a tick, it will show the right value.
Best,
Mark
I don't know why, but Revolution always creates one tick too few and it doesn't allow you to create ticks at distances that are unequal to an integer.
To solve the problem as well as possible, create a slider with startValue 0 and endValue 10, just as you did. Type 0.909 in the message box or in a field and copy the number. Open the property inspector and paste 0.909 in the pageInc field (labeled "On bar click"). You can also set this property by entering the following in the message box:
set the pageInc of scrollbar 1 to 0.909
and hitting enter. Now, when the thumb is on a tick, it will show the right value.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Proza,
The formula I use is simple:
but it is not perfect. Sometimes, you will get one tick too many and you will have to adjust the number. Also, the number of pixels between the ticks may be varying, which is ugly.
The theory is that you need one tick extra, but I believe the problem is that Revolution smuggles to get the number below the thumb right. It shows the value for the next tick a fraction too early each time while the thumb is moved from the left to the right, to get the correct value displayed when it arrives at the last tick. So, maybe someone will come up with a better formula.
Mark
[/code]
The formula I use is simple:
Code: Select all
(endValue - startValue)
-------------------------------
(endValue - startValue + 1)
= (10 - 0) / 11
The theory is that you need one tick extra, but I believe the problem is that Revolution smuggles to get the number below the thumb right. It shows the value for the next tick a fraction too early each time while the thumb is moved from the left to the right, to get the correct value displayed when it arrives at the last tick. So, maybe someone will come up with a better formula.
Mark
[/code]
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode