The Import Dialog

The Import dialog is presented when the layout mode menu item File/Import is selected. The painter's object import facility supports the import of existing form, form field, menu and menu item objects. An existing object is one whose definition exists in the Zim Data Dictionary. The dialog consists of two sections: Import Target and Import Source.

Import Target Section

This section contains information relating to the target object for the import operation.

Form Name or Menu Name

The name of this field depends on whether the import source object is a form or form field, or a menu or menu item. The name of the field changes as the source object type changes between form type objects and menu type objects (refer to the description for the field Import Source / Source Type).
For form type source objects, this field contains the name of the form which owns the imported objects. When the painter is invoked by FORM DEFINE, this field contains the name of the form being painted, and is protected from being changed. If the source object is a form, then the import operation creates a frame into which all form fields owned by the form are imported. If the source object is a form field, it is imported as is.
When the painter is invoked by DISPLAY DEFINE, this field contains the name of either a form that already exists in the display or, a form that does not already exist in the display. The existing forms in the display are presented in the list box Existing Forms in Display. The former case applies to the import of form fields. They must be imported into a form that already exists in the display. The latter case applies to the import of forms. They must be imported into a form that does not already exist in the display. When importing a form field, Form Name and Directory Name are both protected from being changed. The desired existing form can be selected from the Existing Forms in Display list and both Form Name and Directory Name is populated from that selection. When importing a form, both Form Name and Directory Name become available for the user to enter the new form (and directory) names (essentially a "copy form" operation). Existing Forms in Display provides a list of those form names which cannot be used.
When importing menu type objects, menu can be imported only if a menu does not already exist. Menu items can be imported only if a menu does already exist. When importing a menu, both Menu Name and Directory Name become available to the user to enter the name and directory to be assigned to the menu being imported (essentially a "copy menu" operation). When importing a menu item, both Menu Name and Directory Name contain the name of the existing menu and are protected from being changed.

Directory Name

This field contains the name of the directory that owns the form or menu specified in Form Name or Menu Name. See the above description for Form Name or Menu Name for more information on when this field is available for user input.

Existing Forms in Display

This field contains a list of the forms [and their owning directories] that already exist in the display being painted. The list is empty if the display contains no forms (e.g. a new display), the painter has been invoked by FORM DEFINE, or the import source type is a menu type object.
When importing a form field object in DISPLAY DEFINE, Form Name and Directory Name must contain values that correspond to an existing form in the display. To accomplish this, click on the desired form within the list. Form Name and Directory Name are automatically populated from the selected list item. When importing a form object in DISPLAY DEFINE, this field provides a list of those values that cannot be entered in Form Name and Directory Name. If an existing form[directory] name is accidentally used, Import prohibits the operation.

Import Source Section

This section contains information relating to the selection of the source object for the import operation.

Source Type / Form

This field selects the source type object to be a form. When selected, the field Directories are populated with the names of the directories associated with all form objects in the Data Dictionary. The field Forms are populated with the list of forms owned by the first directory listed in Directories. In DISPLAY DEFINE, the first form listed in Forms and the first directory listed in Directories appear in the fields Form Name and Directory Name respectively, and the field Existing Forms in Display is deactivated (it can still be scrolled).

Source Type / Form Field

This field selects the source type object to be a form field. When selected, the field Directories are populated with a list of the directories associated with all the form objects in the Data Dictionary. The field Forms are populated with a list of all forms owned by the first directory listed in Directories. The field Form Fields is populated with a list of all form fields owned by the first form listed in Forms. In DISPLAY DEFINE, the fields Form Name and Directory Name are protected and the field Existing Forms in Display are activated.

Source Type / Menu

This field selects the source type object to be a menu. It is available only if a menu object does not already exist in the set of objects currently being painted. When selected, the field Directories are populated with a list of the directories associated with all menu objects in the Data Dictionary. The field Menus are populated with a list of all menus owned by the first directory listed in Directories. In all cases, the first menu listed in Menus and the first directory listed in Directories appear in the fields Menu Name and Directory Name respectively, and the field Existing Forms in Display is cleared and made unavailable.

Source Type / Menu Item

This field selects the source type object to be a menu item. It is available only if a menu object already exists in the set of objects currently being painted. When selected, the field Directories is populated with a list of the directories associated with all menu objects in the Data Dictionary. The field Menus is populated with a list of all menus owned by the first directory listed in Directories. The field Menu Items is populated with a list of all menu items owned by the first menu listed in Menus. In all cases, the name and directory of the existing menu appear in the fields Menu Name and Directory Name respectively, and the field Existing Forms in Display is cleared and made unavailable.

Source Type / Include Owned Objects

When a form or menu is selected for import, this field is set (and made unavailable) to indicate that all owned form fields or menu items are automatically imported. When a form field or menu item is selected for import, this field becomes available. If selected, all form fields or menu items owned by the source form field or menu item are imported as well. Otherwise, the source form field or menu item alone is imported.

Directories

This field contains a list of all directories that own either forms or menus in the Data Dictionary. The list is associated with forms if the source type is a form or form field, and associated with menus if the source type is a menu or menu item. Selecting a different directory in the list causes the Forms (or Menus) list to be repopulated. If the source type is a form field (or menu item), the Form Fields (or Menu Items) list is also repopulated accordingly. In DISPLAY DEFINE, and if the source type is a form, the selected directory in this list appears in the field Directory Name. In all cases, if the source type is a menu, the selected directory in this list  appears in the field Directory Name.

Forms or Menus

This field contains a list of all forms or menus owned by the selected directory in Directories. If the source type is a form field (or menu item), selecting a different list member causes the Form Fields (or Menu Items) list to be repopulated accordingly. In DISPLAY DEFINE, and if the source type is a form, the selected form in this list appears in the field Form Name. In all cases, if the source type is a menu, the selected menu in this list appears in the field Menu Name. When the source type is either a form or menu, it is the selected member in this list which is imported.

Form Fields or Menu Items

If the source type is either a form field or a menu item, this field contains a list of all form fields (or menu items) owned by the selected form (or menu) in Forms (or Menus). In either case, it is the selected member in this list which is imported.

Dialog Push Buttons

OK

This push button performs any required data validation, performs the import operation, and returns to the Screen Painter's layout mode. The current selection settings in the Import dialog are preserved.

Cancel

This push button returns immediately to the Screen Painter's layout mode. The current selection settings in the Import dialog are preserved.

Help

This push button invokes the Zim Help facility, initially displaying the section entitled Import dialog (this section).