openwizard
WIZARD
,
OPTIONS

The openwizard statement opens a wizard, just as it would be opened by selecting that wizard from the menubar.


Parameters

This statement has two parameters:

wizard – Name of wizard to open.

options – Parameter to pass to the .InitializeWizard procedure


Description

This statement opens a wizard, just as it would be opened by selecting that wizard from the menubar.

openwizard "Formula Workshop"

If the same wizard appears in more than one submenu, the first one will be used.

The Open Wizard Process

The openwizard statement uses a special process to open a wizard.

First, it opens the wizard database without any wizards.

Once the database is open, it checks to see if it has a procedure named _WizardInfo. If not, the wizard database is opened normally.

If this procedure does exist, it is called as a function. This procedure should use the functionvalue statement to return a dictionary which contains information about the wizard. Here is a typical example.

functionvalue initializedictionary(
    "MAINFORM","Formula",
    "POSITION","top right",
    "MULTIPLEMAINFORM",true()
)

If a MAINFORM is specified, this form will be opened as a clone window. No other windows will open, no matter what windows were open when the database was last saved. This means that you cannot edit the form in this window. If you want to edit the form, you will have to explicitly open the original, non-clone version of the form.

If a POSITION is specified, the wizard window will open in that position. There are nine possible positions: top left, top center, top right, left center, center, right center, bottom left, bottom center, and bottom right. If an alignment axis is not specified it is assumed to be center, for example top is the same as top center. The order of the options does not matter, for example top left and left top are the same. There must be a space if multiple keywords are used – you cannot say topleft or bottomright.

If a MULTIPLEMAINFORM is true, the wizard allows multiple cloned main windows. In this case, the the openwizard statement will always open a new window, even if the wizard is already open. If this is false (or missing) and the wizard is already open, the openwizard statement will simply bring the wizard’s current window to the front. (Note: If openwizard creates a new window, it will call the wizard’s _NewCloneWindowName procedure. This function should use the functionvalue statement to return the correct name for the new window. Here is an example which returns the database name plus a numeric suffix for the window name.

fileglobal windowNumber
define windowNumber,0
windowNumber = windowNumber+1
functionvalue info("databasename") + ?(windowNumber=1,""," ("+windowNumber+")")

As a last step, the openwizard statement calls the wizards .InitializeWizard procedure (if there is one). This allows the wizard to do final initialization based on any options passed to the openwizard statement (the second parameter passed to this statement).


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but now uses a special process for opening wizards.