LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Floating help windows in cvi

How do I create a floating help window in CVI? The idea is too display a help window when the mouse hovers over a control.
thanks!
0 Kudos
Message 1 of 3
(3,322 Views)
Yoiu could try using the tooltips instrument which you can find here


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,322 Views)
There are a couple of things in the Programmer's Toolbox that you can use: Control Tool Tips or Extended Mouse Events.
The Tool Tips are by far the easiest:
1. Add ..\cvi\toolslib\toolbox\toolbox.fp to your project.
2. Use the toolbox function SetCtrlToolTipAttribute() to set the tooltip for each control that you want to show help. Unless you want the tool tip to change, you can include all the SetCtrlToolTipAttribute calls in main() right after you LoadPanel.
If you want to show your own help panel instead of just a tooltip, you can use extended mouse events to determine where the mouse is, then calculate if it's over the control, then DisplayPanel on the help panel.
1. Add ..\cvi\toolslib\toolbox\toolbox.fp to your project.
2. Call EnableExtendedMouseEv
ents() in main after loading the panel.
3. In the UI editor, create a panel for your help info with a textbox on it.
4. In the UI Editor, edit the help panel, go to Other Attributes, then select Floating Style: When App is Active.
5. In the callback for the control of interest, add a case for EVENT_MOUSE_MOVE. The mouse Y coordinate is contained in eventData1. The mouse X coordinate is contained in eventData2. You need to call GetCtrlAttribute to read the control location and size, then determine if the mouse is over the control. Then DisplayPanel or HidePanel on the help panel based on the mouse position.
Using your own help panel gives you a lot of flexibility: you can add any number of contols: text pictures, numeric, etc. But you pay the price in additional code. I'd use tool tips unless you need the flexibility.
The attached example shows both methods.
Message 3 of 3
(3,322 Views)