01-09-2019 03:57 AM
Hello guys,
in order to create a less chaotic GUI that still allows a lot of functionalities I wanted to create a simple and customizable drop down menu, that opens when the mouse hovers over a button and closes either by the mouse leaving the menu or clicking a certain button.
That all works well as long as I do not use an enum control. That is where the problems start:
1. When clicking on the enum control it seems as if a "Mouse Leave" event is triggered, that causes the menu to hide. But I need the mouse leave event to hide the menu once the user moves the mouse away. An alternative would be to implement a close button, but that is way less smooth.
Now I have a really bad, quick and dirty workaround which somehow "solves" this problem: There is an additional Enum:"Value changed" event that makes the menu visible again. But that leads to problem 2:
2. If the user reselects the already selected value (no value is changed then), then the menu does not appear again.
In the attachment you will find an example VI that shows those problems.
So actually I am looking for a solution that is not as nasty as mine 😎 Do you have any ideas? That would be great!
Thanks a lot in advance.
Jenso
Solved! Go to Solution.
01-09-2019 04:41 AM - edited 01-09-2019 04:45 AM
Stuff like this will always result in "hacks". In other words: your rowing against the stream.
Here's a "solution".
+ Put a big dummy Boolean (transparent) on the entire screen (fit to pane), move to the background, behind everything.
+ Replace the Add and cluster mouse leave events with a dummy Boolean mouse enter event.
+ Optionally, show the dummy Boolean only when the menu is activated. Hide when it's not.
That seems to work much better, but you'll probably run into other (unpredictable) problems. One thing is that editing the MMI with the big Boolean on the background is a pain.
01-09-2019 04:51 AM
wiebe@CARYA wrote:
+ Put a big dummy Boolean (transparent) on the entire screen (fit to pane), move to the background, behind everything.
+ Replace the Add and cluster mouse leave events with a dummy Boolean mouse enter event.
+ Optionally, show the dummy Boolean only when the menu is activated. Hide when it's not.
Like this. Not sure if the menu should disappear on string or enum value changes, but seemed preferable to me.
01-17-2019 01:51 AM
That is a gorgeously simple solution. I do not need half a thousand property nodes for this one. Although you are correct, editing the background button IS a pain. But I still like that solution.
Thanks!!
Jenso