ShowPasteAsDialog
TheShowPasteAsDialogmethod displays the Paste As dialog box and sets the appropriate dialog items according to the input parameters.
ODBoolean ShowPasteAsDialog ( in ODBoolean canPasteLink, in ODPasteAsMergeSetting mergeSetting, in ODFacet facet, in ODTypeToken viewType, out ODPasteAsResult theResult);
canPasteLink- kODTrue if the destination part allows a link to be created, otherwise
kODFalse.mergeSetting- A value indicating whether embedding and merging are supported; determines the initial setting for the At the Destination radio buttons.
facet- A reference to the facet from which the Paste As dialog box is triggered.
viewType- A tokenized string representing the initial setting for the view type of the embedded part (if embedding is chosen).
theResult- A structure reflecting the user's selections in the Paste As dialog box.
- return value
kODTrueif the user clicked OK to leave the Paste As dialog box, otherwisekODFalse.DISCUSSION
You should call this method in your part'sHandleEventmethod to display the Paste As dialog box when the user selects Paste As from the Edit menu.If the
canPasteLinkparameter is true, and if the content storage unit contains a link specification and the draft permissions allow writing, then the Paste with Link checkbox is checked.The mergeSetting parameter specifies which At the Destination radio button (Merge with Contents or Embed As) is initially selected in the Paste As dialog box and whether the other button is available. It must be one of the following:
The
- Embed As is initially selected; Merge with Contents is available (
kODPasteAsEmbed).- Embed As is selected; Merge with Contents is disabled (
kODPasteAsEmbedOnly).- Merge with Contents is initially selected; Embed As is available (
kODPasteAsMerge).- Merge with Contents is selected; Embed As is disabled (
kODPasteAsMergeOnly).
viewTypeparameter must be the tokenized form of one of the view-type constants (kODViewAsFrame,kODViewAsLargeIcon,kODViewAsSmallIcon, orkODViewAsThumbnail). You can call the session object'sTokenizemethod to obtain a token corresponding to one of these constants.If the user clicks OK, this method returns true and sets the fields of the output parameter,
theResult, to indicate the selections the user made in the Paste As dialog box. You must dispose of the non-nullselectedKind,translateKind, andeditorfields of thetheResultstructure when you are finished using them.If the user cancels the dialog box, this method returns false and you do not need to take any further action.
EXCEPTIONS
kODErrNullFacetInput- The
facetparameter is null.kODErrNullPasteAsResultInput- The
theResultparameter is null.kODErrOutOfMemory- There is not enough memory to complete the operation.
SEE ALSO
TheODPasteAsResulttype (page 918).
TheODTypeTokentype (page 877).
TheODSession::Tokenizemethod (page 622).
"Paste As" on page 250 in OpenDoc Programmer's Guide.
"Handling the Paste As Dialog Box" on page 337 in OpenDoc Programmer's Guide.