Sub Globals
Dim pnlTest As Panel
Dim Time0 As Long
Dim x0, y0 As Float
Dim LongClickTime = 500 As Long
End Sub
Sub Activity_Create(FirstTime As Boolean)
pnlTest.Initialize("pnlTest")
Activity.AddView(pnlTest, 0, 0, 100%x, 100%y)
End Sub
Sub pnlTest_Touch (Action As Int, X As Float, Y As Float)
Select Action
Case Activity.ACTION_DOWN
Time0 = DateTime.Now
x0 = X
y0 = Y
Activity.Title = "Down"
Case Activity.ACTION_MOVE
Activity.Title = "Move"
Case Activity.ACTION_UP
If DateTime.Now - Time0 > LongClickTime AND X - x0 < 10dip AND Y - y0 < 10dip Then
Activity.Title = "LongClick"
Else
Activity.Title = "Up"
End If
End Select
End Sub