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


NewPublisherDialog

When a user selects a portion of a document and then chooses the Create Publisher menu command, your application should call the NewPublisherDialog function to allow the user to choose a name and location of the edition to which your application writes the publisher data. Your application specifies a location and name to use as the default edition and provides a preview of the publisher data to the NewPublisherDialog function.

FUNCTION NewPublisherDialog 
                  (VAR reply: NewPublisherReply): OSErr;
reply
A new publisher reply record. You specify a location to use as the default edition container in the container field of this record. You also specify information in the usePart, preview, and previewFormat fields. The NewPublisherDialog function returns information concerning the user's choice in the canceled, replacing, and container fields of this record.
TYPE NewPublisherReply = 
   RECORD
      canceled:      Boolean;       {user canceled dialog box}
      replacing:     Boolean;       {user chose existing } 
                                    { filename for an edition}
      usePart:       Boolean;       {always false in version 7.0}
      preview:       Handle;        {handle to 'prvw', 'PICT', }
                                    { 'TEXT', or 'snd ' data} 
      previewFormat: FormatType;    {type of preview}
      container:     EditionContainerSpec;
                                    {edition chosen}
   END;
Field Description
canceled
The NewPublisherDialog function returns in this field a value that indicates whether the user canceled the dialog box. The function returns TRUE in the canceled field if the user canceled the dialog box. The function returns FALSE in this field if the user clicked the Publish button and returns in the container field the edition container for the new publisher.
replacing
The NewPublisherDialog function returns TRUE in the replacing field if the user chose an existing filename from the list of available editions and confirmed this replacement. If the value of the replacing field is TRUE, do not call the CreateEditionContainerFile function. If the value of this field and the canceled field is FALSE, you can call CreateEditionContainerFile to create a new edition container.
usePart
A value that must be set to FALSE before calling the NewPublisherDialog function.
preview
A handle to 'prvw', 'PICT', 'TEXT', or 'snd ' data. The NewPublisherDialog function displays this data in the preview area of the dialog box.
previewFormat
A value that indicates which type of data the handle in the preview field references.
container
An edition container record that specifies the volume reference number, directory ID, and filename to use as the default edition to publish the data to. The NewPublisherDialog function returns in this field the edition container that the user selected.
DESCRIPTION
The NewPublisherDialog function displays the new publisher dialog box on the user's screen. The NewPublisherDialog function (which is based on the CustomPutFile procedure described in the chapter "Standard File Package" in Inside Macintosh: Files) switches to the volume reference number and directory ID specified by the edition container, sets the editable text item to the filename specified by the edition container, and displays a preview of the publisher data in the new publisher dialog box. The NewPublisherDialog function handles all user interaction until the user clicks the Cancel or Publish button.

You should deallocate the handle referenced by the preview field to free up memory.

RESULT CODES
noErr0No error
editionMgrInitErr-450Manager not initialized or could not load package
badSubPartErr-454Bad edition container spec
SEE ALSO
For an illustration of the new publisher dialog box, see Figure 2-11 on page 2-29. For an example of the use of NewPublisherDialog, see Listing 2-4 beginning on page 2-33. For a description of the edition container record, see page 2-71.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996