Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-09

TControl.EndDrag is missing

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

BeginDrag is there but EndDrag is not!
It sounds strange because there is lots of Delphi code using drag-n-drop and some of it is surely ported to Lazarus. How come nobody noticed.

Or is there another way (other methods maybe) for porting such Delphi code?

Regards,
Juha

Reply by email

Graeme Geldenhuys
to Juha Manninen
Juha Manninen wrote
Or is there another way (other methods maybe) for porting such Delphi code?

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.

Regards,
- Graeme -

Reply by email

Hans-Peter Diettrich
to Juha Manninen: BeginDrag is there but EndDrag is not! It sounds strange because there is lots of Delphi…
BeginDrag is there but EndDrag is not! It sounds strange because there is lots of Delphi code using drag-n-drop and some of it is surely ported to Lazarus. How come nobody noticed.

It may be a protected method, invisible outside the Controls unit?

Or is there another way (other methods maybe) for porting such Delphi code?

The Lazarus implementation of Drag&Drop is somewhat Delphi incompatible and overly flawed. I already suggested some improvements, but no Lazarus developer did yet dare to touch that part of the LCL. Instead AnchorDocking was introduced as a replacement for Delphi D&D, and nobody (but me) ever tried to understand how Delphi compatible D&D could be made work properly. All I could achieve was the EasyDockManager and EasyDockMaster, which work around most flaws in the basic implementation. This was the state when I stopped any fruitless attempts to contribute to the LCL.

DoDi

Reply by email

luiz americo pereira camara
to Graeme Geldenhuys: Last time I tested drag-n-drop [end of 2012 if I remember correctly], and followed some…

2013/9/17 Graeme Geldenhuys

I would go out on a limb and say that nobody has ported DND based apps to LCL.

The drag and drop feature of LCL VirtualTreeView port is working fine.

Here you can find an example of DND between a VTV and a ListBox: http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/virtualtreeview-new/branches/4.8/demos/dragdrop/

Here the OLE DND (windows only):
http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/virtualtreeview-new/branches/4.8/demos/ole/

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130917/4cc82543/attachment.html>

Reply by email

Juha Manninen
to Graeme Geldenhuys: Last time I tested drag-n-drop [end of 2012 if I remember correctly], and followed some…
Graeme Geldenhuys 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.
It may be a small thing to fix. Maybe I will find time to , docking is a different and more complex issue.

Regards,
Juha

Reply by email

Hans-Peter Diettrich
to Juha Manninen: On Tue, Sep 17, 2013 at 9:47 PM, Graeme Geldenhuys In some components / widgetsets DND…
Show quoted text 17 lines
On Tue, Sep 17, 2013 at 9:47 PM, Graeme Geldenhuys 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

Reply by email