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:
-
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.
-
Create the event handler functions. See Creating the Event Handler Functions.
-
Compile and build a code library. See “Building a Code Library“ on page 13.
-
Edit the editor configuration file to reference the Dialog Box Resource file.
-
Edit the Operation List File to reference the dialog boxes in the Dialog Box Resource file.
-
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:
- The shared object library is loaded.
- An
EtsC_Message_Openmessage is sent to your event handler function. - The dialog box is displayed, based on the control specifications in the Dialog Box Resource file.
- The dialog box is changed per the event handler instructions.
- Your user presses controls in the dialog box.
- The application calls the event handlers in the shared object library, passing them information about the types of actions the user has taken.
- 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.