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 theNewPublisherDialog
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 theNewPublisherDialog
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 theusePart
,preview
, andpreviewFormat
fields. TheNewPublisherDialog
function returns information concerning the user's choice in thecanceled
,replacing
, andcontainer
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 returnsTRUE
in thecanceled
field if the user canceled the dialog box. The function returnsFALSE
in this field if the user clicked the Publish button and returns in thecontainer
field the edition container for the new publisher.replacing
- The
NewPublisherDialog
function returnsTRUE
in thereplacing
field if the user chose an existing filename from the list of available editions and confirmed this replacement. If the value of thereplacing
field isTRUE
, do not call theCreateEditionContainerFile
function. If the value of this field and thecanceled
field isFALSE
, you can callCreateEditionContainerFile
to create a new edition container.usePart
- A value that must be set to
FALSE
before calling theNewPublisherDialog
function.preview
- A handle to
'prvw'
,'PICT'
,'TEXT'
, or'snd '
data. TheNewPublisherDialog
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
TheNewPublisherDialog
function displays the new publisher dialog box on the user's screen. TheNewPublisherDialog
function (which is based on theCustomPutFile
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. TheNewPublisherDialog
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
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.