CustomGetFile
CustomGetFile Use for more control over the Open dialog box
#include <StandardFile.h> Standard File Package
void CustomGetFile(fileFilter, numTypes, typeList, reply, dlgID,
where, dlgHook, filterProc , activeList,
activateProc, yourDataPtr );
FileFilterYDProcPtr fileFilter ; an optional file filter function
short numTypes ; number of file types to be displayed.
SFTypeList typeList ; list of types to be displayed
StandardFileReply *reply ; the reply record
short dlgID ; resource ID of a customized dialog
template
Point where ; coordinates for top left of dialog window
DlgHookYDProcPtr dlgHook ; NIL= standard; else=addr of custom
routine
ModalFilterYDProcPtr filterProc; filters filenames; NIL= standard filtering
short *activeList ; 0 or -1=all types; else=number of
elements in typeList
ActivateYDProcPtr activateProc ; all items in the dialog box that can be
activated
void *yourDataPtr:; optional data supplied by your
application.
Call the CustomGetFile procedure when your application requires more control
over the Open dialog box.
fileFilter points to an optional file filter function.
If you provide a filter function, CustomGetFile passes it both the
pointer to the catalog entry for each file to be processed and also a
pointer to the optional data passed by your application in its call to
CustomGetFile.
pascal Boolean MyCustomFileFilter (ParmBlkPtr pb, void
myDataPtr);
numTypes specifies the number of file types to be displayed. You can specify
one or more types. If you specify a value of -1 in the numTypes
parameter, CustomGetFile displays or passes to your file filter
function all files and folders at the current level of the display
hierarchy, not just the files.
typeList is the list of types to be displayed
reply points to the reply record, which CustomGetFile fills in before
returning.
dlgID is the resource ID of a customized dialog template. To use the
standard template, set this parameter to 0.
where specifies the upper-left corner of the dialog box in global
coordinates. If you specify the point (-1,-1), CustomGetFile
automatically centers the dialog box on the screen.
dlgHook points to your dialog hook function, which handles item hits received
from the Dialog Manager. Specify a value of NIL if you have not
added any items to the dialog box and want the standard items handled
in the standard ways. See Callback Routines under the section
en titled Customizing Your Interface for a description of the
dialog hook function, which uses this syntax:
pascal short MyDlgHook( short item, DialogPtr theDialog, void
*myDataPtr);
filterProc points to your modal-dialog filter function, which determines how
ModalDialog filters events when called by CustomGetFile.
Specify a value of NIL if you are not supplying your own function. See
Callback Routines under Customizing Your Interface for a
description of the modal-dialog filter function, which uses this
syntax:
pascal Boolean MyModalFilter(DialogPtr theDialog, EventRecord
* theEvent, short * itemHit, void *myDataPtr);
activeList points to a list of all items in the dialog box that can be
activated-that is, made the target of keyboard input. The list is stored
as an array of 16-bit integers. The first integer is the number of
items in the list. The remaining integers are the item numbers of all
possible keyboard targets, in the order that they are activated by the
Tab key. If you supply an activeList parameter of NIL,
CustomGetFile directs all keyboard input to the displayed list.
activateProc points to your activation procedure, which controls the
high-lighting of dialog items that are defined by your application and
that can receive keyboard input. See Callback Routines under the
section en titled Customizing Your Interface for a description of
the activation procedure, which uses this syntax:
pascal void MyActivateProc(DialogPtr theDialog, short itemNo,
Boolean activating, void *myDataPtr);
yourDataPtr points to optional data supplied by your application. When
CustomGetFile calls any of your callback routines, it pushes this
parameter on the stack, making the data available to your callback
routines. If you are not supplying any data of your own, you can
specify a value of NIL.
Returns: none

Notes: CustomGetFile is an alternative to StandardGetFile when you want to
display a customized Open dialog box or handle the default dialog box in a
customized way.