Carbon


PMPageSetupDialogInitProcPtr

Header: PMApplication.h Carbon status: Not Recommended

Defines a pointer to a dialog initialization function the Carbon Printing Manager calls before displaying your custom Page Setup dialog box. Your initialization function can append items to the Page Setup dialog box.

typedef void(* PMPageSetupDialogInitProcPtr) (
    PMPageFormat pageFormat, 
    PMDialog *theDialog
);

You would declare your function like this if you were to name it MyPMPageSetupDialogInitCallback:

void MyPMPageSetupDialogInitCallback (
    PMPageFormat pageFormat, 
    PMDialog *theDialog
);
Parameter descriptions
pageFormat

A PMPageFormat object.

theDialog

A pointer to the PMDialog object representing your custom Page Setup dialog box. You obtain this object from the PMSessionPageSetupDialogInit function. Because the PMSessionPageSetupDialogMain function does not pass this object to the Carbon Printing Manager, your application should store a pointer to the dialog object in a global variable or as extended data in the PMPageFormat object, where it is accessible by your initialization function.

DISCUSSION

You pass a pointer to your dialog initialization function as a parameter to the PMSessionPageSetupDialogMain function. The Carbon Printing Manager then calls your dialog initialization function before displaying your custom Page Setup dialog box. Your initialization function can append items to the Page Setup dialog box, and should install an event filter using the PMSetModalFilterProc function.

To provide a pointer to your dialog initialization function, you create a universal procedure pointer (UPP) of type PMPageSetupDialogInitUPP, using the function NewPMPageSetupDialogInitUPP . You can do so with code like the following:

PMPageSetupDialogInitUPP MyPageSetupDialogInitCallbackUPP;

MyPageSetupDialogInitCallbackUPP = NewPMPageSetupDialogInitUPP ( &MyPageSetupDialogInitCallback );

If you wish to call your dialog initialization function directly, you can use the InvokePMPageSetupDialogInitUPP function.

After you are finished with your dialog initialization function, you can dispose of the UPP with the DisposePMPageSetupDialogInitUPP function. However, if you will use the same dialog initialization function for subsequent print jobs, you can reuse the same UPP, rather than dispose of it and later create a new UPP.

SPECIAL CONSIDERATIONS

Valid within the context of a printing session after calling PMSessionPageSetupDialogInit.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)