Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private s1, s2 As Slider
Private syncTimer As Timer
Private timerCounter As Int
Private targetValue As Int
Private eventSource As Node
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
s1.Initialize("s1")
MainForm.RootPane.AddNode(s1, 10, 0, 300, 100)
s2.Initialize("s2")
MainForm.RootPane.AddNode(s2, 10, 100, 300, 100)
syncTimer.Initialize("SyncTimer", 10)
End Sub
Sub SyncTimer_Tick
If timerCounter >= 2 Then
If eventSource <> s1 Then s1.Value = targetValue
If eventSource <> s2 Then s2.Value = targetValue
syncTimer.Enabled = False
Else
timerCounter = timerCounter + 1
End If
End Sub
Sub StartEvent(source As Node, value As Int)
If syncTimer.Enabled AND source <> eventSource Then
Return
End If
eventSource = source
timerCounter = 0
targetValue = value
syncTimer.Enabled = True
End Sub
Sub s1_ValueChange (Value As Double)
StartEvent(Sender, Value)
End Sub
Sub s2_ValueChange (Value As Double)
StartEvent(Sender, Value)
End Sub