3 Eloquence Graphical User Interface

Dialog Definitions File

Overview

The layout and some functions of dialogs can be stored in dialog definition files.

This files consists of several parts, which have different functions. To understand how the ISA Dialog Manager works, it's necessary to have some knowlegde about the definitions file.

When starting to create an dialog you have to load some basic definitions, which are defined in the Defaultsfile. During creation of the dialog you add your definitions to this file.This are resource definitions, as fonts or colors, models and the dialog definitions of one or more certain dialogs.

To create the resource definitions and models only ones, it is recommended to use modular definition files. This feature helps to encapsulate reusable information.

The DEFAULTS File

The defaults file is used to provide defaults to dynamically created objects and will be used by the CVDLG utility program to convert dialog files. In addition it controls the dynamic behavior of the dialog server.

This chapter will shortly introduce each major element of the Eloquence defaults file. Please refer to the ISA Dialog Manager documentation for further reference.

Callback Functions

The callback functions are used by Eloquence to filter unexpected events. If a unexpected event is recognized, it will be ignored. All further processing is done through the appropriate rules.

Eloquence needs the functions below to keep track of the current object state.

 
Function name Called
EqPushButtonCBif a pushbutton is selected
EqCheckBoxCBif a checkbox is (de-) activated
EqRadioButtonCBif a radiobutton is activated
EqEditTextCBif an edittext looses focus

Returning from DLG DO

Returning from the DLG DO statement is achieved by calling the procedure EqExitEventLoop. It will return control back to Eloquence with a given return code and an object path.

 
Function name Description
EqExitEventLoopThis will terminate the DLG DO statement with the given object and rule value.

Resources

Resources are platform dependent. Resource variants allow to have the same dialog source file for all platforms.

Whenever there are resource variants, they are used in the following manner:

 
Variant Platform
0Motif GUI
1Microsoft Windows GUI
2Alpha Windows

To activate the appropriate resource variant you specify it on the driver command line, e.g.:

   -IDMfont 1 -IDMcolor 1
This will start-up Dialog Manager with font and color variant 1. Please refer to the ISA Dialog Manager documentation for a description of valid command line arguments.

The following font resources are allocated by default:

Attributes

There are some user-defined attributes allocated for use by Eloquence:

Popup Box

The Eloquence POPUP BOX statement is mapped to the EqPopup window and its associated rules.

It will be configured dynamically by Eloquence according to the needs of a POPUP BOX statement.

Rules

Using Modular Dialog Files

Dialog Manager Versions A.03.02a and above allow modular dialog files. This new feature helps to encapsulate reusable information into module files while the dialog file itself is stripped down to its dialog specific information.

NOTE: This feature is currently unsupported. There is a severe bug in the underlying ISA Dialog Manager library (a file descriptor leak), which will cause a fatal dialog server failure after processing a few dialogs.

Although this feature has bugs and is therefore unsupported, we strongly recommend that you get in touch with modular dialog files, because they have great advantages due to reduced redundancies. This will help you to reduce maintenance effort significantly.

The next Eloquence patch will provide full support for modular dialog files assuming the Dialog Manager bug has been fixed.

You find a detailed description of modular dialogs in the Dialog Manager release notes 8/95, Version A.03.02a. These release notes will discuss only Eloquence specific issues.

There is a new modular Eloquence defaults.eq file. You find it and the related modules at the following locations:

HP-UX:
/opt/eloquence/lib/module
Windows:
C:\DLG\MODULE
This file contains the include directives for the following modules:

eqrsrc
fonts and colors
eqbind
functions, accelerators, standard rules
eqdef
defaults
eqpopup
EqPopup window
You find these files in the module directory named above.

Additionally, there are the related interface files with the extension .if.

To use these modules, follow these steps:

  1. In order to access the module files, you must establish the IDMLIB access path. This can be done either by using the IdmLib configuration item in the eloq.ini file or by setting the IDMLIB environment variable.

* HP-UX: eloq.ini, section [dmsrv]
IdmLib = /opt/eloquence/lib/module:/opt/eloquence/lib/mymodule

* HP-UX: IDMLIB environment variable
IDMLIB = /opt/eloquence/lib/module:/opt/eloquence/lib/mymodule
export IDMLIB
(You should include these statements in your .profile.)

