Common Desktop Environment: Help System Author's and Programmer's Guide

Displaying Graphics

Help supports four graphics formats:

To Create a Figure

  1. Declare a file entity to identify the image file to be included in the figure.

    <!entity graphic-entity FILE "filename.ext">  

    Remember, all entity declarations must come before any other markup at the top of your help volume.

  2. Use the <figure>element as shown:

    <figure entity=graphic-entity> 
     caption string
     <\figure> 

    Where graphic-entity is the entity name for the graphic file you want to display, and caption string is an optional string. Caption text is displayed above the graphic.

    By default, figures are numbered and the number is prepended to your caption string. To create a nonnumbered figure, include the nonumber parameter (as shown in one of the following examples).

    If you want the figure to be a hyperlink, use the ghyperlink (graphic hyperlink) and glinktype (graphic link type) parameters as shown:

    <figure entity=graphic-entity ghyperlink="id" glinktype=type>
     caption string
     <\figure>

    The ghyperlink and glinktype parameters work just like the hyperlink and type parameters for the <link> element.

Examples

For these examples, assume that you've declared these two file entities at the top of your help volume:

<!entity FirstPicture  FILE "first.tif">
 <!entity SecondPicture FILE "second.pm"> 

See Also

To Display an Inline Graphic

  1. Declare a file entity to identify the image file to be used in the figure.

    <!entity graphic-entity FILE "filename.ext">  

    Remember, all entity declarations must come before any other markup at the top of your help volume.

  2. Use the <graphic> element as shown:

    ... text <graphic entity=graphic-entity>  text ...

    Where graphic-entity is the entity name for the graphic file you want to display.

    To use a graphic as a hyperlink, place it inside a <link> element:

    <link parameters><graphic entity=graphic-entity><\link> 

    Note -

    The <graphic> element is intended for small graphics, although larger images can be used. Additional white space is added between lines to accommodate the height of the graphic.


Example

Here's an example that uses a small X bitmap image in the middle of a sentence. First, at the top of the volume, the bitmap file must be declared as a file entity:

<!entity StopWatch FILE  "stopwatch.bm"> 

Within the help text, the image is inserted using the <graphic> element:

Whenever you see the <graphic entity=StopWatch> symbol, stop and 
answer the quiz questions.

This markup produces this output.

Graphic

To Wrap Text Around a Graphic

  1. Declare a file entity to identify the image file to be included with the paragraph.

    <!entity graphic-entity  FILE  "filename.ext"> 
  2. Use the <p> element (paragraph) with the gentity parameter as shown:

    <p gentity=graphic-entity> Paragraph text here ...
    

    Where graphic-entity is an entity name that refers to the graphic file you want inserted.

Example

Suppose you want to display an icon named sample.pm and wrap paragraph text around it. First, declare the file entity:

<!entity HelpKeyIcon FILE  "helpkey.xwd"> 

Then, enter the paragraph:

<p gentity=HelpKeyIcon gposition=left> The F1 key is a Help key. When 
you press F1, the application you are using displays the help topic 
most closely related to your current activity.
Graphic

To right-justify the graphic, add the gposition parameter like this:

<p gentity=HelpKeyIcon gposition=right>Many desktop components 
support multicolor icons, 
in addition to two-color images.

Here's the markup for a paragraph wrapped around an icon, where the icon is a hyperlink that displays a topic with the ID icon-editor in a new window:

<p gentity=my-icon ghyperlink="icon-editor" glinktype=JumpNewView> 
Many desktop components support multicolor icons, 
in addition to the two-color images.

See Also