Trackbar and float

BlitzMax Forums/BlitzMax Programming/Trackbar and float

Kingo(Posted 2006) [#1]
Hello,

it is possible to make a trackbar including float value in the maxgui ?

Thanks ;)


EOF(Posted 2006) [#2]
You could convert the EventData() to a float and divide the result ..
' trackbar with float value

Global win:TGadget=CreateWindow("trackbar",50,50,286,114,0,9)
Global tb:TGadget=CreateSlider(40,24,192,21,win,SLIDER_TRACKBAR|SLIDER_HORIZONTAL)
SetSliderRange tb,0,1000
SetSliderValue tb,25

SetStatusText win,"(move slider)"

Repeat
	Select WaitEvent()
		Case EVENT_GADGETACTION
			Select EventSource()
				Case tb
				SetStatusText win,Float(EventData())/100.0
			End Select
		Case EVENT_WINDOWCLOSE
			Exit
	End Select
Forever

End



Kingo(Posted 2006) [#3]
yeah :)

Great

Thanks :)