I have a little problem and maybe someone can point me in the right direction.
Global win:TGadget=CreateWindow("test",50,50,286,154,0,9)
Global tb:TGadget=CreateSlider(142,60,10,20,win,SLIDER_STEPPER)
SetSliderRange tb,-1000,1000
SetSliderValue tb,0
Global text:tgadget = CreateTextField(40 , 60 , 100 , 20 , win)
Repeat
Select WaitEvent()
Case EVENT_GADGETACTION
Select EventSource()
Case tb
SetStatusText win , Float(EventData() ) / 100.0
SetGadgetText text, Float(EventData() ) / 100.0
Case text
SetStatusText win, "Slider: "+Float(EventData())/100+" New: "+GadgetText(text).tofloat()
SetSliderValue tb , GadgetText(text).tofloat()*100
RedrawGadget tb
End Select
Case EVENT_WINDOWCLOSE
Exit
End Select
Forever
End
Basically I want that when the user press the stepper the value is shown in the textfield - and THIS works ok. But I want too that when the user types in textfield a new value the Stepper will change its own 'position'...and this is the problem! Second problem: type 0 in the textfield, then press the stepper DOWN, you will see a value starting from 655.349976 and so on...a little different from what I want. My question is: there are limit in the SetSliderRange value?
Byez
|