Getting Started With Hypermedia Using HELM

by Randy Finch

A few issues ago (AC 9.3), I had an article in the pages of this magazine comparing CanDo and HELM. (If you have not read it, I suggest you do so since in this article I will be assuming that you are already familiar with the HELM features discussed in the earlier article.) I found both products to be good tools for various tasks. I have been writing a tutorial series about CanDo, but this is the first one I have written about HELM. If there is sufficient interest, perhaps I can write more. The version of HELM I wrote about in AC 9.3 was 1.37. Since that time I have received two updates, the latest being version 1.50. (HELM v1.55 is the current version, but I have not received it yet. I expect it in a few days.)

Hypermedia

One of the primary uses of HELM is for developing hypermedia applications. Hypermedia applications bring together many different forms of communication such as text, graphics, animations, sound, music, narration, etc. The hyper in hypermedia means that the user can navigate through the document by clicking on buttons, text, and other selectable objects on the computer screen. This allows documents to be non-linear in nature, being traversed as the user wishes rather than the way the programmer wishes. (For a humorous look at hypermedia, read the example document shown in Figure 1).

Getting Started

The program, or book as it is referred to in HELM, that I created is entitled HyperMediaDemo. It's interface is shown in Figure 1. It is really quite simple to create such a book.

When HELM first loads, it displays the BookShelf, which is a program that displays a bunch of buttons containing the names of the books on the shelf (Figure 2). By clicking on the appropriate button, a book can be loaded. By clicking on the New Book button and then typing in the name for the book, the first page of the new book will be displayed, blank and ready for objects to be added. At this point it is good to stop and reflect on how the book should be put together.

Forms

Typically, in a hypermedia book, there will be many, many pages of text, graphics, and what have you. However, there will be a number of pages that will have common objects, such as buttons, selection boxes, etc. HELM allows such objects to be put on a form. Any number of pages can be attached to a form. Each page will contain every object that is on the form.

To select the underlying form of the blank first page of the book, select the Edit Form menu item in the Edit drop-down menu. (From this point forward, I will refer to a menu item using the format Menu/Menu Item, e.g. Edit/Edit Form.) When a check mark is visible next to the menu item, the form is being edited rather than one of its child pages. At this point, any objects that are needed on all of the pages to be associated with this form can be added to the screen. Bear in mind that a book can have many different forms each having many child pages (Figure 3).

In the case of the book HyperMediaDemo, the five buttons to the left of the screen are all common to the pages in the book. For the purposes of this tutorial, the book only contains two pages, but many more could be added. The fastest way to create the five buttons is to first create only one button. By double-clicking the button while in selection mode, an object information requester will appear (Figure 4) allowing all of the properties of the button to be edited. HELM's objects have many properties such as name, color, pen color, border style, width, etc. Once the button looks the way you want it to, exit the requester. Now the button can be duplicated using the Object/Duplicate menu item. This item brings up a requester that allows you to create a number of duplicates in row and column format (Figure 5). A name change for each of the duplicates completes the process.

Pages

Now it is time to create the pages of the book. To edit the page, select once more the Edit/Edit Form menu item. This will remove the check mark and make the page available for editing. Please note that objects on the form cannot be edited while in page edit mode. You must return to form edit mode to do this.

HyperMediaDemo only contains one object on its pages that is not on the form, the large multi-line textfield object on the right side of the page. Once this object is added to the first page of the book, and the properties of the object have been defined, the page can be copied as many times as you like in preparation for the bookmaking process. To copy a page, select the Edit/Copy Page menu item to copy the current page to the clipboard. Then select the Edit/Paste menu item as many times as needed to create multiple pages identical to the first. Now you will have many pages containing five buttons and a blank multi-line textfield object. The multi-line textfield on each page must then be filled in with the text needed for the document. The two pages of the HyperMediaDemo are shown in Figures 1 and 6.

Hypertext

One of the features of HELM that makes it so useful for hypermedia is its ability to turn blocks of text into hypertext. As you can see from Figures 1 and 6, the appearance of hypertext can be modified so it stands out from the rest of the surrounding text.

To create hypertext in HELM, make sure you are in browse mode and that the text is not locked (more about this later). Select the chosen text by double-clicking at the beginning of the text, dragging the mouse over the text, and then releasing the mouse button. The text will be highlighted. Now select the Text/Hypertext menu item. The item will become checked, and the selected text will now be hypertext. Other blocks of text can be converted to hypertext in the same manner. The appearance of the hypertext can be set by selecting the Author/Hypertext menu item and then making the appropriate selections in the requester (Figure 7).

