Android Question B4a Activity Touch and B4j MainForm Touch

rodmcm

Active Member
Licensed User
The examples show basically the same idea in B4a and B4j.
Four panels on a background

In B4a the Activity_Touch is not active when the mouse is run over a panel
in B4j MainForm_Touch is active when the mouse is run over a panel

Is there a way to stop the later, ie stop MainForm_touch operating when over a panel
 

Attachments

  • b4a Panel Touch.zip
    5.2 KB · Views: 107
  • B4j PanelTouch.zip
    2.1 KB · Views: 96

Erel

B4X founder
Staff member
Licensed User
Longtime User
Why waste your time with activities and forms? Create a single B4XPages project.

The simplest solution in this case is to check the target view in MouseMoved (and the other similar events):
B4X:
Private Sub MainForm_MouseMoved (EventData As MouseEvent)
    Dim v As B4XView = EventData.As(JavaObject).RunMethod("getTarget", Null)
    If v = MainForm.RootPane Then
        Log(EventData.X)
    End If
End Sub
This is only needed for the MainForm.
 
Upvote 0

rodmcm

Active Member
Licensed User
Yes thankyou Erel, aware of B4X pages, what I was exploring was the interaction between various commands and what takes precedence. For argument sake a Panel_Touch in B4J takes precedence over the MainForm-Touch, so you can use it to block the MainForm_Touch actions.

Are there any sources of information that explains all of this? I must admit the more I use B4x I realize I am using snippets or constructs that I really don't have the understanding as to why they operate, not having had formal computer training

Perhaps there is a place for a forum about learning resources.
 
Upvote 0
Top