Sub Process_Globals
Dim ButtonsText(30) As String
End Sub
Sub Globals
Dim Buttons(30) As Button
Dim KeyLegends As String :KeyLegends = "QWERTYUIOPASDFGHJKLZXCVBNM"
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Create QWERTY Keyboard
Dim width, offsetX, offsetY As Int
width = 35dip
For i = 0 To 25
If i<10 Then
offsetX = (100%x - (10-i) * (width-8) - 20)
offsetY = 100%y - width * 3 - 8
Else If i<19 Then
offsetX = (100%x - (20-i) * (width-8))
offsetY = 100%y - width * 2 - 10
Else
offsetX = (100%x - (28-i) * (width-8) - 5)
offsetY = 100%y - width - 12
End If
Dim b As Button
b.Initialize("button") 'All buttons share the same event sub
b.TextSize = 12
'b.Color = Colors.RGB(0,0,255)
'b.textColor = Colors.RGB(0,0,0)
b.Tag = KeyLegends.SubString2(i,i+1)
b.Text = b.Tag
Activity.AddView(b,offsetX, offsetY, width, width)
Buttons(i) = b 'store a reference to this view
Next
End Sub