B4J Question Triggering Mouse_Entered and Mouse_Exited events on superimposed panes/images

Cableguy

Expert
Licensed User
Longtime User
Hi guys

I have a layout composed of several (5) superimposed panes.
Using the BackgroundImage property I set each with an image that has transparent background, and by doing so I get my desired final layout.
I am trying to get Mouse-Entered and Mouse_Exited events to fire on those superimposed panes, but I can only make it work on the foremost pane.

Any help or advise is welcome
 

Cableguy

Expert
Licensed User
Longtime User
was about to try that, I'll let you know if it worked

[EDIT]

If PickOnBounds is set to False, the event ( I set using JavaObject) does never get triggered;
If PickOnBounds is set to True, all of the view is used, even the transparent portion, to trigger the events
 
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I will try to recreate this in an as small as possible project and then post it here.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
So, here is my stripped down, uggly coded, test project.

There are 5 panes, all with a transparent part. My objective is to detect the mouse hover (entered & exited) events on each panel, excluding the transparent portions.

easier said than done it seems….
 

Attachments

  • test.zip
    62.1 KB · Views: 347
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
I can sort of get it working, but where the chevrons have I guess transparent pixels in the image, I detect the top image then the bottom one as the mouse moves across the chevron images. (hope that makes sense)
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Thanks @Daestrum ...

I had a crazy thought ( and also recalled having had this issue before) and changed from Pane to ImageView, and guess what?!

IT WORKS AS INTENDED!
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
no problem, was a bit of exercise for my brain lol.
 
Upvote 0
Top