The Wizard Maker is a simple integrated development environment (IDE) for the generation of script-driven wizards. Such wizards serve as a front-end to your script, introducing its functionality to other users and allowing them to easily enter parameters and control its execution.
Using scripts, there is very little you cannot accomplish in ECOTECT and many of the other Square One building performance analysis tools - allowing you to extend the functionality of each tool by adding your own features, however complex or trivial. Using wizards provides users with a consistent interface to your scripts as well as a description of what it is about to do to their model.
CREATING A NEW WIZARD
You can create your wizard interactively within the DESIGN page. This displays a facsimile image of the Wizard Dialog box that will be displayed, as well as controls for adding, selecting and editing items within it. You can interactively edit the overall title of the wizard as well as the title, description and question on each page in the sequence presented to the user. In addition, you can use the SCRIPT page to assign events to individual controls and create functions that affect the interactive operation of your wizard as it runs.
The following is a description of the basic steps in creating and editing your wizard:
Adding a New Item
You add items using either items in the Add menu or the small icons sitting just above the top of the wizard. When you select one of these items, the design surface will change to a redish colour, indicating that it is active and ready for you to insert the object by clicking with the left mouse. If you click and release in the same position, the item is positioned at that exact point with a default size. If you click and drag, the item will be positioned at the start point with a size determined by the distance you dragged in each direction.
At any time, you can cancel out of this add-object mode using the ESCAPE key or by clicking the SELECT button (indicated by a cursor arrow).
Selecting an Item
To select an item, you may need to activate the design surface first. This is done by double-clicking the left mouse button in an empty area of the design surface located to the right of the wizard dialog's body area. Alternatively, you can click the SELECT button until it of shown in a down position, or press F2. An active design surface is indicated by gray dotted grid lines within it. Once activated, you can select items within it by clicking them with the left mouse button.
You can also toggle the selection of an item by double-clicking its name in the item list located in the top-right of the main application window.
Interactively Moving and Resizing
You can move and resize items in the active design surface by clicking and dragging the nodes displayed on currently selected items. Additionally you can use the CONTROL and ARROW keys to nudge items around, or the SHIFT and ARROW keys to resize them. Holding the CONTROL, SHIFT and ARROW keys nudges items in 5 pixel increments.
You can also move or size selected items by editing their Top, Left, Width and Height properties in the property editor located immediately to the right of the wizard.
Editing Specific Properties
The property editor located immediately to the right of the wizard allows you to control a wide range of settings for the currently selected item. To do this, select the required row in the list and then either type in a new value or select from the list that is presented. Changes are applied immediately.
Adding and Deleting Pages
To add a new page to you wizard, either click the Next >> button at the bottom (when you are at the last page in a sequence) or choose the Insert Page... item in the Page menu.
To delete a page, use the << Prev or Next >> buttons to ensure that it is the current page ad then choose the Delete Page... item in the Page menu.
Assigning an Event to an Item
You can assign functions to any item in the wizard. This allows individual items to respond to changes in their value, mouse clicks or losing the input focus. This process is carried out in the SCRIPT page and requires some knowledge of scripting.
To assign a function, select the item you wish to assign in the hierachical list to the right of the script editor. Then right-click to display the context menu and choose the type of event you want the item to respond to. A dialog bow will then be displayed asking for the name of the callback function to use. If you enter the name of a function that does not already exist, it will be created for you and a command similar to the following added to the current script:
As you get used to this process, you will likely add these functions and references by manually edting the script text. The menu items simply offer a short-cut and provide examples of the required format.
Loading, Saving and Testing Your Wizard
Obviously you can use the Save, Save As... and Load... items in the File menu to manage your wizard files. You can then use the Test Wizard... item to display the wizard you have created as a popup dialog box. If you have entered an accompanying script, this process will first save both wizard and script to a temporary file before running them. This way, you can test all the interactive features of your assigned callback functions. Wizard files are stored as WZD files whilst the script is saved as an SCR file with the same name.
Obviously the WizardMaker does not have all the functionality of programs such as ECOTECT or the WeatherTool. This, at least while you are designing the basic operation of your wizard, you must not use complex calls to objects or properties that are specific to these other applications.
Wizard files (.WZD) are simple ASCII files with slightly complex format for specifying the hierarchical set of pages, items and properties it contains. Whilst there is no reason you cannot manually edit these files, the format can be a little tricky as some parts of it are parsed directly by WizardMaker whilst others are sent directly as pseudo-Pascal to parent controls.
The following is the first few lines of an example WZD file:
[WizardMaker_v1.0] WizardTitle=| an example wizard | WizardHeight=420 WizardWidth=690 [#Page:1] PageTitle=CREATE RECTANGULAR ZONE Question=ZONE SIZE AND POSITION ? Description.Strings=( 'This script creates a simple rectangular zone in your model. ' + 'NOTE: If you check the ''Create a New Model'' option, unsaved changes ' + 'to your existing model' will be lost.' ) Components.Strings=( object Panel: TJvDesignPanel Left = 249 Top = 35 Width = 416 Height = 247 Anchors = [akLeft, akTop, akRight, akBottom] BevelOuter = bvNone Color = clWhite ...