Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 2 - Edition Manager / Edition Manager Reference
Edition Manager Routines / Displaying Dialog Boxes


NewSubscriberExpDialog, NewPublisherExpDialog, SectionOptionsExpDialog

The NewSubscriberExpDialog, NewPublisherExpDialog, and SectionOptionsExpDialog functions are the same as the simple dialog functions but have five additional parameters. These additional parameters allow you to add items to the bottom of the dialog boxes, apply alternate mapping of events to item hits, apply alternate meanings to the item hits, and choose the location of the dialog boxes.

FUNCTION NewSubscriberExpDialog 
               (VAR reply: NewSubscriberReply; where: Point;
                expansionDITLresID: Integer; 
                dlgHook: ExpDlgHookProcPtr; 
                filterProc: ExpModalFilterProcPtr; 
                yourDataPtr: UNIV Ptr): OSErr;
FUNCTION NewPublisherExpDialog 
               (VAR reply: NewPublisherReply; where: Point;
                expansionDITLresID: Integer; 
                dlgHook: ExpDlgHookProcPtr; 
                filterProc: ExpModalFilterProcPtr; 
                yourDataPtr: UNIV Ptr): OSErr;
FUNCTION SectionOptionsExpDialog 
               (VAR reply: SectionOptionsReply; where: Point;
                expansionDITLresID: Integer; 
                dlgHook: ExpDlgHookProcPtr; 
                filterProc: ExpModalFilterProcPtr; 
                yourDataPtr: UNIV Ptr): OSErr;
reply
A new subscriber reply, new publisher reply, or section options reply record. You specify information in the fields of this record just as you do in the the corresponding fields of records used by NewSubscriberDialog, NewPublisherDialog, and SectionOptionsDialog.
where
A point that specifies a location on the screen where the function displays the dialog box. You can automatically center the dialog box by passing (-1, -1) in the where parameter.
expansionDITLresID
A value of 0 or a valid item list ('DITL') resource ID. This integer is the ID of a dialog item list whose items are appended to the end of the standard dialog item list. The dialog items keep their relative positions, but they are moved as a group to the bottom of the dialog box.
dlgHook
A pointer to an expandable dialog hook function or NIL. An expandable dialog hook function is similar to a dialog hook function except that an expandable dialog hook function accepts an additional parameter. The NewSubscriberExpDialog, NewPublisherExpDialog, and SectionOptionsExpDialog functions call your expandable dialog hook function after each call to the ModalDialog procedure. The expandable dialog hook function should take the appropriate action, such as filling in a checkbox. The itemOffset parameter to the expandable dialog hook function is the number of items in the item list before your expansion dialog items. You need to subtract the item offset from the item hit to get the relative item number in the expansion item list. The expandable dialog hook function should return as its function result the absolute item number.
filterProc
A pointer to an expandable modal-dialog filter function or NIL. An expandable modal-dialog filter function is similar to a modal-dialog filter function or event filter function except that an expandable modal-dialog filter function accepts two extra parameters. The ModalDialog procedure calls the expandable modal-dialog filter function you provide in this parameter. An expandable modal-dialog filter function allows you to map real events (such as a mouse-down event) to an item hit (such as clicking a Cancel button). For instance, you may want to map a keyboard equivalent to an item hit.
yourDataPtr
Reserved for your use. It is passed back to your hook and event filter function. This parameter does not have to be of type Ptr--it can be any 32-bit quantity that you want. In Pascal, you can pass yourDataPtr in register A6, and declare your dialog hook and event filter as local functions without the last parameter. The stack frame is set up properly for these functions to access their parent local variables.
DESCRIPTION
The NewPublisherExpDialog, NewSubscriberExpDialog, and SectionOptionsExpDialog functions display the appropriate dialog box, handle user interaction, and call any functions you have provided in the dlgHook and filterProc parameters.

For the NewPublisherExpDialog and NewSubscriberExpDialog functions, all the pseudo-items for the Standard File Package such as hookFirstCall(-1), hookNullEvent(100), hookRebuildList(101), and hookLastCall(-2) can be used, as well as hookRedrawPreview(150).

For the SectionOptionsExpDialog function, the only valid pseudo-items are hookFirstCall(-1), hookNullEvent(100), hookLastCall(-2), emHookRedrawPreview(150), emHookCancelSection(160), emHookGoToPublisher(161), emHookGetEditionNow(162), emHookSendEditionNow(162), emHookManualUpdateMode(163), and emHookAutoUpdateMode(164).

If you provide an expandable dialog hook function, it must contain the following parameters:

FUNCTION MyExpDlgHook (itemOffset: Integer; itemHit: Integer;
                        theDialog: DialogPtr; 
                        yourDataPtr: Ptr): Integer;
If you provide an expandable modal-dialog filter function, it must contain the following parameters.

FUNCTION MyExpModalFilter (theDialog: DialogPtr; 
                           VAR theEvent: EventRecord; 
                           itemOffset: Integer; 
                           VAR itemHit: Integer; 
                           yourDataPtr: Ptr): Boolean;
SEE ALSO
See the chapter "Dialog Manager" in Inside Macintosh: Macintosh Toolbox Essentials for additional information on item lists. See the chapter "Standard File Package" in Inside Macintosh: Files for information on dialog hook and modal-dialog filter functions.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996