|
TCustomRichViewEdit.AcceptDragDropFormats |
Top Previous Next |
|
Lists formats that can be accepted when dropping data in TRichViewEdit. property AcceptDragDropFormats: TRVDragDropFormats
type TRVDragDropFormat = ( rvddRVF, rvddRTF, rvddText, rvddUnicodeText, rvddBitmap, rvddMetafile, rvddURL, rvddFiles); TRVDragDropFormats = set of TRVDragDropFormat; (introduced in v1.8)
Example (processing OnReadHyperlink with rvddURL support) // OnReadHyperlink. This code assumes rvoTagsArePChars is in // MyRichViewEdit.Options procedure TMyForm.MyRichViewEditReadHyperlink(Sender: TCustomRichView; const Target, Extras: String; DocFormat: TRVLoadFormat; var StyleNo, ItemTag: Integer; var ItemName: String); begin if DocFormat=rvlfURL then StyleNo := GetHyperlinkStyleNo(Sender); ItemTag := Integer(StrNew(PChar(Target))); end;
// This function returns index of 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.TextStyles.FindSuchStyle( Result, TextStyle, RVAllFontInfoProperties); if Result<0 then begin rve.Style.TextStyles.Add; Result := rve.Style.TextStyles.Count-1; rve.Style.TextStyles[Result].Assign(TextStyle); rve.Style.TextStyles[Result].Standard := False; end; finally TextStyle.Free; end; end; Default value: [rvddRVF, rvddRTF, rvddText, rvddUnicodeText, rvddBitmap, rvddMetafile, rvddFiles] (all except for rvddURL) See also: |