CutSelection
Forms, interaction, Unicode
Description
Copies the normalised selection to CutText and removes it through the session's atomic text-replacement path
The method has no operating-system clipboard dependency, allowing VCL, FMX, service and cross-platform hosts to choose their own clipboard adapter
If /K or OnTextEdit vetoes the edit, CutText is empty and the selection remains unchanged
Declaration
function CutSelection(out CutText: WideString): Integer;
Parameters
| CutText | Receives the removed UTF-16 text only after the edit is accepted |
|---|
Return value
Returns 1 when the cut transaction is accepted, including an empty selection, otherwise 0
Example
if Session.CutSelection(ClipboardText) = 1 then
HostClipboard.SetText(ClipboardText);
See also
ReplaceSelection, PasteText, GetSelectionRange, TPDFlibFormSession