forked from ibv/LDAP-Admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDragDrop.info
46 lines (36 loc) · 1.25 KB
/
DragDrop.info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
http://forum.lazarus.freepascal.org/index.php?topic=30263.0
File "/usr/lib64/lazarus/lcl/include/treeview.inc"
procedure TTreeNode.SetDropTarget(AValue: Boolean);
begin
// if AValue=GetDropTarget then exit;
if AValue then begin
Include(FStates,nsDropHilited);
if TreeView<>nil then
TreeView.FLastDropTarget:=Self;
end else begin
Exclude(FStates,nsDropHilited);
if TreeView<>nil then
TreeView.FLastDropTarget:=nil;
end;
{if Value then TreeView_SelectDropTarget(Handle, ItemId)
else if DropTarget then TreeView_SelectDropTarget(Handle, nil);}
end;
procedure TCustomTreeView.DragOver(Source: TObject; X,Y: Integer;
State: TDragState; var Accept: Boolean);
var
Node: TTreeNode;
begin
inherited DragOver(Source,X,Y,State,Accept);
Node := GetNodeAt(X, Y);
{$IFDEF VerboseDrag}
DebugLn(['TCustomTreeView.DragOver ',Name,':',ClassName,' ',Node<>nil,' ',Node <> DropTarget,' ',Node = FLastDropTarget]);
DebugLn(['TCustomTreeView.DragOver Source ',Source,':',Source.ClassName]);
{$ENDIF}
if (Node <> nil)
and ((Node <> DropTarget) or (Node = FLastDropTarget)) then
begin
FLastDropTarget := nil;
Node.DropTarget := True;
end
else if Node = nil then FLastDropTarget := nil; //added this
end;