Important: The information in this document is obsolete and should not be used for new development.
MyModalFilter
A modal-dialog filter function whose address is passed toSFPGetFile
orSFPPutFile
should have the following form:
FUNCTION MyModalFilter (theDialog: DialogPtr; VAR theEvent: EventRecord; VAR itemHit: Integer): Boolean;
theDialog
- A pointer to the dialog record of the dialog box.
theEvent
- The event record for the event.
itemHit
- The number of the item selected.
DESCRIPTION
Your modal-dialog filter function determines how the Dialog Manager procedureModalDialog
filters events. TheModalDialog
procedure retrieves events by calling the Event Manager functionGetNextEvent
. The Standard File Package contains an internal filter function that performs some preliminary processing on each event it receives. If you provide a modal-dialog filter function,ModalDialog
calls your filter function after it calls the internal Standard File Package filter function and before it sends the event to your dialog hook function.Your modal-dialog filter function returns a Boolean value that reports whether it handled the event. If your function returns a value of
FALSE
,ModalDialog
processes the event through its own filters. If your function returns a value ofTRUE
,ModalDialog
returns with no further action.SEE ALSO
See "Writing a Modal-Dialog Filter Function" on page 3-28 for a sample modal-dialog filter function.