hello everyone,
I just want to share this.
I'm implementing D&D to move nodes in Virtual TreeView. And there is a good example here.
https://stackoverflow.com/questions/8487335/virtualtreeview-drag-and-drop-to-arrange-nodes-in-a-listIt works fine with the Lazarus port of Virtual Treeview (VirtualTreeView-Lazarus 5.5.3-r1) on Windows. However, DragDrop event requires IDataObject which uses ActiveX unit. On Ubuntu (or any Linux or non-Windows), you get compile error, naturally...
So, I spent half day trying to find a way to do it without ActiveX.
And solution was..
uses
{$ifdef windows},ActiveX{$else},FakeActiveX{$endif}
and set DragType to dtVCL.
I don't think there is any documentation or wiki entries on this as of today. I hope this helps some one some day.
PS. After little bit of testing, I think I encountered a bug on both Linux and Windows. On windows, right click sometimes does not work. Some time, you have to double right click to select and show popup. On Linux(Ubuntu at least), it is bit worse. Right click some times triggers dragging.
I attached simple project to recreate the behavior.
I am well aware that the maintainer clearly states testing on Linux is limited and dtVCL is sort of deprecated option for the original Virtual Treeview. However, I like Virtual TreeView and wanna work on Linux too...
------------------------------
VirtualTreeView-Lazarus 5.5.3-r1
Windows 10:
Lazarus 1.8.0 r56594 FPC 3.0.4 x86_64-win64-win32/win64
Ubuntu 17.10
Lazarus 1.8.0 rc4+dfsg-1 FPC 3.0.2 x86_64-linux-gtk2