<< Click to display table of contents >> TCustomRichViewEdit.AcceptDragDropFormats, AcceptPasteFormats |
AcceptDragDropFormats lists formats that can be accepted when dropping data in TRichViewEdit.
AcceptPasteFormats lists formats that can be accepted when pasting in TRichViewEdit.
property AcceptDragDropFormats: TRVDragDropFormats;
property AcceptPasteFormats: TRVDragDropFormats;
type
TRVDragDropFormat = (
rvddRVF, rvddRTF, rvddText, rvddUnicodeText,
rvddBitmap, rvddMetafile, rvddURL, rvddFiles, rvddHTML);
TRVDragDropFormats = set of TRVDragDropFormat;
(introduced in v1.8 & v14)
Value |
D&D Format |
Meaning |
---|---|---|
rvddRVF |
'RichView Format' |
|
rvddRTF |
'Rich Text Format' |
RTF |
rvddText |
CF_TEXT |
Plain ANSI text |
rvddUnicodeText |
CF_UNICODETEXT |
Plain Unicode text |
rvddBitmap |
CF_DIB or CF_BITMAP |
Bitmap |
rvddMetafile |
CF_ENHMETAFILE |
Metafile |
rvddURL |
'UniformResourceLocator' or 'UniformResourceLocatorW' |
URL. If available, URL caption is read from CFSTR_FILEDESCRIPTOR format (otherwise caption = target). OnReadHyperlink event occurs with DocFormat=rvlfURL. If this event is not processed, URL is inserted as a plain text. |
rvddFiles |
CF_HDROP |
By default, RichViewEdit inserts: ▪graphic files, ▪*.RTF (only drag&drop), ▪*.RVF (only drag&drop), ▪*.TXT (only drag&drop). You can modify the default processing in OnDropFiles event (only drag&drop). |
rvddHTML |
'HTML Format' |
HTML |
Example (processing OnReadHyperlink with rvddURL support)
// OnReadHyperlink
procedure TMyForm.MyRichViewEditReadHyperlink(Sender: TCustomRichView;
const Target, Extras: TRVUnicodeString; DocFormat: TRVLoadFormat;
var StyleNo: Integer; var ItemTag: TRVTag;
var ItemName: TRVUnicodeString);
begin
if DocFormat=rvlfURL then
StyleNo := GetHyperlinkStyleNo(Sender);
ItemTag := Target;
end;
// This function returns the index of a text style having all properties
// like the current style, but hypertext, blue, underlined.
// If this style does not exist, it is added.
function TMyForm.GetHyperlinkStyleNo(rve: TCustomRichViewEdit): Integer;
var TextStyle: TFontInfo;
begin
Result := rve.CurTextStyleNo;
TextStyle := TFontInfo.Create(nil);
try
TextStyle.Assign(rve.Style.TextStyles[Result]);
TextStyle.Jump := True;
TextStyle.Color := clBlue;
TextStyle.Style := TextStyle.Style+[fsUnderline];
Result := rve.Style.FindTextStyle(TextStyle);
finally
TextStyle.Free;
end;
end;
Default value:
▪AcceptDragDropFormats: [rvddRVF, rvddRTF, rvddText, rvddUnicodeText, rvddBitmap, rvddMetafile, rvddFiles]
▪AcceptPasteFormats: [rvddRVF, rvddRTF, rvddText, rvddUnicodeText, rvddBitmap, rvddMetafile, rvddFiles, rvddHTML]
See also:
▪Paste;
▪CanPaste;