Wouldn't it be fine, if PB would be able to handle also three state boxes automatically?
Code: Select all
Procedure SetGadgetThreeState(Gadget,Value,*State.Integer=0)
If Value=2
Value=-1
EndIf
SetGadgetState(Gadget,Value)
If *State
*State\i=Value
EndIf
ProcedureReturn value
EndProcedure
*** Initialization ***
OptFatLineState=0
SetGadgetState(#OptFatLine,OptFatLineState)
*** Event-Handling ***
Case #PB_Event_Gadget,#PB_Event_Menu
Select EventGadget()
:
Case #OptFatLine
OptFatLineState=(OptFatLineState+1)%3
SetGadgetThreeState(#OptFatLine,OptFatLineState)