How a Wizard Works

Basically, a wizard is asked to gather some information from various intermediate steps. That information is then made available to the final step, which will execute the ultimate goal of the wizard. For example, let's consider the creation of desktop shortcuts again.

The first page allows you to specify the name of the file you want the shortcut to represent. When you type in something and ask it for a new page, what you've just entered is validated. If it is consistent with the specific goals then the next page of the wizard is displayed. Otherwise an error message will inform you of what was wrong.

The second page of the wizard allows you to enter descriptive text for the item. This information will be added to the rest. At any stage you can choose to continue, or go back to the previous page and edit what you have already entered.

When the user clicks Finish, the wizard will start the decisive procedure, making available all the information the user specified at the various stages.

A wizard for creating scriptlets works in the same way. The first pages gather some of the user's preferences, while the Finish button actually writes a file with an

.htm
extension, according to the options set along the way.

© 1997 by Wrox Press. All rights reserved.