'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 Width, Height As Int :Width=30 :Height=30
Dim WordLength As Int :WordLength = 3
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 clv1 As CustomListView
Dim Panel2, GuessedWordPanel As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("TestCustListView")
clv1.Initialize(Me, "clv1")
Panel2.Color = 0x20FFFFFF '130114 Colors.Transparent
Panel2.Visible = True '130114
'Panel2.LoadLayout("guessedwordpanel") '130114
Panel2.AddView(clv1.AsView, 0, 0, Panel2.Width, Panel2.Height)
For i = 0 To 39
clv1.Add(CreateListItem("Item #" & i, clv1.AsView.Width, 50dip), 50dip, "Item #" & i)
WordLength = WordLength + 1
If WordLength > 7 Then
WordLength = 3
End If
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub CreateListItem(myText As String, myWidth As Int, myHeight As Int) As Panel
Dim p As Panel
Dim lbl As Label
p.Initialize("")
p.LoadLayout("guessedwordpanel")
'GuessedWordPanel.Initialize("")
p.Visible = True
For i = 0 To 8
lbl.Initialize("")
lbl = GuessedWordPanel.GetView(i) 'was p.GetView(i) '130114
If i < WordLength Then
lbl.Left = (i*30)+((8-WordLength)*15)
lbl.Top = 7
lbl.Visible = True
Else
If i>6 Then
lbl.Left = i*30+30
lbl.Top = 7
lbl.Visible = True
Else
lbl.Visible = False
End If
End If
Next
Return p
End Sub