Hi all
i have a spingadget that must be increased/decreased by decimal factor
like 
0,0.1,0.2,0.3 ... (till 1)
another that go from -1 to +1 (-1,-0.9,-0.8..,0,+0.1,0.2..,1)
and another that go from -100 to +100 (-100,-99,-98,..,0,1,2,..,100)
any tips?
thanks !
BHH
			
			
									
									
						[Newby] Spingadget and decimal value
Perhaps one way !
			
			
									
									Code: Select all
  If OpenWindow(0,0,0,140,120,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"SpinGadget") And CreateGadgetList(WindowID(0))
    SpinGadget     (0,20,20,100,25,0,10)
    SpinGadget     (1,20,50,100,25,0,20)
    SpinGadget     (2,20,80,100,25,0,200)
    
    SetGadgetState (0,0) : SetGadgetText(0,StrF(GetGadgetState(0),2))   ; set initial value
    SetGadgetState (1,0) : SetGadgetText(1,StrF((GetGadgetState(1)-10)/10,2))   ; set initial value
    SetGadgetState (2,0) : SetGadgetText(2,StrF((GetGadgetState(2)-100)/10,2))   ; set initial value
    
    Repeat
      Event = WaitWindowEvent()
      If EventGadgetID() = 0
        Spin_0.f = GetGadgetState(0)/10
        SetGadgetText(0,StrF(Spin_0,2))
      ElseIf EventGadgetID() = 1
        Spin_1.f = (GetGadgetState(1)-10)/10
        SetGadgetText(1,StrF(Spin_1,2))
      ElseIf EventGadgetID() = 2
        Spin_2.f = (GetGadgetState(2)-100)
        SetGadgetText(2,StrF(Spin_2,2))
        
        WindowEvent()
      EndIf
    Until Event = #PB_Event_CloseWindow
  EndIfMy english is bad !!!... It's normal, i'm french  
My english is not really the English.
It's the FrogLish (Froggy's English)
						My english is not really the English.
It's the FrogLish (Froggy's English)

