Android Question Panel Click

Terradrones

Active Member
Hi

Need a help\hint again please.

I have a Panel where I show the Cross-Section of a Road (can also be a Channel, etc.) with the Stakeline. How can I determine if the User clicked on the Panel left or right of the Stakeline? The Stakeline is normally the Centreline of the Project.
 

William Lancee

Well-Known Member
Licensed User
Longtime User
If StakePanel is the Panel then the X an Y coordinates of the finger position inside the panel are given by the touch event.
See https://www.b4x.com/guides/B4XBasicLanguage/?page=75
If X is less than halfway of the panel width you're touching to the left.

B4X:
Sub StakePanel_Touch (Action As Int, X As Float, Y As Float)
 Select Action
 Case StakePanel.ACTION_DOWN
 ' Your code for DOWN action
 Case StakePanel.ACTION_MOVE
 ' Your code for MOVE action
 Case StakePanel.ACTION_UP
 ' Your code for UP action
 End Select
End Sub
 
Upvote 0
Top