|
RichView Clipboard Functions Overview |
Top Previous Next |
|
TCustomRichView and its descendants can copy information to the Clipboard as plain (ANSI and Unicode) text, image, RTF and RVF, and your own custom formats. RichViewEdit can paste information from the Clipboard as text (ANSI and Unicode), image, RTF, and RVF (and your own formats). CopyingThe main method for copying to the Clipboard is CopyDef. It can copy selection in one or more formats. This method copies data in formats specified in RichView.Options:
CopyDef is called automatically when the user presses Ctrl + Insert or Ctrl + C . You can also use methods for copying: ▪Copy – copies selection to the Clipboard in all formats; ▪CopyTextA – copies the selection as ANSI text; ▪CopyTextW – copies selection as Unicode text ▪CopyImage – if there is a selected image, this method copies it to the Clipboard; ▪CopyRVF – copies selection in RVF format. This format has name 'RichView Format' and consist of two parts: <Size of RVF><RVF> where <Size of RVF> is 4-byte integer value (number of bytes in <RVF>), <RVF> is RVF data (see: About RVF, RVF Specification) ▪CopyRTF – copies selection as RTF (Rich Text Format). SelectionExists method answers to the question "does the selection contain some data (not empty)?" OnCopy event allows copying in your own formats. PastingTRichView cannot paste. All these methods are methods of TRichViewEdit. Pasting: ▪PasteBitmap – pastes bitmap from the Clipboard, if available; ▪PasteMetafile – pastes metafile from the Clipboard, if available; ▪PasteGraphicFile – pastes graphic file(s) the Clipboard, if available; ▪PasteText – pastes text from the Clipboard, if available; ▪PasteRVF – pastes RVF from the Clipboard, if available; ▪PasteRTF – pastes RTF from the Clipboard, if available; ▪Paste – tries to paste as RVF; if can't – as RTF, if can't – as text; if can't – as graphic file(s), if can't – as bitmap; if can't – as metafile.This method is called automatically when user press Ctrl + V or Shift + Insert . Testing is the Clipboard has the specific format: ▪CanPaste – "does the Clipboard contain any format what can be pasted in RichViewEdit?" ▪CanPasteRVF – "does the Clipboard contain RVF?" ▪CanPasteRTF – "does the Clipboard contain RTF?" OnPaste event allows to override the default pasting procedure. For example, you can paste data in different format, or you can allow pasting only some specific formats (for example, only a plain text). CuttingRichViewEdit.CutDef copies the selection (like CopyDef) and then deletes it (like DeleteSelection). This method is called automatically when user presses Ctrl + X or Shift + Delete . Windows messagesRichView processes WM_COPY message, RichViewEdit also processes WM_PASTE and WM_CUT. See also... |