forked from ibv/LDAP-Admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDragDrop.info
55 lines (39 loc) · 1.4 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
46
47
48
49
50
51
52
53
54
To use Drag&Drop you need to change files: "/usr/lib64/lazarus/lcl/include/treeview.inc"
http://forum.lazarus.freepascal.org/index.php?topic=30263.0
File "/usr/lib64/lazarus/lcl/include/treeview.inc"
1.
procedure TTreeNode.SetDropTarget(AValue: Boolean);
begin
// if AValue=GetDropTarget then exit; // <------- added this
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;
2.
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;