'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim tmr As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim pnl As Panel
Dim anim As Animation
Dim b As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
tmr.Initialize("tmr", 10)
End If
pnl.Initialize("")
Activity.AddView(pnl, 30dip, 30dip, 20%x, 20%x)
pnl.Color = Colors.Blue
anim.InitializeRotate("anim", 0, 359)
anim.Duration = 2000
anim.RepeatCount = -1
anim.RepeatMode = anim.REPEAT_REVERSE
b.Initialize("b")
Activity.AddView(b, 30dip, 100dip, 100dip, 50dip)
b.Text = "click me"
End Sub
Sub b_Click
Log("b_click")
anim.Stop(pnl)
tmr.Enabled = True
End Sub
Sub tmr_Tick
StartActivity(activity2)
End Sub
Sub Activity_Resume
anim.Start(pnl)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
tmr.Enabled = False
anim.Stop(pnl)
End Sub