Juha Manninen schrieb:
On Tue, Sep 17, 2013 at 9:47 PM, Graeme Geldenhuys
<[email protected]> wrote:
Last time I tested drag-n-drop [end of 2012 if I remember correctly],
and followed some Delphi tutorials (even official Delphi ones), LCL's
DND was still badly broken [especially on nested components]. I would go
out on a limb and say that nobody has ported DND based apps to LCL.

In some components / widgetsets DND works OK, at least when DragMode =
mdAutomatic.
I was able to make a GUI for component palette reordering in Lazarus.
There items can be dragged and dropped inside a ListBox and from a
ListView to a ListBox.
Build Lazarus trunk with "EnableComponentPaletteOptions" to test it.

It means the functionality for Drag-n-Drop is there.
BeginDrag / EndDrag is a coupled pair, I was surprised that only the
other one is missing.

BeginDrag is called by the user, for starting a manual D&D. EndDrag instead is called automatically, when the dragged object is dropped. In between the OnDragOver and finally OnDragDrop events are generated. In so far it's okay (and good!) when EndDrag is *not* callable by the user.

It may be a small thing to fix. Maybe I will find time to look at it.

DoDi, docking is a different and more complex issue.

Both are accomplished by DragDrop objects, which are Delphi incompatible. In the Delphi implementation the events are handled by these objects, which the user can modify (derived classes...), while the LCL handles everything in the added DragManager and more classes. I see no valid reason for this breaking difference.

DoDi


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to