TNGHtmlFormat

<< Click to Display Table of Contents >>

Navigation:  Data Formats >

TNGHtmlFormat

Previous pageReturn to chapter overviewNext page

TNGHtmlFormat class implements common HTML data format and allows to drag/receive HTML data. NG Drag&Drop use string standard Delphi type for working with HTML.

 

The class declares two methods: Data and Ref. Data method can be used to drag HTML data at the source side, while Ref method can be used to receive HTML at the target side. NG Drag&Drop declares special type alias CF.HTML to make user's code more readable:

 

NGDropSource.Add(CF.HTML.Data(s))
            .Execute;
 
NGDropTarget.Register(MyTargetPanel, procedure(C: TNGTargetContext)
var
  s: string;
begin
  if C.Accept(CF.HTML.Ref(@s)) then
    ShowHtml(s);
end);

 

HTML format is bit tricky, and contain special text headers, so please look MSDN Documentation to understand it. NG Drag&Drop does not add/parse such header data internally, so it should be added manually.

Please, look at provided demo project to understand how to work with HTML data format.