Actions

HELM allows objects to have either actions or scripts or both associated with them. Actions are the simplest way to add functionality to an object. They are built up in an interactive fashion using a requester (Figure 8). Actions can be used to add quite sophisticated functionality to an object. However, for more complex tasks, scripts must be written. HELM has its own scripting language for this purpose.

HyperMediaDemo shows off some of the simpler features of HELM and thus uses actions for every object except the Quit button. To add actions to one of the buttons, make sure you are editing the form, select the button while in selection mode, and then choose the Object/Actions menu item. The actions requester will appear. Select the object event, such as SelectUp or SelectDown, to which the actions should respond from the rollo button in the upper-right corner. Next, click on the first action to occur from the lower-right-hand list box and drag it to the upper-right-hand box. Depending on the action selected, additional information will need to entered to the left of the requester. For instance, if a picture action is selected, you must pick the picture to be displayed and then specify whether it should be loaded, shown, unloaded, etc. Once the specification is complete, another action can be added to the list in the same manner as the first was added. To see how the button responds, select the button while in browse mode. The actions will be executed in sequence.

To create actions for the hypertext blocks, make sure you are editing a page (not difficult to realize since the textfield cannot be seen when editing the form). While in browse mode with the text unlocked, click on the hypertext. Next, choose the Text/Actions menu item. The Actions requester will appear, allowing a list of actions to be created. To see how the hypertext responds, you can shift-click the hypertext while in browse mode if the text is unlocked or simply click the hypertext in browse mode if the text is locked. The text can be locked from the object information requester for the textfield. In order to avoid switching back and forth from the page to the object information requester to lock and unlock text, the text can be unlocked temporarily by selecting the Edit/Unlock All menu item. It can be re-locked by selecting this menu item again.

Scripts

As mentioned earlier, objects can have scripts associated with them. Scripts are created by selecting the Script menu item that corresponds to the Actions menu item as described above. An editor will be opened awaiting your input. The scripting language for HELM is quite extensive and is not discussed in this article. It will be covered in future articles if there is interest.

The Quit button is the only object in the HyperMediaDemo book that uses a script. Pressing this button causes a Yes/No type requester to appear asking if you really want to quit (Figure 9). This requester is created with HELM's script command Answer. There is no equivalent action.

Remember that an object can have actions and a script associated with it at the same time. When this is true, the actions will execute first and then the script. Keep this in mind if an object seems to be doing odd things. Sometimes you may think that only actions or a script are associated with an object when in fact both are.

HyperMediaDemo's Objects

The most prominent object on the pages of HyperMediaDemo is the textfield object. There is a separate textfield object for each page so they can contain different text. There are many textfield properties and options that can be set via the object information requester. I specified the scroll bar to the right of the textfield and the up, down, page up, and page down buttons under the textfield. I also chose an option that allows the name of the textfield to appear above the textfield. Thus, for page one, the textfield has a name of "The Story of HyperMedia". The appearance of the lines separating the text was also set as an option. Of course, the colors of the various parts of the textfield are user selectable. Since the textfield contains hypertext, you will also want to specify the locked text option so that hypertext can be selected and activated without having to hold down the shift key.

The main objects of interest in HyperMediaDemo are the hypertext blocks in the textfield on page one (Figure 1). The hypertext itself refers to the type of activity that will occur if it is selected. For instance, clicking on either the hypertext blocks "hypertext" or "HyperMedia" causes a Blackboard action to occur. This action displays a small framed box containing the text you have specified in the action requester. The text will be centered in the box. There are two ways for the hypertext actions to be activated; a SelectUp or a SelectDown. The former waits for the mouse button to be released before executing the actions; the latter executes them as soon as the mouse button is pressed. The choice is yours.

The "pictures" and "animations" hypertext blocks both perform a Picture action when pressed. This action can display either ILBM pictures or ANIM-5 animations. The picture or animation to be displayed must be specified in the action requester.

The "sound" hypertext block performs a Sound action, which can play any 8SVX file. The "music" hypertext block performs a Music action, which plays SMUS files.

