TNGUrlFormat

<< Click to Display Table of Contents >>

Navigation:  Data Formats >

TNGUrlFormat

Previous pageReturn to chapter overviewNext page

TNGUrlFormat class implements common URL data format and allows to drag/receive ANSI URLs. NG Drag&Drop use AnsiString standard Delphi type for working with ANSI URLs.

 

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

 

NGDropSource.Add(CF.URL.Data('http://google.com'))
            .Execute;
 
NGDropTarget.Register(MyTargetPanel, procedure(C: TNGTargetContext)
var
  s: AnsiString;
begin
  if C.Accept(CF.URL.Ref(@s)) then
    Edit1.Text := string(s);
end);