LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mouse Enter Event Not Detected - Sub Panel in Splitter Pane

Hello NI Community!

 

I am working on a spiffier GUI than I typically make and am having some issues using the "Mouse enter" events on panes with subpanels.  In the attached VI, I am attempting to have a slide out pane when the users mouse enters/exits the pane on the far right.  This works perfectly when the sub panel is not present, but very inconsistently when the subpanel is in place. The issue quickly improves if I scoot the sub panel to the right so that some pane margin becomes visible.  

 

At the bottom of the VI, I have a status bar that shows the last event that occurred.  When the issue occurs, you'll see that the code never catches the "Mouse Enter" event (entering the main pane) that should trigger the splitter to slide back to the right.  The last event captured in this case is the "In rack pane" event.  If you then very carefully touch the margin of the pane and then move back to the main pane, things will consistently work.  

 

Any ideas how I can make this stable when using a subpanel that occupies the entire pane? 

 

Thanks in advance!

 

Jared

Download All
0 Kudos
Message 1 of 6
(648 Views)

Bumping to hopefully get some help now that the holiday activity is slowing down.  Let know if anyone has any ideas, please!

0 Kudos
Message 2 of 6
(529 Views)

I don't have a good answer, but changing "Main Pane": Mouse Enter to "Rack Pane": Mouse Leave appears to be reliable, but it breaks your Pin button since you are leaving the Rack Pane before you can click it. 

 

You could add an event so that when you click the pin button it also expands Rack Pane. But you would lose the ability to pin the Rack Pane closed (which is currently supported, but maybe not needed).

 

FYI, your RackPanel.vi is broken since it relies on some subVIs you didn't include. That may have something to do with the lack of replies. I changed the missing subVIs to regular Queue nodes since that works fine for testing.

Message 3 of 6
(519 Views)

Thanks for the response! I originally had "Rack Pane": Mouse Leave as what is now "Main Pane": Mouse Enter but changed it for the exact reason you mentioned - I want to be able to pin the rack open and closed. 

 

I may change to a click event to open/close the side panel if I cant find a stable way to make it work with mouse enter/leave events.  

0 Kudos
Message 4 of 6
(515 Views)

While not very elegant, if you really want this you could try repeated fast polling of the mouse position using this:

 

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/utility/inputdevices-llb/mouseacqui...

 

It presents a new set of challenges (i.e. matching mouse position on screen to your window location, making it only happen when your window is active, etc.) so it depends how important this feature is to you.

0 Kudos
Message 5 of 6
(470 Views)

You should back save your VIs to an earlier version; I cannot open them.

 

UI mouse enter/mouse leave has some subtleties, not sure what is going on in your case as I cannot see the code, but here is one as I remember it.

  1. There can be Mouse Leave Pane events without the mouse ever moving out of the pane. For example, dismissing a right-click menu event triggers a mouse leave event even though the cursor might still be in the proper pane. This can throw off the entire sequence.

The solution that I pursued was looking at the mouse coordinates for a Mouse Leave event. If they were still in the pane, ignore it, if not then do my case.

 

My UI issue was somewhat similar to yours. I had a transparent File Control on top of a Table; the user could drag and drop a file on the control to load values. Similar to you, both the table and File Control filled the whole pane.

 

The Code below uses the LAVAG UI tools, but will tell you whether the mouse left the pane or not. Not sure how it will work if you use scroll bars for your pane, origin is not right, etc.

 

snip.png

0 Kudos
Message 6 of 6
(435 Views)