B4J Code Snippet setMouseTransparent, enable mouse events in underlying nodes

Discussion in 'B4J Code Snippets' started by klaus, Dec 21, 2016.

  1. klaus

    klaus Expert Licensed User

    Subject: Routine to enable mouse events being transmitted to underlying nodes.

    In B4J, when a node covers other nodes, like a Pane, the mouse events are not submitted to underlying nodes.
    This is the same as in B4i, it is inverse in B4A.
    In B4i, you can use the UserInteractionEnabled property.
    In B4J you can use the code below to enable mouse events beeing submitted to underlying nodes.

    Code:
    Private jo = MyNode As JavaObject
    jo.RunMethod(
    "setMouseTransparent"Array As Object(True))
    The value is False by default.

    Tags: Node, mouse events, pass mouse events

    Attached a small test project.
    If you click on the covered part of button Test2, nothing happens.
    If you click on the covered part of button Test1, the mouse event is raised.
     

    Attached Files:

    Last edited: Aug 23, 2018
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice