Using Viewer Commands

Viewer offers many commands in addition to ExecProgram that you can use to customize its operations. Two important uses of these commands are adding custom buttons and custom menus. To add these features, you include Viewer commands in your project file or topic text.

Summary: Adding to Viewer

To add a button or menu to Viewer, create a [CONFIG] section in the project file and insert commands that add the features you want. “Adding and Removing Buttons” and “Adding and Removing Menu Items,” both later in this chapter, describe the commands you enter.

Summary: Adding to Individual Topics

You can also remove or disable a button or menu item when the user displays a particular topic in the title (by jumping to the topic, selecting it from a search or history list, or using a browse button or the Back button to display it). To do this, add the appropriate Viewer command as a footnote to the topic heading. Viewer executes this command when the user displays the topic, and the command remains in effect until the user ends the Viewer session or opens a new title. Footnotes for executing Viewer commands are marked with an exclamation point (!).

·To create a command footnote for a topic:

1.Place the cursor at the beginning of the topic heading you want.

2.From the Insert menu, choose Footnote.

The Footnote dialog box appears.

3.Enter the exclamation point (!) as the footnote reference mark.

A superscript exclamation point ( ! ) appears next to the heading and the cursor moves to the footnote window.

4.Type one or more Viewer commands as the exclamation-point footnote.

Make sure only one space exists between the exclamation point (!) and the command text. Separate multiple Viewer commands with semicolons (;). A single exclamation-point footnote can contain up to 255 characters; however, you can enter more than one exclamation-point footnote per topic.

5.Click in the text window to return to the topic text.

Viewer commands allow you to do more than simply control custom buttons and menus. For example, you can use Viewer commands in hot spots to perform navigational operations (such as select jumps or browse forward or backward), execute standard Viewer commands, or execute external Windows applications.

See Chapter 18, “Multimedia Viewer Commands,” for complete descriptions of the commands you can use to configure Viewer.

If you are a proficient C programmer and wish to write dynamic-link libraries (DLLs) to work with Viewer, you can register any DLL function as a Viewer command and use that function wherever you use standard Viewer commands. See Chapter 14, “Writing DLLs for the Multimedia Viewer,” for information on how to do this.