Private Sub pnlLayerLoc_Touch (Action As Int, X As Float, Y As Float)
Log(X)
Log(Y)
Dim touchstart, touchduration As Long
If Action=B4XPages.GetNativeParent(Me).ACTION_UP Then
touchduration = DateTime.Now - touchstart
If touchduration < 400 Then ' Short click
Else ' long click/touch
If move=False And removemarkpoint=False Then
pnlLayerLoc.LoadLayout("mark_point")
imgMarkPoint.Left=X-(imgMarkPoint.Width/2)
imgMarkPoint.Top=Y-(imgMarkPoint.Height)
End If
End If
End If
If Action=B4XPages.GetNativeParent(Me).ACTION_DOWN Then
touchstart = DateTime.Now
move=False
removemarkpoint=False
End If
If Action=B4XPages.GetNativeParent(Me).ACTION_MOVE Then
move=True
Log(imgViewPlanimetria.mBase.Width)
Log(imgViewPlanimetria.mBase.Height)
imgMarkPoint.Left=X-(imgMarkPoint.Width/2)
imgMarkPoint.Top=Y-(imgMarkPoint.Height*4)
imgMarkPoint.Tag=X & "," & Y
End If
End Sub
Sub imgMarkPoint_LongClick
Dim currimgMarkPoint As ImageView
currimgMarkPoint = Sender
currimgMarkPoint.Visible=False
currimgMarkPoint.RemoveView
removemarkpoint=True
End Sub