R rodmcm Active Member Licensed User Longtime User Feb 15, 2022 #1 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 b4a Panel Touch.zip 5.2 KB · Views: 424 B4j PanelTouch.zip B4j PanelTouch.zip 2.1 KB · Views: 399
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
Erel B4X founder Staff member Licensed User Longtime User Feb 16, 2022 #2 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): Code: Copy 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
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): Code: Copy 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.
R rodmcm Active Member Licensed User Longtime User Feb 16, 2022 #3 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
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.