Finally, the "narration" hypertext block performs a Narration action, which can speak any text entered in the appropriate box on the action requester. If you want the Narrator to speak a portion of some text in a textfield, you can mark the portion of text in the textfield, copy it to the clipboard, and then paste it into the box in the action requester. In order for the Narration action to execute, you must select a previously created Narrator. This is done by selecting the Author/Narrator menu item. A requester will appear, allowing you to define the name of a Narrator and to fine tune the speaking parameters to your liking (Figure 10). Several Narrators can be defined at one time. The one to use for any particular Narration action is selected in the action requester. Also, be aware that the latest versions of AmigaDOS do not come with the appropriate library and device to produce speech. The last release to have these files was AmigaDOS 2.04. If you have an older copy of AmigaDOS, you can install these files under version 2.1 or 3.0, and they will run.

HyperMediaDemo has five button objects that are attached to the form and thus appear on every page associated with the form. All but one of the buttons use actions to perform their task. For instance, the Bookshelf button simply executes the HELM Command Bookshelf via an action. The Prev Page and Next Page buttons perform a Go To Previous Page and Go To Next Page action, respectively. The Stop Sound executes two actions: the HELM command Stop Sound and the Narration command with null text. The Stop Sound command will stop a sound or music file, but does not stop narration. However, issuing another Narration command with no specified text stops any narration that is currently being performed. The Quit button functions via a script rather than actions. It uses the Answer script command to display a Yes/No type of requester to verify that the user want to quit HELM. This command is not available via an action.

Resources

I have talked a bit about how HELM uses pictures, animations, text, sound, and music. Obviously, these files must be created with some software and then stored on disk. When an action is attached to an object, the file on which the action should operate must be specified.

As an alternative, HELM allows these type of files, also called resource files, to be loaded directly into a book. This is accomplished by selecting the Author/Resources menu item and importing the files of your choice (Figure 11). Once the files are part of the book, they can be referenced rather than their disk file counterparts. When navigating the file list within the action requester, there will be a special volume available named Resources. When this volume is selected, all of the resource files that have been imported into the book will be displayed. These resource files can be referred to in a script by preceding the name of the resource with a \s such as "\sMyResource".

Adding a bunch of small resources to a book can be helpful in managing your files; however, large resources such as complex animations should be left as separate files since they can swell the size of a book to near bursting proportions.

Problems

I ran into a few problems with displaying pictures and animations, as well as with hypertext in general under version 1.50 of HELM. I have reported all of the problems presented here to Eagle Tree Software, the company behind HELM. I will be receiving version 1.55 shortly, which may correct some of the problems. However, it is known that some of the problems still exist and work is already in progress to correct them. Some of the problems I encountered were not reproducible with different resource files, so just because I had a problem with displaying a particular ILBM file, this does not mean you will have the same problem with a different ILBM file.

The first problem I encountered was with the computer hanging up or crashing when displaying an ILBM picture by shift-clicking unlocked hypertext. The problem went away after locking the text and then selecting it with a simple click.

The next problem involves playing animations. Some animations play fine. Others play, but the computer crashes when trying to return to the HELM screen. One particular animation would not play at all. The first frame of the animation would appear, then fireworks would be displayed on the screen, and then CRASH! I have sent this particular animation, which displays fine with Directory Opus, CanDo, and Deluxe Paint, to Eagle Tree Software for further study.

If you specify in the object information requester that the text in a textfield should have some attribute such as bold and then later try to create a hypertext block in the middle of the text, the text after the hypertext will no longer be bold.

The selection area for a hypertext block seems to be offset from the actual text making up the hypertext block. For instance, if the word SelectMe is hypertext, the selection area runs from the first e in the word to the space after the word, an offset of one character to the right.

Lastly, when the text cursor is positioned over hypertext, the Text/Hypertext menu item will be checked. However, after some operations, the cursor will still be over the hypertext, but the check mark will no longer be there. With the check mark gone, the Text/Actions and Text/Scripts menu items cannot be selected. The hypertext block must be selected again to get the program back on track.

Conclusions

I find HELM to be a good tool for creating hypertext or hypermedia applications. However, there still seems to be some problems with its handling of hypertext and animations. Hopefully, these problems have already been solved in the latest version or will be in a later release. I hope to be with you again in the future discussing other features of HELM.


Back to list of articles
Back to Randy Finch's Home Page
Last modified on April 1, 1996
Randy Finch at webmaster@rcfinch.com