Important: The information in this document is obsolete and should not be used for new development.
Handling Events in Dialog Boxes
Handling events in an alert box is very simple: after you invoke an alert box, the Dialog Manager handles most events for you by automatically calling theModalDialog procedure
. To handle events in a modal dialog box, your application must explicitly call theModalDialog
procedure after displaying the dialog box. In either case, when an enabled item is clicked, the Dialog Manager returns the item number. You'll then do whatever is appropriate in response to that click. For both alert and modal dialog boxes, you should also provide a simple event filter function that allows other windows to respond to update events and that allows your alert or dialog box to respond to a few key-down events for keys such as Return, Enter, and Esc.You can use your normal event-handling code to determine whether an event occurs in a modeless or movable modal dialog box, or you can use the
IsDialogEvent
function to learn whether they need to be handled as part of a dialog box. Once you determine that an event occurs in a modeless or movable modal dialog box, you can use theDialogSelect
function to handle key-down events in editable text items automatically, to handle update and activate events automatically, and to report the enabled items clicked by the user. You then respond as appropriate to clicks in your active items. Or you can use Control Manager, TextEdit, and Window Manager routines (such asFindWindow
,BeginUpdate
,EndUpdate
,FindControl
,TrackControl
, andTEClick
) to handle these events without the aid of the Dialog Manager.
Subtopics
- ModalDialog
- IsDialogEvent
- DialogSelect
- DrawDialog
- UpdateDialog