Closed radioboss closed 2 months ago
Please respect our guidelines on the project homepage for submitting bugs. Please include your version of Virtual TreeView and Delphi, and attach a sample compiling project as ZIP to your report that allows to replicate the problem. If only small changes are required, a description is sufficient how a demo projects needs to be changed in order to replicate the bug. If you already have a solution, please supply a patch file.
Advanced
sample project.GeneralAbilitesDemo.VST2
set AutoScrollDelay
to 10000.The tree starts scrolling down after 10 seconds
The tree starts scrolling down after less than a second.
The auto scroll delay is indeed not respected, however it seems that the scrolling is triggered from outside our control. Here is the call stack:
VirtualTrees.BaseTree.TBaseVirtualTree.DoSetOffsetXY((9427896, 15319823),[suoRepaintHeader,suoRepaintScrollBars,suoScrollClientArea,suoUpdateNCArea],nil)
VirtualTrees.BaseTree.TBaseVirtualTree.SetOffsetY(-1273)
VirtualTrees.BaseTree.TBaseVirtualTree.WMVScroll((277, (), 1, 1, (), 0, 0))
TControl.WndProc + $2C1
TWinControl.WndProc + $6AC
VirtualTrees.BaseTree.TBaseVirtualTree.WndProc((277, 65537, 0, 0, 1, 1, (), 0, 0, (), 0, 0, ()))
TWinControl.MainWndProc + $2F
StdWndProc + $16
Maybe this is a feature of newer Windows versions?
I'm sorry I didn't follow the guidelines, I didn't know those existed :)
As for scrolling, if in the same Advanced
sample project you disable the toAutoScroll
in TreeOptions/AutoOptions for this VST2, no scrolling occurs, which looks like the VST has control whether to start scrolling or not.
I don't think it's Windows feature; this also occurs for regular VCL dragging inside the same program, e.g. add TListBox with a single item, set DragMode
to dmAutomatic
and drag this item over VST2 - scrolling also occurs immediately, not taking into account AutoScrollDelay
.
The Windows COM class CLSID_DragDropHelper
is responsible for the auto-scrolling. See TVTDragManager.DragEnter()
for more details: The method does not pass the control handle to prevent auto-scrolling in case toAutoScroll
is not set.
Ok thank you. I guess as this looks like it isn't a VirtualTree issue, this can be closed now.
When something is dragged onto the list (DragType = dtVCL) from its bottom part, auto scroll happens immediately, without respecting the
AutoScrollDelay
property value. It happens in theTBaseVirtualTree.DragOver
procedure on line 11371:WindowScrolled := DoSetOffsetXY(Point(FOffsetX + DeltaX, FOffsetY + DeltaY), ScrollOptions, nil);
The
TBaseVirtualTree.DetermineScrollDirections
appears to be trying to handle this case inif FDragScrollStart = 0 then FDragScrollStart := timeGetTime; // Reset any scroll direction to avoid scroll in the case the user is dragging and the auto scroll time has not // yet elapsed. if ((Int64(timeGetTime) - FDragScrollStart) < FAutoScrollDelay) then Result := [];
But FDragScrollStart is always zero at this point, so the Result is not emptied and scrolling does occur in the
TBaseVirtualTree.DragOver
procedure.Looks like a bug.