Creating Dialog Boxes

You might want to create and display a custom dialog box to your user, offering a highly-interactive method of collecting data. You can query the user for information and perform custom computations based on that input in the application tool.

WARNING: A dialog box resource loads code that interacts directly with the application. This means that such code, if poorly written, might cause the application to crash.

Adding a custom dialog box with the desired functionality involves these steps:

  1. Create the dialog box in the Dialog Box Editor and save it to create the Dialog Box Resource file. See Chapter 3 “Dialog Box Resource File Editor” on page 65 for instructions on using this editor.

    A single Dialog Box Resource file can contain the specifications for more than one dialog box.

  2. Create the event handler functions. See Creating the Event Handler Functions.

  3. Compile and build a code library. See “Building a Code Library“ on page 13.

  4. Edit the editor configuration file to reference the Dialog Box Resource file.

  5. Edit the Operation List File to reference the dialog boxes in the Dialog Box Resource file.

  6. Edit the editor configuration file to reference the code libraries that implement the desired functionality.

Note: You cannot share global variables between shared libraries. Therefore, you cannot use global variables to implement communication between dialog boxes that have different event-handler libraries; use the EtsC_Command_Ping and EtsC_Command_State commands instead.

When the user invokes an operation (such as pulling down a custom menu or clicking on a button) the following events occur:

  1. The shared object library is loaded.
  2. An EtsC_Message_Open message is sent to your event handler function.
  3. The dialog box is displayed, based on the control specifications in the Dialog Box Resource file.
  4. The dialog box is changed per the event handler instructions.
  5. Your user presses controls in the dialog box.
  6. The application calls the event handlers in the shared object library, passing them information about the types of actions the user has taken.
  7. Each event handler function looks for instructions on what to do with the specific type of message sent, then sends an instruction to the application using the ETS GUI functions.