Page 1 of 1

PostPosted: Wed Apr 18, 2007 11:47 am
by sjordi
I have a slider on my form and want it to update the screen
as-I-slide-it. It seems to me that it works like the ondone
I want to change a value in a field while dragging the handle.
Moving it to the right would update a field with the current
slider position.
In my test, the value is updated in my field control only when
I release the handle.
Any idea?
Actually it's to draw a line that would move while following
the slider handle.
Thanks for any help

Prangins, Switzerland

PostPosted: Wed Apr 18, 2007 12:04 pm
by Rudi
Understanding your problem right ...
you have:
1 Slider,
1 Field.

On moving the Slider arround, you wanna do anything:
Yes, the right event is

int n;
handler myslider.onmove() {
//TODO: handle event
n ++;
myfield.text = n;

Thats work great, by moving the slider around, the counter (n) increments fine.

But what you want really?
You want to put the sliders actual value in the field, like this:

myfield.text = myslider.value;

uhoh ... the sliders value seems only valid AFTER moving and not by moving arround.


PostPosted: Wed Apr 18, 2007 2:23 pm
by sjordi
Yes, I need to update the value WHILE moving the slider, not AFTER.
Having this AFTER is not different than the ondone() event...

Prangins, Switzerland

PostPosted: Wed Apr 18, 2007 3:31 pm
by FrankG
What happens if you do this?
handler myslider.onmove() {
myfield.text = myslider.value;
myfield.visible = true;


PostPosted: Thu Apr 19, 2007 2:12 am
by dewey
In the onmove handler, the current slider value is in event.value.

PostPosted: Thu Apr 19, 2007 4:23 am
by sjordi
the visible=true doesn't change anything.

But dewey is right, if I set

lblSlider.text = event.value ;

then it correctly displays the value AS I MOVE it.

Thanks dewey.

Prangins, Switzerland