Communicator UI: 3 Convenient Dialog Routines

Up: GEOS SDK TechDocs | Up | Prev: 2 ComplexMonikerClass | Next: 4 FlashingNoteClass

The Foam library provides a number of routines useful for displaying simple dialog boxes to the user. Each of these displays a dialog box. The dialog box will have one or more buttons. Most of the functions have a return value; the function's return value will be an InteractionCommand value corresponding to which button the user pressed to dismiss the dialog. The FoamDisplay...NoBlock() routines don't have an explicit return value; they send a message if the user presses the OK button.

The following routines are available:

FoamDisplayWarning() , FoamDisplayWarningNoBlock()
These routines present a dialog box notifying the user about an action. The user may dismiss the dialog, but may not cancel the action. The function takes one argument, the optr of a string buffer to display. This function has no return value.
FoamDisplayError() , FoamDisplayErrorNoBlock()
These routines present a dialog box notifying the user that an error has occurred. The user may dismiss the dialog via the OK button. The function takes one argument: the optr of the string buffer containing the text to display. The function has no return value.
FoamDisplayOkCancelWarning()
This function presents the user with a warning in an OK/Cancel dialog. The function takes one argument: the optr of the string buffer to display. This function returns an InteractionCommand value; if the user presses the OK button, the function returns IC_APPLY.
FoamDisplayQuestion()
This routine presents a Yes/No dialog. It takes one argument, the optr of the text buffer containing the string to display. If the user presses the Yes button, the function will return IC_YES.
FoamDisplayNote() , FoamDisplayNoteNoBlock()
These functions display an OK dialog box displaying a text message to the user. The function takes one argument, the optr to a string buffer with the text to display.
FoamDisplayDeleteWarning()
This routine presents an OK/Cancel dialog box asking for a file deletion confirmation. This function takes three arguments: a pointer to a string buffer containing the file name, and optrs to two string chunks: one to display before the file name, and one to display after. If the function returns IC_YES, the user has confirmed that the file should be deleted.
FoamDisplayDeleteWarningNoBlock()
This routine presents an OK/Cancel dialog box asking for a file deletion confirmation. This function takes three arguments: the optr of the text string asking the user for confirmation, the message to send if the Delete button is pressed, and the object to send that message to. This function has no explicit return value. If the user Cancels the dialog, it won't send any message.

For dialog box types not provided by these functions, you will have to set up your UI, using GenInteraction objects in the usual way--or you may use the FlashingNoteClass or FoamProcessDialogClass , described later in this chapter.


Up: GEOS SDK TechDocs | Up | Prev: 2 ComplexMonikerClass | Next: 4 FlashingNoteClass