Sub Globals
Dim TransparentPanelOnTop As Panel
Dim Button1 As Button
Dim Button2 As Button
Dim Label1, Label2 As Label
Dim PositionX As Float
Dim PositionY As Float
End Sub
Sub Activity_Create(FirstTime As Boolean)
Label1.Initialize("Label1")
Button1.Initialize("Button1")
Button2.Initialize("Button2")
TransparentPanelOnTop.Initialize("TransparentPanelOnTop")
Label1.Text = "Waiting dor click..."
Button1.Text = "I am a Button1 CLICK ME"
Button2.Text = "I am a Button2 CLICK ME"
Activity.AddView(Label1, 10dip, 10dip, Activity.Width - 20dip, 60dip)
Activity.AddView(Button1, 10dip, 100dip, Activity.Width - 20dip, 60dip)
Activity.AddView(Button2, 10dip, 180dip, Activity.Width - 20dip, 60dip)
Activity.AddView(TransparentPanelOnTop, 0, 0, 100%x, 100%y)
TransparentPanelOnTop.Color = Colors.Transparent
TransparentPanelOnTop.BringToFront
Dim rf As Reflector
rf.Target = TransparentPanelOnTop
rf.SetOnTouchListener("TransparentPanelOnTop_Touch")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub TransparentPanelOnTop_Touch (viewtag As Object, action As Int, X As Float, Y As Float, motionevent As Object) As Boolean 'Return True to consume the event
If action = Activity.ACTION_DOWN Then
PositionX = X
PositionY = Y
Label1.Text = "You touched at X = " & X & " Y = " & Y
End If
Return False
End Sub
Sub Button1_Click
Label1.Text = "You Clicked Button1 with positions : X = " & PositionX & " Y = " & PositionY
End Sub
Sub Button2_Click
Label1.Text = "You Clicked Button2 with positions : X = " & PositionX & " Y = " & PositionY
End Sub