Adding Online Help


LabVIEW's Help window is extremely useful when you need learn something in a hurry; most people come to depend on it for wiring their diagrama very good programming habit to develop. You can make your own application just as easy to learn by adding your own entries for the Help window, as well as links to a hypertext Help document. Three levels of customized help are available:

1.

Tooltip Help: Also called "hesitation help," it's the text in a yellow box that shows up when you move the mouse cursor over a control and hold it there.

2.

Window Help: The comments that appear in the Help window that describe controls and indicators as you move the cursor over them.

3.

Online help in a Help (hypertext) document: You can programmatically create a link to bring up an external help file.

Providing customized help in the Tooltip format and Help window is fairly easy. We covered this briefly in Chapter 5, "Yet More Foundations." To do this, choose Description and Tip . . . from the pop-up menu of a control or indicator. Enter the tip and description in the dialog box, and click OK to save it. LabVIEW displays this description whenever you have the Help window open and move the cursor over the front panel object (see Figures 17.17 and 17.18).

Figure 17.17. The Description and Tip dialog being used to edit the description and tool-tip for the alarm numeric control


Figure 17.18. The Context Help window showing the description of the alarm control as the mouse cursor is hovered over it


If you document all your front panel controls and indicators by including their descriptions, the end user can open the Help window and quickly peruse the meaning of your front panel objects.

To provide a description for the whole VI, enter information in the text box that appears when you choose Documentation from the VI Properties... menu. These comments will show up in the Help window, along with the wiring diagram, whenever the cursor is positioned over the VI's icon in the block diagram of another VI or in the upper-right corner of the VI's own front panel or block diagram. It will also show up in the Help window when the user hovers over the VI in the Functions palette.

You can also bring up, position, and close the Help window programmatically. Use the Control Help Window and the Get Help Window Status functions, available from the Help subpalette of the Programming>>Dialog & User Interface palette.

Control Help Window (Programming>>Dialog & User Interface>>Help palette) controls the position and visibility of the Help window. The Boolean Show input closes or opens the Help window; the cluster input consists of two numerical indicators that determine the top and left pixel position of the window (see Figure 17.19).

Figure 17.19. Control Help Window


Get Help Window Status (Programming>>Dialog & User Interface>>Help palette) returns the state and position of the Help window (see Figure 17.20).

Figure 17.20. Get Help Window Status


The more advanced help method, calling a link to an external, or compiled, help file, (which is usually written in HTML or RTF) is more elaborate. However, these are the same professional help files you see in commercial applications, and are very useful for an application you plan to distribute.

You can use the HTML or RTF files LabVIEW generates to create your own compiled help files. Complete the following steps to create a compiled help file:

1.

Generate HTML or RTF files from the VI documentation. You can do this by choosing Print... from the File menu in the top-level VI and, in the ensuing wizard dialog, choosing the "VI Documentation" option. After you choose this, you will get the option of printing to a printer, HTML, RTF, or plain text destination.

2.

You will need to choose either HTML or RTF as the destination.

  • Generate HTML files if you want to create a Windows-compiled HTML Help file or Mac OS Apple Help.

  • Generate RTF files if you want to create a Windows WinHelp or Linux HyperHelp file.

3.

Compile the source HTML or RTF documents into one file. You can use one of the following third-party utilities to compile the documents, but several other utilities are also available:

  • Windows You can use Microsoft HTML Help Workshop to compile HTML Help files and use Microsoft Help Workshop to compile WinHelp files. (You can also use Doc-to-Help from ComponentOne to easily convert Microsoft Word documents into compiled or HTML help.)

  • Mac OS X You can use Apple Help to view HTML files as a help system.

  • Linux You can use the HyperHelp compiler from Bristol Technology Incorporated to compile QuickHelp files.

4.

Link from the VIs you documented to the compiled help file. You can do this by popping up on the VI's icon, selecting VI Properties>>Documentation, and using the "Browse..." button to link to the compiled help file. For a fuller description of this functionality, see the LabVIEW documentation.

To call these help files programmatically, you can use the remaining function in the Programming>>Dialog & User Interface>>Help subpalette.

Control Online Help (Programming>>Dialog & User Interface>>Help palette) manipulates an external compiled help file. You can display the contents, the index, or jump to a specific part of the help file (see Figure 17.21).

Figure 17.21. Control Online Help


You can also distribute help documentation as plain HTML files, either along with your application or on a web site at a specific URL. Use the Open URL in Browser.vi to open HTML files on disk by wiring a path data type to the URL input (this is a polymorphic VI that allows the URL to be passed as either a string or a path) or open a web page on the Internet by wiring a string containing the web page URL.

Open URL in Browser.vi (Programming>>Dialog & User Interface>>Help palette) displays a URL or HTML file in the default web browser. If the URL or path you wire to this VI contains a space character, the VI encodes the space as %20 before displaying the URL or HTML file in the web browser (see Figure 17.22).

Figure 17.22. Open URL in Browser.vi





LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net