I have a button with a Mouse_Clicked event. I want to call the button's Mouse_Clicked event from another sub. What is the EventData that must be passed into that call? Below is the code:
B4X:
Sub btnTest_MouseClicked (EventData As MouseEvent)
End Sub
Sub CallButton
btnTest_MouseClicked("What goes here?")
End Sub
Personally I don't like writing logic in Clicked events etc. I usually create a separate sub and call this one from my Clicked event.
Anyway. If you need to call a clicked event, then you can create eventdata and give it as a param.
B4X:
Dim e As MouseEvent
btnTest_MouseClicked(e)
But if inside btnTest_MouseClicked you check values in EventData, then you may need to do more settings to the param you pass.
Actually using Action instead of Clicked, has another advantage. It works also by pressing space when the button has the focus. Clicked happens only after a mouse click.