HomeActive Query BuilderTreeOptionsMetaData as drag source

TreeOptionsMetaData as drag source


Hello,

is it possible to use the tables and views as drag source for my own memo field? I want to allow to fill in the table/view name via drag&drop from the integrated Metadata tree to my memo field. Do you have a sample for that?
Uwe Stachel | email
February 24 2010, 10:28 AM
Use the following event handlers to drag objects from the metadata tree to a TMemo object.

procedure TForm2.Memo1DragDrop(Sender, Source: TObject; X, Y: Integer);
var n:TacTreeNode;
mo:TacMetadataObject;
begin
Assert(Source=qb.MetadataTree);
Assert(qb.MetadataTree.Selected<>nil);

n:=qb.MetadataTree.Selected;
mo:=TacMetadataObject(n.Data);
Memo1.Lines.Add(mo.FullNameStr);
end;

procedure TForm2.Memo1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
Accept:=false;
if (Source=qb.MetadataTree)and(qb.MetadataTree.Selected<>nil)
then Accept:=true;
end;
Sergey Smagin | email
18 hours, 57 mins since original post
This topic is closed