* Windows: eloq.ini, section [dlgsrv]
IdmLib = C:\DLG\MODULE;C:\DLG\MYMODULE

* Windows: IDMLIB environment variable
set IDMLIB = C:\DLG\MODULE;C:\DLG\MYMODULE
(You should include these statements in your AUTOEXEC.BAT.)

The mymodule directory is an example for a directory containing your own modules. The directories are separated by a colon (':', Motif) or a semicolon (';', Microsoft Windows).

  1. Adjust the following files according to the contents of your current defaults.eq file (if you have never changed the defaults.eq please continue with step 4):

* eqrsrc.mod

* eqbind.mod

* eqdef.mod

* eqpopup.mod

  1. If you had to change the files in step 2 you should re-create the related interface files.

To do this you change to the module directory named above and execute the idm utility with the +writeexport option:

idm +writeexport interfacefile modulefile

Example:

idm +writeexport eqdef.if eqdef.mod

On Microsoft Windows you should specify the full access path to the idm utility and the interface file. You can use the IDMLIB value to access the module files (if the IDMLIB environment variable has been defined), e.g.:

C:\IDM\IDM +writeexport C:\DLG\MODULE\EQDEF.IF IDMLIB:EQDEF.MOD

Repeat this for each of the four files in the following order:

* eqrsrc.mod (eqrsrc.if)

* eqbind.mod (eqbind.if)

* eqdef.mod (eqdef.if)

* eqpopup.mod (eqpopup.if)

If you do not have the Dialog Manager development software you should manually
adapt the existing interface files:

* Each object defined and exported in a module file has a corresponding declaration statement in the associated interface file.

* So, if you removed exported objects from a module file, you should lookup the corresponding declaration in the interface file and remove it, too.

* If you added new exported objects, you should add a corresponding declaration statement to the interface file.

  1. At last you should change your eloq.ini configuration file. You should add a new user-defined section which overrides the DefaultsFile configuration item to use the new modular one. When starting the dialog server with the DLG SET statement, specify this configuration name as an argument, e.g:

[UseModules]
DefaultsFile = /opt/eloquence/lib/module/defaults.eq

DLG SET ".driver","motif UseModules"

Alternatively, you can change the DefaultsFile setting in the default dialog
server section to use the modular defaults.eq file:

* HP-UX: DefaultsFile=/opt/eloquence/lib/defaults.eq

* change to: DefaultsFile=/opt/eloquence/lib/module/defaults.eq

* Windows: DefaultsFile=C:\DLG\DEFAULTS.EQ

* change to: DefaultsFile=C:\DLG\MODULE\DEFAULTS.EQ

Using Models

Dialog Manager models provide an efficient way to handle similar objects instead of defining a lot of individual objects.

Example:

   model statictext YellowText
   {
      .fgc ColBlack;
      .bgc ColYellow;
      .width 10;
      .text "YellowText";
   }
   ...
   child YellowText Yt1
   {
      .xleft 30;
      .width 15;
      .ytop 0;
   }

This defines the model YellowText. It is derived from the statictext object default, but defines its own attribute default values.

The instance Yt1 of the YellowText model will inherit all attributes as defined by the statictext default and the YellowText model.

The resulting object will display "YellowText" with black text on a yellow background.

Models may also define new attributes for Dialog Manager objects and may have default rules associated with them.

The following example will define the model MyMenuItem which is derived from the default menuitem object type. MyMenuItem defines an EqRule attribute and a rule causing return from DLG DO statement to Eloquence when an instance of the MyMenuItem is selected and this instance has a nonzero EqRule value:

   model menuitem MyMenuItem
   {
      .text "MyMenuItem";
      integer EqRule := 0;
   }
   ...
   child menubox
   {
      .title "&File";
      child MyMenuItem About
      {
         .text "&About";
         .EqRule := 1;
      }
      ...
      child MyMenuItem Exit
      {
         .text "&Exit";
         .EqRule := 2;
      }
   }
   ...
   on MyMenuItem select
   {
      if this.EqRule then
         EqExitEventLoop(this, this.EqRule);
      endif
   }

NOTE: Please refer to the ISA Dialog Manager documentation for details.

NOTE: When a new dialog object is dynamically created with the DLG NEW statement (where the object path and an object type must be provided), you may specify a Dialog Manager object model instead of the object type.


Eloquence Dialog Manual - 19 DEC 2002