Skip to content

Commit 8a6d4de

Browse files
committed
Call RegisterDragDrop() only when truly needed. Issue #1298
1 parent 5612380 commit 8a6d4de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/VirtualTrees.BaseTree.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8729,7 +8729,7 @@ procedure TBaseVirtualTree.CreateWnd;
87298729
PrepareBitmaps(True, True);
87308730

87318731
// Register tree as OLE drop target.
8732-
if not (csDesigning in ComponentState) and not (csLoading in ComponentState) then // will be done in Loaded after all inherited settings are loaded from the DFMs
8732+
if not (csDesigning in ComponentState) and not (csLoading in ComponentState) and ((hoDrag in Header.Options) or (toAcceptOLEDrop in TreeOptions.MiscOptions)) then // will be done in Loaded after all inherited settings are loaded from the DFMs
87338733
RegisterDragDrop(Handle, DragManager as IDropTarget);
87348734

87358735
UpdateScrollBars(True);
@@ -13489,7 +13489,7 @@ procedure TBaseVirtualTree.Loaded;
1348913489
inherited;
1349013490

1349113491
// Call RegisterDragDrop after all visual inheritance changes to MiscOptions have been applied.
13492-
if not (csDesigning in ComponentState) and HandleAllocated then
13492+
if not (csDesigning in ComponentState) and HandleAllocated and ((hoDrag in Header.Options) or (toAcceptOLEDrop in TreeOptions.MiscOptions)) then
1349313493
RegisterDragDrop(Handle, DragManager as IDropTarget);
1349413494

1349513495
// If a root node count has been set during load of the tree then update its child structure now

0 commit comments

Comments
 (0)