Example: Creating a Picture-specific Help File
This section serves as a mini-tutorial that walks you through the complete process of creating a sample Help file and assigning it to a picture. For clarity, this example assumes that iFIX is installed to the C:\Program Files (x86)\Proficy\iFIX path and that you are developing your Help file in a working directory entitled C:\Program Files (x86)\Proficy\iFIX\HELP TEST.
HTML Help Example
To create the
HTML content in a text editor:
- Open a text editor, such as Notepad.
- Copy (CTRL+C) the following text to the Windows clipboard, and paste (CTRL+V) it into your text editor:
<HTML>
<HEAD>
<TITLE>Title 1</TITLE>
</HEAD>
<body>
<H1><font face="Arial">Title 1 </font> </H1>
<P><font face="Arial">Paragraph 1 </font> </P>
</BODY>
</HTML>
- For the two "Title 1" sections, shown bolded above, enter "My Square."
- Replace "Paragraph 1" (shown bolded above) with the following:
This is the Help topic for my square.
- Save the file as SQUARE.htm in the C:\Program Files (x86)\Proficy\iFIX\HELP TEST folder.
To assign the HTML Help file, context
ID, and set the IsSelectable property:
- In the iFIX WorkSpace configure mode, open a new iFIX picture.
- Right-click the picture and select the Property Window command.
- In the HelpFile property field, enter the following text:
square.chm
- Click the Rectangle button on the Toolbox and draw a rectangle.
- Right-click the rectangle and select the Property Window command.
- In the ContextID property field, enter the following number:
1000
- Set the IsSelectable property field to True.
- Save the picture with the name HELPTEST. By default, iFIX saves the picture to this folder: C:\Program Files (x86)\Proficy\iFIX\PIC.
To create a map
file and alias file for HTML Help:
- Create a new text file in a text editor, such as Notepad.
- In the text file, enter the following information:
#define square 1000
- Save the file as SQUARE.h in the C:\Program Files (x86)\Proficy\iFIX\HELP TEST folder.
- Create another new text file in a text editor, such as Notepad.
- In the text file, enter the following information:
square = SQUARE.htm
- Save the file as MYALIASES.h in the C:\Program Files (x86)\Proficy\iFIX\HELP TEST folder.
To create and build the HTML Help
project file:
- In the Microsoft HTML Help Workshop, from the File menu, click New. The New dialog box appears.
- In the list box, select Project and click OK. The New Project wizard appears.
- Leave the Convert Winhelp Project check box cleared, and click Next. The New Project - Destination screen appears in the wizard.
- In the edit box, enter the location and name that you want your Help project to use: C:\Program Files (x86)\Proficy\iFIX\HELP TEST\SQAURE.HHP
- Click Next. The New Project - Existing Files screen appears in the wizard.
- Select the HTML Files (.htm) check box, and click Next. The New Project - HTML Files screen appears in the wizard.
- Click Add. The Open dialog box appears.
- Browse to and select the following file: C:\Program Files (x86)\Proficy\iFIX\HELP TEST\SQAURE.htm. Click Open to return to the New Project - HTML Files screen.
- Click Next. The New Project - Finish screen appears in the wizard.
- Click Finish.
- Click the HTML Help API Information button (the fourth button down, on the Project tab). The HTML Help API Information dialog box appears.
- From the Map tab, click the Header File button. The Include File dialog box appears.
- Click Browse to select the SQUARE.h file in your C:\Program Files (x86)\Proficy\iFIX\HELP TEST folder.
- Click OK.
- Click the Alias tab, and then click the Include button. The Include File dialog box appears.
- Click Browse to select the MYALIASES.h file in the C:\Program Files (x86)\Proficy\iFIX\HELP TEST folder.
- Click OK, and then click OK again to close and save the information in the HTML Help API Information dialog box. After you do that, you will notice two new sections in your help project: [ALIAS] and [MAP].
- Click the Add/Modify Window Definitions button (the third button down, on the Project tab). The Add a New Window Type dialog box appears.
- Enter a name for your default window. For example, you may want to create a window named main. After you do that, click OK. The Window Types dialog box appears.
- Click the Position tab, and then click the Autosizer button. The Autosizer dialog box appears.
- Drag the dialog box and its corners until the box appears where you want topics to display on your screen, by default, and click OK.
- From the Window Types dialog box, click OK.
- Click the Save All Files and Compile button (the bottom button on the Project tab).
To test the HTML Help file:
- Copy the SQUARE.CHM Help file to the C:\Program Files (x86)\Proficy\iFIX\PIC directory.
- In the iFIX WorkSpace, open the HELPTEST picture.
- If you are not already in run mode, on the WorkSpace menu, select Switch to Run (Classic view) or on the Home tab, in the WorkSpace group, click Switch to Run (Ribbon view).
- Press Shift+F1. The cursor changes to a question mark pointer, indicating that it is in What's This? Help mode.
- Click the rectangle. A Help pop-up window with the following text appears:
My Square
This is the Help topic for my square.
See Also
How Do I...
create the .RTF content in Microsoft Word
assign the Winhelp file, context ID, and set the IsSelectable property
create and build the Winhelp project file
create the HTML content in a text editor
assign the HTML Help file, context ID, and set the IsSelectable property
create a map file for HTML Help