Please take a look at the tiny example below. There is a problem with the increment - if you press the left button for a while. You can see that the increment is changed to 5 (40-45-50...) instead of 1 (41-42-43...). Does anyone know how to get rid of that behaviour? I need to have +1 increment always, no matter how long a user presses the SpinGadget.
Edit: ...or even force a user to press spingadget each time he wants to increase the value, e.g. disable autoincrement at all.
Code: Select all
If OpenWindow(0,0,0,140,70,"SpinGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
SpinGadget (0,20,20,100,25,0,1000)
SetGadgetState (0,5) : SetGadgetText(0,"5") ; set initial value
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 0
n.l = GetGadgetState(0)
SetGadgetText(0,Str(n))
Debug n
WindowEvent()
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf