LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure mouse enter decoration

Solved!
Go to solution

I want one of my events in my event structure to detect my mouse entering a specific decoration that surrounds a control. I used the pane property to find out what the decoration # is but now I don't know how to call this specific decoration as one of my events.

 

The purpose is that I want the user to have pushed a button to make a data folder before hitting start to generate data. I need the user to get an error message that they did not create the folder if they even get close to the start button. I don't want them to get the error after they have already hit start because my start button is data-bound to a network variable that will get the start message even if my host program has generated an error.

0 Kudos
Message 1 of 5
(3,295 Views)
Solution
Accepted by topic author FireIce

Front panel decorations aren't the type of objects that can be associated with events.

 

I think you have several options.

 

1.  Track the mouse move event and compare the coordinates of the mouse with the some constants you define that based on the decoration location.  This would seem to be a lot of polling.

 

2.  Don't associate your start button with a network bound shared variable.  When the  start button is pressed, do your comparison whether it is allowed, and if not, raise the error.  If it is allowed, activate another possible hidden start button that is associated with your shared variable.

 

3.  Use the Mouse Down? event on the Start button.  If you find that is isn't a valid time to press the button, discard the event.

 

4.  Use the Mouse Enter event on start button itself.

 

5.  Use the Mouse Enter event on another button, that sits behind the real button.  It could be transparent, or disabled, or disabled and greyed.

 

6.  If the button does get pressed, have the program automatically create the folder for them instead of raising a dialog box and forcing them to that manually.

 

I think #6 or #2 would be the best options.  As a user, I would find it quite annoying that anytime I swept the mouse over an area of the screen especially unintentionally to have a dialog box pop up.

Message 2 of 5
(3,285 Views)

Thanks for the suggestions!

I went with #2:


Ravens Fan wrote:

...

2.  Don't associate your start button with a network bound shared variable.  When the  start button is pressed, do your comparison whether it is allowed, and if not, raise the error.  If it is allowed, activate another possible hidden start button that is associated with your shared variable.

...


I kept my start button data bound because of other program requirements but I made it hidden on the front panel and added an identical start button on top of it that is not data bound. Now the event structure looks for value change on the non-data-bound start button and if the data folder has not been created yet, it gives a dialog and sets the button back to false.

It would have been more programmically complex to make the data folder automatically if it hasn't already been created (option #6) since my whole program is a state machine and is the host for a Real Time Project (hense the data bound variable which triggers the target to run). Actually now that the start button the user hits is not data bound, I may be able to incorporate this.  

0 Kudos
Message 3 of 5
(3,249 Views)

Great.

 

I'm glad I could give you some ideas.

 

One more idea would be to just go with the Start button itself being disabled/greyed when you don't want them to press it.  Once they create the folder, then you enable the button by way of its property node to permit them to press it.

Message 4 of 5
(3,240 Views)

Ravens Fan wrote:

Great.

 

I'm glad I could give you some ideas.

 

One more idea would be to just go with the Start button itself being disabled/greyed when you don't want them to press it.  Once they create the folder, then you enable the button by way of its property node to permit them to press it.


Another great idea. I'll keep that in mind.

0 Kudos
Message 5 of 5
(3,224 Views)