JAM-Software / Virtual-TreeView

Virtual Treeview is a Delphi treeview control
http://www.jam-software.de/virtual-treeview/
646 stars 253 forks source link

Distorted shape when dragging the columns #1254

Closed Issamdnn closed 1 month ago

Issamdnn commented 5 months ago

When Dragging the columns it shows Distorted shape . Darg

joachimmarder commented 5 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.

Trevor-S commented 1 month ago

This issue is occurring in the V8.0.3 release as well as the master repository code as at 2 October 2024 using Delphi 12.2.

The issue may be demonstrated using the "Minimal" or "Advanced (Tree in Grid Simulation)" demo applications by dragging the Tree column header with the mouse. The Drag image leaves artifacts during the dragging.

Additionally, when the DPI awareness is set to "DPI Unaware" on a Monitor with Scale greater than 100%, the drag image is positioned (offset) a far distance from the mouse. The further you move the mouse to the right or below the tree, the further away the drag image moves away from the mouse pointer.

HTH

joachimmarder commented 1 month ago

A very similar issue was discussed intensively in 2016 in issue #248.

joachimmarder commented 1 month ago

One possible solution could be implementing #806 and let Windows do the drawing.

joachimmarder commented 1 month ago

I have now implemented column header drag and drop using Windows drag and drop, and it looks promising so far. I would appreciate it if several people could do some testing.

Trevor-S commented 1 month ago

Thanks Joachim, I have done basic testing using the Advance.exe demo and my own applications.

Delphi 12.2, Dual Monitor, 3840x2160 @125% and 1920x1080 @100%

In both DPI Monitor V2 and DPI Unaware the Draw image is operating correctly, keeping with the mouse cursor and scaled appropriately when moved between screens. No more drag drawing artifacts.

However, when the header is dragged over the Delphi 12.2 IDE edit window:

image

I will continue using and testing.

joachimmarder commented 1 month ago

However, when the header is dragged over the Delphi 12.2 IDE edit window:

  • the application hangs if debugging the application in the IDE,

I can confirm this. It is not a new behavior, it also occurs when using drag&drop with tree nodes. So it is a separate issue. I suppose it is a result of a bad drop target implementation in RAD Studio, especially since it does not occur with any other application. It shouldn't hurt too much in an average situation.