Custom dialogs

A custom dialog add-in is a menu that is created using the GenStat resource language that is loaded at run time. A dialog is a user-interface object (menu) that presents information and allows users change the information. It can contain one or more controls (child windows) with which the user enters text, chooses options, or directs the action. In GenStat a custom dialog can be used to retrieve data from the controls and the data can then be used within an attached GenStat procedure. The resource language commands for the dialogs are supplied within a GenStat resource file (*.grc) that is attached using a GenStat add-in file. A procedure that is to be used in conjunction with a dialog should be supplied within a procedure library in an add-in folder.

For details about designing dialogs see the GenStat resource language.

Attaching to GenStat

To attach a custom dialog menu add-in to GenStat the details must be supplied within a GenStat add-in (GAD) file. Within the GAD file each add-in is specified in a separate section called [AddInX] where X is a number. If you have more than one add-in these can be specified in the same file (as AddIn1, AddIn2, etc...) or within separate files. The details of the add-in are then supplied using different subsections. For example, SUBSECTION = ...details...

The type of add-in, in this case the dialog, should be supplied using a subsection called Type. Each add-in needs to be supplied a unique ID using the ProgID subsection. This is required so that GenStat can easily distinguish between different add-ins. This can be supplied as a string of characters. The name that is to appear on the User menu should be supplied using the subsection MenuTitle. Finally the name of the file containing the dialog resources should be entered using the subsection ResourceFile. The full path must be supplied with the resource filename, unless the resource file is contained same folder as the GAD file. The following example shows the layout of the GAD file that can be used to attach a dialog.

    [AddIn1]
    Type=DIALOG
    ProgID=MYDIALOG
    MenuTitle=My Dialog
    ResourceFile=mymenu.grc

Dialogs can be grouped together under a menu item using a Submenu subsection in the GAD file. The following example shows the layout that can be used to attach 2 dialogs under the same menu section called New Dialogs.

    [AddIn1]
    Type=DIALOG
    ProgID=MYDIALOG1
    MenuTitle=My Dialog 1
    ResourceFile=mymenu.grc
    Submenu=New Dialogs

    [AddIn2]
    Type=DIALOG
    ProgID=MYDIALOG2
    MenuTitle=My Dialog 2
    ResourceFile=mymenu2.grc
    Submenu=New Dialogs

To make the add-ins accessible from GenStat the GAD file should be created using the file extension .gad. The file should then be placed in either the system or user add-in directory. To make a custom menu add-in available system wide, i.e. to all users that have access to GenStat on a network server or on a local machine, the file should be placed in the system add-in folder called AddIns within the GenStat installation. Alternatively, to make the custom menu add-in only available to the current user the file can be placed within the user add-in folder. The location of the user add-in folder is controlled via the workspace tab within the options.