12-27-2023 03:30 PM - edited 12-27-2023 03:32 PM
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
01-02-2024 02:06 PM - edited 01-02-2024 02:06 PM
Bumping to hopefully get some help now that the holiday activity is slowing down. Let know if anyone has any ideas, please!
01-02-2024 02:44 PM
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.
01-02-2024 03:33 PM
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.
01-03-2024 11:12 AM
While not very elegant, if you really want this you could try repeated fast polling of the mouse position using this:
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.
01-03-2024 03:04 PM
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.
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.