Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 7

Creating HTML Help - HTML Help Source Files for WhatsThisHelp

If you wish to implement WhatsThisHelp from an HTML Help file, you must include the following:
  • So-called "context-sensitive" or "Pop-up" Topic files. One of these files can contain many small "one liner" WhatsThisHelp topics as well as a unique constant name to identify each topic.

  • Topic ID mapping files. This second type of file format is identical to the format of the *.h file described above for mapping HelpContextID topics. The purpose of this file is to map each of the unique constant names defined in the Pop-Up Topic file to a numeric Topic ID.

You include these two files in an HTML Help project by specifying them under the [TEXT POPUPS] section of the HTML Help project file (*.hhp), as described in the following sections.

Context-Sensitive Topic Files

A context-sensitive Topic file (*.txt) is a text file that associates a unique constant name with some brief text that you can use in a WhatsThisHelp system in VB.

The format for each WhatsThisHelp topic entry is:

.topic ConstName
Text of Topic

ConstName is a unique identifier that will later be used to link the topic to a Topic ID (see the following section) and Text of Topic is the text that the user will actually see when WhatsThisHelp pops up.

Listing 7.6 gives a sample of such a file.

LISTING 7.6
A SAMPLE HTML HELP TOPIC FILE FOR TEXT POPUP HELP (WhatsThisHelp)

.topic IDH_GENDER
Optional.
.topic IDH_MARITALSTATUS
Required for Tax status.
.topic IDH_MEDICALINSURANCE
Has medical insurance

Context-Sensitive Topic ID Mapping Files

Just as you must map constant names to numeric values for HelpContextIDs, so must you map WhatsThisHelp topic constants to numeric values for WhatsThisHelpIDs. You use a Context-Sensitive Mapping file (*.h) to accomplish this. The format of each line in such a file is the same as the format of the lines in a mapping file for HelpContextID constants:

#define ConstName ContextIDValue

Listing 7.7 gives an example of the contents of a Context-Sensitive Topic ID mapping file.

LISTING 7.7
A TEXT POPUP (WHATSTHISHELP) TOPIC ID MAPPING FILE

#define IDH_GENDER 10
#define IDH_MARITALSTATUS 20
#define IDH_MEDICALINSURANCE 30

Including WHATSTHISHELP Files in the HTML Help Project

After you've created a Context-Sensitive Topic and Context-Sensitive Topic ID mapping file as described in the previous two sections, you can include them in the HTML Help project by following these steps:

STEP BY STEP
7.4 Associating Topic Files With Topic IDs

  1. Click the HTMLHelp API Information icon (the fourth Toolbar button from the top on the vertical toolbar along the left of the HTML Workshop's main screen) to bring up the HTMLHelp API Information dialog box (refer to Figure 7.20).

  2. On the Text Pop-ups tab of this dialog box, click the Header File button to bring up the Include File dialog box. Then browse to and select the mapping file that you created for Pop-Up Topic IDs (Figure 7.25). After the file is selected, click OK to return to the Text Pop-ups tab.

    Selecting a Topic ID mapping file for WhatsThisHelp with the Include File dialog box from the Text Pop-ups tab of the HTMLHelp API Information dialog box.
    FIGURE 7.25. Selecting a Topic ID mapping file for WhatsThisHelp with the Include File dialog box from the Text Pop-ups tab of the HTMLHelp API Information dialog box.

  3. On the Text Pop-ups tab, click the Text File button to bring up the Include File dialog box. Then browse to and select the Context-Sensitive Topic ID file (*.txt) that you created for Pop-up topics (Figure 7.26).

    Selecting a Topic file for WhatsThisHelp with the Include File dialog box from the Text Popups tab of the HTMLHelp API Information dialog box.
    FIGURE 7.26. Selecting a Topic file for WhatsThisHelp with the Include File dialog box from the Text Popups tab of the HTMLHelp API Information dialog box.

  4. Click OK until you've returned to the main screen. You should now see a [TEXT POPUPS] section in your project that includes the two files you just selected (refer to Figure 7.14).


  

<< Previous | Contents | Next (Chapter 8) >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved