Action area

The action area of a dialog box contains buttons, such as OK and Cancel. These buttons allow the user to commit values from the dialog box, to close the dialog box, or to perform some other action.

AFXDialog supports the automatic creation of an action area and its buttons through the use of bit flags in the dialog box constructor. You can use the flags described in Table 1 to include standard action area buttons.

Table 1. Action area flags.
Button flag Message ID Label Semantics
AFXDialog.OK AFXDialog.ID_CLICKED_OK OK Commit the values in the dialog box, process them, and then hide the dialog box.
AFXDialog.CONTINUE AFXDialog.ID_CLICKED_CONTINUE Continue… Commit the values in the dialog box, hide it, and continue collecting input from the user in another dialog box or prompt.
AFXDialog.APPLY AFXDialog.ID_CLICKED_APPLY Apply Same as OK, except the dialog box is not hidden.
AFXDialog.DEFAULTS AFXDialog.ID_CLICKED_DEFAULTS Defaults Reset the values in the dialog box to their defaults.
AFXDialog.YES AFXDialog.ID_CLICKED_YES Yes Invoke the affirmative action in response to the question posed by the dialog box.
AFXDialog.NO AFXDialog.ID_CLICKED_NO No Invoke the negative action in response to the question posed by the dialog box.
AFXDialog.CANCEL AFXDialog.ID_CLICKED_CANCEL Cancel Do not commit the values in the dialog box; just hide the dialog box. Optionally, for the AFXDataDialog a bailout may be posted if the user has changed any values since the last commit.
AFXDialog.DISMISS AFXDialog.ID_CLICKED_DISMISS Dismiss Hide the dialog box without taking any other action.

AFXDialog also supports the following options that determine the location of the action area:

DIALOG_ACTIONS_BOTTOM

This option places the action area at the bottom of the dialog box and is the default option.

DIALOG_ACTIONS_RIGHT

This option places the action area on the right side of the dialog box.

DIALOG_ACTIONS_NONE

This option does not create an action area; for example, in a toolbox dialog box.

You can also specify whether a separator should be placed between the action area and the rest of the dialog box by including the following flag in the options:

DIALOG_ACTIONS_SEPARATOR

The style in Abaqus/CAE is to omit a separator if there is already delineation between the action area and the rest of the dialog box; for example, a frame that stretches across the entire width of the dialog box along the bottom of the dialog box. The following statements illustrate how you define an action area in a dialog box with a separator:

class ActionAreaDB(AFXDialog):

    def __init__(self):

        AFXDialog.__init__(self, 'Action Area Example1',
            self.OK|self.APPLY|self.CANCEL,
            DIALOG_ACTIONS_SEPARATOR)

        FXLabel(self, 'Standard action area example dialog.')
Figure 1. An example of a standard action area.