Page 1 of 1
slider unexpected behavior
Posted: Thu Sep 09, 2010 10:36 am
by jmburnod
Hi,
I have two scrollbar identical, scrB1, scrB2
Orientation : horizontal
Style : scale
Width = 100
Height = 42
Starvalue = 1
EndValue = 100
ShowValue : true
PageInc = 10
They have an unexpected behavior, i can't get some value with the slider
scrB1 jump 3
scrB2 jump 10
Best
Jean-Marc
Re: slider unexpected behavior
Posted: Thu Sep 09, 2010 11:56 am
by Klaus
Hi Jean-Marc,
sorry, I don't get it, what exactly is the problem?
Re: slider unexpected behavior
Posted: Thu Sep 09, 2010 12:09 pm
by bn
Hi Jean-Marc,
I think this is due to the fact that Rev internally does a floating point operation and you have a rounding error because the width of the scrollbar is the same as the endvalue. To see this effect you can put
Code: Select all
on scrollbarDrag
set the numberformat to ".###"
put the thumbposition of me + 0
end scrollbarDrag
into the scrollbar.
To change this behavior you will have to set the width to something bigger then 100. A width of 130 gets rid of this in my trials. Setting the thumbposition by script works for width of 100.
regards
Bernd
Re: slider unexpected behavior
Posted: Thu Sep 09, 2010 1:39 pm
by bn
Jean-Marc,
if you look at the slider closely it turns out that at a width of 100 the actual width of the marks is smaller. As soon as you set the width of scrollbar to a width that equals 100 pixel for the marks then you get the correct behavior.
So the width of the scrollbar in the inspector is not the width of the "scrolling" line. No wonder there are "rounding errors".
regards
Bernd
Re: slider unexpected behavior
Posted: Thu Sep 09, 2010 4:00 pm
by jmburnod
Klaus,
Bernd explane the trouble in his post
With a width 152 the slider work fine
Best
Jean-marc
Re: slider unexpected behavior
Posted: Thu Sep 09, 2010 5:21 pm
by Klaus
Hi friends,
yep, got it now

Re: slider unexpected behavior
Posted: Thu Sep 09, 2010 9:45 pm
by jmburnod
Yes Klaus,
With the german staff i can go far
All the best
Jean-Marc