Hello,
i am searching for a way to simulate a click on a view (radio button, slider,..).
Is there a way to do it?
Background is i have a transparent gesture-panel over my layout-panel and want to forward not needed actions.
For this i call a sub in the gesture-eventhandler.
This is the Sub i call:
But the "RequestFocus" function i used works only for EditFields...:sign0085:
i am searching for a way to simulate a click on a view (radio button, slider,..).
Is there a way to do it?
Background is i have a transparent gesture-panel over my layout-panel and want to forward not needed actions.
For this i call a sub in the gesture-eventhandler.
This is the Sub i call:
B4X:
Sub ForwardAction(Action As Int, x As Float, y As Float)
Dim bFoundView As Boolean
bFoundView = False
'look if any view is under this x/y
If Action <> Activity.ACTION_MOVE Then
Dim v As View
'iterate through all views of the active panel
For i = 0 To sd.Panels(sd.currentPanel).NumberOfViews - 1
v = sd.Panels(sd.currentPanel).GetView(i)
If (v Is Panel) Then Continue
'Hittest x/y
If (v.Left <= x) AND (v.Top <= y) AND (v.Width+v.Left >= x) AND (v.Height+v.Top >= y) Then
'activate the view
v.RequestFocus
bFoundView = True
Exit
End If
Next
End If
If bFoundView = False Then 'if no hit forward action to panel
Panels_Touch(Action, x, y)
End If
End Sub
But the "RequestFocus" function i used works only for EditFields...:sign0085: