Sub Process_Globals
End Sub
Sub Globals
Private AppScreens(3) As Panel
Private CurrScreen As Int = 0
End Sub
Sub Activity_Create(FirstTime As Boolean)
CreatePanels
End Sub
Sub Activity_Resume
ShowCurrentScreen
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Private Sub CreatePanels
Dim piIndex As Int
Dim psTag As String
' I create layouts for each panel, saved in the format "layPanel_##"
For piIndex = 0 To AppScreens.Length - 1
psTag = NumberFormat2(piIndex, 2, 0, 0, False)
AppScreens(piIndex).Initialize("AppPanel" & psTag)
Activity.AddView(AppScreens(piIndex), 0, 0, Activity.Width, Activity.Height)
AppScreens(piIndex).LoadLayout("layPanel_" & psTag)
' Set panel tag to our index value so we can compare against it in the show screen method
AppScreens(piIndex).Tag = piIndex
Next
End Sub
Private Sub ShowCurrentScreen
For Each poPan As Panel In AppScreens
If poPan.Tag = CurrScreen Then
poPan.Visible = True
poPan.BringToFront
Else
poPan.Visible = False
End If
Next
End Sub