Private Sub Touch_Gestures(View As Object, PointerID As Int, Action As Int, X As Float, Y As Float) As Boolean
Dim conta,xTemp,yTemp As Int
Select Action
Case G.ACTION_DOWN
'CallSubDelayed(Main,"aas_Click")
'rot.Initialize(obj,"PZ",Main)
Touch.Add(PointerID)
SingleClick = True
If vBringToFront Then obj.BringToFront
'TimePress = DateTime.Now
'---Stores the position of View---
X0 = X+obj.Left
Y0 = Y+obj.Top
X1 = obj.Left
Y1 = obj.Top
'---Display arrow fro---
'DisplayArrow(obj)
'rotate
a.Initialize(File.DirAssets, "2.png")
brect.Initialize(0,0,100%x,100%Y)
c.Initialize(obj)
c.DrawColor(Colors.Transparent)
c.DrawBitmap(a, Null, brect)
' TimerLC.Enabled = True
Case G.ACTION_POINTER_DOWN
Touch.Add(PointerID)
If Touch.Size = 2 Then
xTemp = G.GetX(Touch.Get(0))-G.GetX(Touch.Get(1))
yTemp = G.GetY(Touch.Get(0))-G.GetY(Touch.Get(1))
Hypotenuse = Sqrt(Power(xTemp,2)+Power(yTemp,2))/Density
End If
SingleClick = False
Case G.ACTION_MOVE
'---clears the first slight movement to the first pressure---
If DateTime.Now-TimePress < 100 Then
X0 = X+obj.Left
Y0 = Y+obj.Top
X1 = obj.Left
Y1 = obj.Top
End If
If Touch.Size = 1 Then
'---Move View---
If vCanMove Then
xTemp = X1+G.GetX(Touch.Get(0))+obj.Left-X0
yTemp = Y1+G.GetY(Touch.Get(0))+obj.Top-Y0
If LimitBorder Then
xTemp = Min(Max(xTemp,0),Parent.Width-obj.Width)
yTemp = Min(Max(yTemp,0),Parent.Height-obj.Height)
Else If LimitArea Then
xTemp = Max(Min(xTemp,0),Parent.Width-obj.Width)
yTemp = Max(Min(yTemp,0),Parent.Height-obj.Height)
End If
obj.Left = xTemp
obj.Top = yTemp
End If
If Abs(vTouchData.X-X) > MovingTouch OR Abs(vTouchData.Y-Y) > MovingTouch Then TimerLC.Enabled = False
End If
Case G.ACTION_POINTER_UP
'---Removes touches are no longer present on the screen---
For conta = 0 To Touch.Size-1
If Touch.Get(conta) = PointerID Then
Touch.RemoveAt(conta)
Exit
End If
Next
Case G.ACTION_UP
Touch.Clear
TimerLC.Enabled = False
If Abs(X+obj.Left-X0) < MovingTouch AND Abs(Y+obj.Top-Y0) < MovingTouch AND SingleClick Then
If SubExists(vModule,vEventName&"_Click") Then
vTouchData.Tag = vTag
CallSub2(vModule,vEventName&"_Click",vTouchData)
End If
End If
End Select
Log(Action)
'rot.Initialize(2,2,0)
Return True
End Sub