Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
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.
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("Layout1")
'creo bottoni!
For i = 0 To 8
Dim But As Button
But.Initialize("MyMenuButton")
But.Text = ""
But.Tag = i
But.TextSize=15
But.TextColor=Colors.Blue
But.text= "BUT" & i
Select Case i
Case 0
But.Text="MAP"
Case 1
But.Text= "MAP OFF"
Case 2
But.Text= "MAP FULL"
Case 3
But.Text="CROSS"
Case 4
But.Text="RELOD WP"
Case 5
But.Text="WP FIT"
Case 6
But.Text="CANC NAVI"
Case 7
But.Text="CANC WP"
Case 8
But.Text="TRAK"
End Select
'MyMenuButton(i) = But'
If i=0 OR i=1 OR i=2 Then
Activity.addView(But,i*80dip ,1dip,80dip, 80dip)
End If
If i=3 OR i=4 OR i=5 Then
Activity.addView(But,(i-3)*80dip ,85dip,80dip, 80dip)
End If
If i=6 OR i=7 OR i=8 Then
Activity.addView(But,(i-6)*80dip ,165dip,80dip, 80dip)
End If
Next
Activity.Height=(But.Height*9)+1dip
Activity.Width=Activity.Width
Activity.Color=Colors.Transparent
End Sub
'il tuo menù
Sub MyMenuButton_Click
Dim Send As Button
Send = Sender
Log(Send.Tag)
Msgbox("",Send.Tag)
End Sub