Sub Globals
Dim a(500) As Panel
Dim swork As String
Dim myclick As esClickSound
Dim vibrate As PhoneVibrate
Dim cd_unpressed As ColorDrawable
Dim cd_pressed As ColorDrawable
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("p")
cd_pressed.Initialize( Colors.ARGB(255, 50, 50, 250), 50dip)
cd_unpressed.Initialize( Colors.ARGB(30, 50, 50, 250), 25dip)
myclick.Initialize 'just a clicker routine I found
Dim i As Int = 0
For k = 0 To 25
For j = 0 To 18
swork = i 'button identifier (array number)
a(i).Initialize("buttons") ' Where to go when clicked
Activity.AddView(a(i),j * 41dip, k * 41dip, 40dip, 40dip) ' create view at left, top, width, height
a(i).Tag = swork & " ;" ' add a delimier to make finding the cell number easier in the tag
a(i).Background = cd_unpressed ' set unpressed color/alpha
i = i + 1
Next
Next
DoEvents
End Sub
Sub buttons_click
Dim p As Panel
Dim t As String
Dim nwork As Int
p = Sender
t = p.Tag
nwork = t.SubString2(0,3)
a(nwork).Background = cd_pressed ' show pressed
DoEvents ' make sure it shows up
vibrate.vibrate(25) ' make buzz
myclick.standardfx(1) ' make noise
Sleep(20) ' give a little time for things to settle on the screen
a(nwork).Background = cd_unpressed ' now, put it back to unpressed state
Log("hit " & nwork)
End Sub