Important: The information in this document is obsolete and should not be used for new development.
NewPublisherDialog
When a user selects a portion of a document and then chooses the Create Publisher menu command, your application should call theNewPublisherDialogfunction 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 theNewPublisherDialogfunction.
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
containerfield of this record. You also specify information in theusePart,preview, andpreviewFormatfields. TheNewPublisherDialogfunction returns information concerning the user's choice in thecanceled,replacing, andcontainerfields 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
NewPublisherDialogfunction returns in this field a value that indicates whether the user canceled the dialog box. The function returnsTRUEin thecanceledfield if the user canceled the dialog box. The function returnsFALSEin this field if the user clicked the Publish button and returns in thecontainerfield the edition container for the new publisher.replacing- The
NewPublisherDialogfunction returnsTRUEin thereplacingfield if the user chose an existing filename from the list of available editions and confirmed this replacement. If the value of thereplacingfield isTRUE, do not call theCreateEditionContainerFilefunction. If the value of this field and thecanceledfield isFALSE, you can callCreateEditionContainerFileto create a new edition container.usePart- A value that must be set to
FALSEbefore calling theNewPublisherDialogfunction.preview- A handle to
'prvw','PICT','TEXT', or'snd 'data. TheNewPublisherDialogfunction displays this data in the preview area of the dialog box.previewFormat- A value that indicates which type of data the handle in the
previewfield 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
NewPublisherDialogfunction returns in this field the edition container that the user selected.DESCRIPTION
TheNewPublisherDialogfunction displays the new publisher dialog box on the user's screen. TheNewPublisherDialogfunction (which is based on theCustomPutFileprocedure 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. TheNewPublisherDialogfunction handles all user interaction until the user clicks the Cancel or Publish button.You should deallocate the handle referenced by the
previewfield to free up memory.RESULT CODES
noErr 0 No error editionMgrInitErr -450 Manager not initialized or could not load package badSubPartErr -454 Bad 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 ofNewPublisherDialog, see Listing 2-4 beginning on page 2-33. For a description of the edition container record, see page 2-71.