LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tip strip utility VIs and some advanced techniques

I wrote a little Tip Strip package, which I'd like to share with the community. It allows you to register any number of front panel objects to show a custom tip strip on mouse over. I think it might be useful for people who make lots of tip strips for UI documentation and who need to check to make sure they've all been written, since the usual tip strip functionality is so slow. It's also nicer for the user who needs the information to appear faster or stay on screen longer than the default tip strip.

 

I think there are a number of useful techniques here, some of which I've just recently learned, so I would very much welcome feedback, and I hope others find this useful. Some things I learned from this exercise that I think are useful:

 

1. I learned how to make the tip strip VI follow the mouse by getting the mouse coordinates, resizing the VI to the tip strip indicator, resizing the indicator to the size of the tip strip text.

 

2. In order to disable the normal tip-strip functionality, I read a control's tip strip value and then overwrite this value with a blank string. If there is no tip strip text, the default tip strip behavior is subverted. Then I display my own tip strip. When done, the original tip-strip text is written back to the control.

 

3. I wasn't happy with the abrupt appearance and disappearance of the tip strip, so I wrote a fade-in/fade-out routine. This is run asynchronously, so that the other functionality, like the tip strip following the mouse, still works.

 

4. I used to do asynchronous calls by opening a VI reference by path, using a static path on the diagram. By using a Static VI Reference instead, a built executable will automatically include the VI without the need to explicitly include them in the build specifications. Now I feel better about including asynchronous calls to VIs.

 

5. I find it frustrating that it requires so much code to do an asynchronous call to a VI. I really wish it were possible to have this be a settable property of any VIs execution. As it is now I usually make a separate calling VI, which has the same controls and connector as the VI I want to call. Seems we could avoid this. Thoughts?

 

6. In doing an asynchronous call, I've used two approaches here. One is to set a VIs FP control values by named reference, and then use an invoke node to call and forget. The recommended way is to use the Asynchronous Call and Forget node, which has the advantage of using the wiring terminals of the called VI, but then you have to remember (or look up) the code (x80) to wire to the Open VI Reference VI. (Why aren't these few options enumerated for us in a constant??). There are examples of both here. I'd be interested to hear views on these two methods.

 

7. Registering for Events: Since the controls are not known by the calling VI at run time, you must register for events. I pass in an array of the controls I want to apply tip strips to, and these are registered for mouse in, mouse move, mouse out, and mouse click. This was my first use of registering for events. Great stuff!

 

8. Because the tip strip VI is run asynchronously, we ensure that it closes when the calling VI ends by passing in a notifier. We read this notifier in the event structure timeout case. It will return an error when the notifier is destroyed by the VI that created it.

 

 

 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 8
(6,178 Views)

Nice work!

 

Nice idea to have the stip fade in and out.This is an improvement over the prevailing tip strip methodologies.

 

Incidentaly, for anyone who doesn't know, the delay on appearance of tip strips is intentional. This is a commonly accepted practice in GUI design (-- not just in the LabVIEW world.) The logic goes like this: 

 

Experienced users (with well-developed mental models) don't need tip strips. They know and understand the GUI. The strip is unnecessary for these users and the extra clutter of the pop-up tip strip just gets in the way.

 

In contrast, new users may be unclear about the function of a particular GUI widget. They have a primary need to develop an accurate and complete mental model. Therefore, new users are less concerned with speed and efficiency than they are with comprehension, and may linger undecided over a control prior to activating it. 

 

The delayed tip strip provides a great compromise: the additional information is exposed only if a user is uncertain and moving slowly. Experienced users are not distracted by the additional GUI clutter of information that is not unecessary for them.

 

As a result of this reasoning, the delayed Tip Strip has become a GUI staple across many implementations.

 

Anyway, nice job!

 

-- Dave

 

 

 

Message 2 of 8
(6,171 Views)

Good explanation. I am using this to alert users to new feautures of exisitng code. I find that years can go by and I'll get a request for a feature that users didn't know exisited. Maybe this will help? But also as a UI-building tool it's useful, to make sure tip strips are at least.

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 3 of 8
(6,165 Views)

This is nice but there are a few minor things I'd like to mention.

 

There are alternatives to polling the notifier that I would prefer.  You can create a custom User Event, that is generated when your application exits (clean up step) that can tell the Tip Strip.vi to stop.  Then there will be no timeout needed in the event structure.

 

Events are like a queue and can pile up.  If I perform a mouse enter and then a mouse leave event on some control over and over (just move the mouse around) these events pile up, and then when I stop moving I see the tip strip appear and disappear repeatidly.  In LabVIEW 2013 you can limit the number of events that can pile up to prevent this.  In 2012 and older you can get creative with a shift register to get a similar affect but it is a bit of a pain.

 

I would also prefer a delay before showing the tip strip.  I believe normal tip strips don't appear until the mouse is on a control and not moving for some time (1 or 2 seconds).  I found is distracting that this tip strip appears when my house is over every control as I move the mouse around and really you only need to see if if the mouse doesn't move while on a control.  Not quite sure how you would implement it, but again a shift register and maybe setting the timeout case to 2000 if the mouse is entered might work.

 

There's not a ton of error handling going on.  You are likely fine but if a reference becomes invalid, or the mouse is unplugged you may get strangeness and I'd suggest just have a simple error handler if an error occurs.

0 Kudos
Message 4 of 8
(6,116 Views)

Hi spheroid,

 

could you please attach your VIs downconverted to LV2011?

 

TIA!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(6,110 Views)

 

There are alternatives to polling the notifier that I would prefer.  You can create a custom User Event, that is generated when your application exits (clean up step) that can tell the Tip Strip.vi to stop.  Then there will be no timeout needed in the event structure.

 

The reason I prefer the notifier is it is set and forget. I agree it would be great to not have a timeout on the event. But this way I can call this VI and not have to deal with it further. I'm open to further suggestions, but I'd liek a routine like this to be pretty self-sufficient.

 

Events are like a queue and can pile up.  If I perform a mouse enter and then a mouse leave event on some control over and over (just move the mouse around) these events pile up, and then when I stop moving I see the tip strip appear and disappear repeatidly.  In LabVIEW 2013 you can limit the number of events that can pile up to prevent this.  In 2012 and older you can get creative with a shift register to get a similar affect but it is a bit of a pain.

 

I was thinking about this, and I appreciate your suggestion. I didn't realize this option existed in 2013. Will ahve to check it out!

 

I would also prefer a delay before showing the tip strip.  I believe normal tip strips don't appear until the mouse is on a control and not moving for some time (1 or 2 seconds).  I found is distracting that this tip strip appears when my house is over every control as I move the mouse around and really you only need to see if if the mouse doesn't move while on a control.  Not quite sure how you would implement it, but again a shift register and maybe setting the timeout case to 2000 if the mouse is entered might work.

 

 

Yes, a delay is a great idea, and having it settable for a standard 1-2 seconds, but maybe 0 for UI building... I'll add than.

 

There's not a ton of error handling going on.  You are likely fine but if a reference becomes invalid, or the mouse is unplugged you may get strangeness and I'd suggest just have a simple error handler if an error occurs.

 

Error handling is a weak point for me. I'll work on that, too...

 

Thank you for your help and input Hooovahh!


_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 6 of 8
(6,097 Views)

Bump!

 

Do you mind to downconvert (before I ask in the downconversion thread)?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(6,060 Views)

Sorry for the delay. Here's the tipstrip in LV11

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 8 of 8
(6,019 Views)