Menus and Dialog Boxes: 5.1 Interaction Commands: InteractionCommand Types

Up: GEOS SDK TechDocs | Up | Prev: 5 Interaction Commands | Next: 5.2 Dialog Control

Many of these InteractionCommand s are sent out by standard response triggers provided with the Specific UI. Different types of Interactions may provide different standard response triggers with InteractionCommand s. For example, the "OK" trigger for a GIT_NOTIFICATION dialog box in OSF/Motif sends out the InteractionCommand IC_OK.

The InteractionCommand represents the actions that can be performed on an Interaction. The predefined commands are as follows:

IC_DISMISS, IC_APPLY, IC_RESET, IC_OK, IC_YES, IC_NO, and IC_STOP correspond to standard response triggers provided with the Specific UI for dialogs of various GenInteractionType . (See GenInteraction Types .)

You may replace any of these standard response triggers by adding your own triggers with an InteractionCommand . You should do this by setting the trigger's ATTR_GEN_TRIGGER_INTERACTION_COMMAND vardata to the proper InteractionCommand to replace. (See Replacing Default Triggers .)

Adding Custom Response Triggers

In some cases, you may want to add your own response triggers. In many of these cases, a trigger tied to one of the predefined InteractionCommand s will be sufficient for your needs. If a dialog box does not contain one of the pre-defined response triggers by default, you can add any of these yourself.

You are not limited to one of these predefined types, however. UserDoDialog() and GIT_MULTIPLE_RESPONSE UserStandardDialog () allow you to define your own InteractionCommand types. Applications can define their own InteractionCommand by starting an enumeration at the special value IC_CUSTOM_START. This is to avoid conflicting with other predefined values, which still have their usual meaning to the dialog.

Code Display 7-23 Using IC_CUSTOM_START

/* You may define values directly. */
#define IC_SAVE_FILE IC_CUSTOM_START+1;
#define IC_KILL_FILE IC_CUSTOM_START+2;
/* You may also use typedef to enumerate those values. */
typedef enum {
    IC_SAVE_FILE = IC_CUSTOM_START+1,
    IC_KILL_FILE = IC_CUSTOM_START+2
} MyInteractionCommand;
/* Any triggers set up with these InteractionCommands would appear like so: */
@object GenTriggerClass MyTrigger = {
    GI_visMoniker = "Save File";
    ATTR_GEN_TRIGGER_INTERACTION_COMMAND = { IC_SAVE_FILE };
    HINT_SEEK_REPLY_BAR;
}
/* An Interaction invoked with UserDoDialog() (with MyTrigger as one of its
 * children) will return IC_SAVE_FILE when that trigger is activated. Your
 * application can then perform any required actions. */

Up: GEOS SDK TechDocs | Up | Prev: 5 Interaction Commands | Next: 5.2 Dialog Control