Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private chk1 As CheckBox
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
chk1.Initialize("chk1")
MainForm.RootPane.AddNode(chk1, 10, 10,50, 50)
End Sub
Sub MainForm_MouseClicked (EventData As MouseEvent)
SetCheckState(chk1, Not(chk1.Checked))
End Sub
Sub SetCheckState(chk As CheckBox, state As Boolean)
If IsNumber(chk.Tag) = False Then chk.Tag = 0
chk.Tag = chk.Tag + 1
If chk.Checked <> state Then chk.Checked = state
End Sub
Sub chk1_CheckedChange(Checked As Boolean)
If IsNumber(chk1.Tag) AND chk1.Tag > 0 Then
chk1.Tag = chk1.Tag - 1
Return
End If
Log("User changed state: " & Checked)
End Sub