Hello everyone!
I'm wondering if it's possible to call Sub Pane1_MouseClicked (EventData As MouseEvent) recursively?
Here is a small experimental fragment. It doesn't make much sense. Just to understand if this is possible in principle?
If this is still possible, then please tell me what needs to be changed in my code so that the Sub Pane1_MouseClicked (EventData As MouseEvent) subroutine could call itself and pass the left mouse button press as a parameter.
I'm wondering if it's possible to call Sub Pane1_MouseClicked (EventData As MouseEvent) recursively?
Here is a small experimental fragment. It doesn't make much sense. Just to understand if this is possible in principle?
If this is still possible, then please tell me what needs to be changed in my code so that the Sub Pane1_MouseClicked (EventData As MouseEvent) subroutine could call itself and pass the left mouse button press as a parameter.
B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Pane1 As B4XView
Private PrimaryButtonPressed As MouseEvent
End Sub
Public Sub Initialize
'PrimaryButtonPressed.Initialize ?????????????
'MouseEvent.Initialize ?????????????
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
End Sub
Private Sub Pane1_MouseClicked (EventData As MouseEvent)
If EventData.PrimaryButtonPressed Then
Log ("Pane cicked with left button")
Else
Log ("Pane cicked with right button")
Pane1_MouseClicked (PrimaryButtonPressed )
End If
End Sub
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Pane cicked with left button
Pane cicked with right button
Error occurred on line: 26 (B4XMainPage)
java.lang.RuntimeException: Object should first be initialized (MouseEvent).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:49)