Sign in Join

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

Mailing lists / lazarus / 2012-03

Is it possible to drag and drop a web browser URL into a Lazarus app?

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys
to Frank Church
Frank Church wrote
Is it possible to drag and drop a web browser URL into a Lazarus app? Are there some controls with that facility?

In fpGUI is is handled just like any other DND action. Simply register what mime-type the drop target must look out for. It will then happile accept a drop action if such a mime-type is supplied. Simple and easy to use, and works on all platforms.

Lazarus's drag-n-drop is based on the very limited Delphi / Windows DND, so is mainly build for in-app drag-n-drop, and not able to accept external drag-n-drop actions. Normally (in Delphi) you would have to revert to Windows API calls to get better DND support. I remember seeing them (the Lazarus team) extending the default limited DND a bit to support dropping files on a LCL app, but that is a far cry from complete DND support.

Out of interest, I ran the DND Demo of fpGUI, which shows what mime-types the source of a DND action is willing to supply. I dragged the URL from the Chrome web browser and dropped in onto the Text Edit field. Below that is the complete list of mime-types (8 in total) that Chrome was willing to supply the data in. I don't know if this information will help you with your LCL application in any way.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot-Drop Site Demo.png Type: image/png Size: 10035 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120322/7ac07eec/attachment.png>

Reply by email

Hans-Peter Diettrich
to Graeme Geldenhuys
Show quoted text 18 lines
On 20 March 2012 16:37, Frank Church <vfclists at ...> wrote: > Is it possible to drag and drop a web browser URL into a Lazarus app? > > Are there some controls with that facility? In fpGUI is is handled just like any other DND action. Simply register what mime-type the drop target must look out for. It will then happile accept a drop action if such a mime-type is supplied. Simple and easy to use, and works on all platforms. Lazarus's drag-n-drop is based on the very limited Delphi / Windows DND, so is mainly build for in-app drag-n-drop, and not able to accept external drag-n-drop actions. Normally (in Delphi) you would have to revert to Windows API calls to get better DND support. I remember seeing them (the Lazarus team) extending the default limited DND a bit to support dropping files on a LCL app, but that is a far cry from complete DND support.

Inter-process D&D requires special assistance by the OS. IMO such operations are limited to drop file names, or other pure text, unless a platform offers something like OLE-DragDrop.

DoDi

Reply by email

Graeme Geldenhuys
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote
Inter-process D&D requires special assistance by the OS. IMO such operations are limited to drop file names, or other pure text, unless a platform offers something like OLE-DragDrop.

That shouldn't be a problem for Lazarus LCL then, seeing that "everything is native" and all Lazarus's target desktop platforms support inter-process DND - yet the full inter-process DND support in LCL is still missing. Will this be fixed before the 1.0 release?

Most OS's these days can and do use mime-types (just like the whole internet does) for DND. But obviously each OS/platform has a different way in which they transfer data between processes (I guess this is what you meant by "like OLE-DragDrop"). Anyway, fpGUI uses mime-types for DND, for in-app and cross-process DND. Under Windows, I still have support for the older-style DND (eg: where data types are registered as STRING or WIDESTRING like the clipboard etc). In the case of fpGUI under Windows, I simply map those older data types to similar mime-types automatically. X11 uses mime-types as-is (so no mapping or trickery required under X11). Mac OS X also has mime-type DND support. What's nice about X11's DND support is that no data is generated or transferred until it is actually known that the drop target accepted the drop. Windows unfortunately is not that clever and generates the data resources when the DND action starts at the source, not when the drop target accepts the drop. So Windows is a bit waist-full with resources (what's new).

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Hans-Peter Diettrich
to Graeme Geldenhuys
Show quoted text 10 lines
On 22 March 2012 11:59, Hans-Peter Diettrich <DrDiettrich1 at ...> wrote: > Inter-process D&D requires special assistance by the OS. IMO such operations > are limited to drop file names, or other pure text, unless a platform offers > something like OLE-DragDrop. That shouldn't be a problem for Lazarus LCL then, seeing that "everything is native" and all Lazarus's target desktop platforms support inter-process DND - yet the full inter-process DND support in LCL is still missing. Will this be fixed before the 1.0 release?

Feel free to file an feature request.

Show quoted text 6 lines
What's nice about X11's DND support is that no data is generated or transferred until it is actually known that the drop target accepted the drop. Windows unfortunately is not that clever and generates the data resources when the DND action starts at the source, not when the drop target accepts the drop. So Windows is a bit waist-full with resources (what's new).

You obviously don't understand OLE-DragDrop :-(

DoDi

Reply by email

Frank Church
to Graeme Geldenhuys: In fpGUI is is handled just like any other DND action. Simply register what mime-type the…

2012/3/22 Graeme Geldenhuys :

Show quoted text 28 lines
On 20 March 2012 16:37, Frank Church <vfclists at ...> wrote: > Is it possible to drag and drop a web browser URL into a Lazarus app? > > Are there some controls with that facility? In fpGUI is is handled just like any other DND action. Simply register what mime-type the drop target must look out for. It will then happile accept a drop action if such a mime-type is supplied. Simple and easy to use, and works on all platforms. Lazarus's drag-n-drop is based on the very limited Delphi / Windows DND, so is mainly build for in-app drag-n-drop, and not able to accept external drag-n-drop actions. Normally (in Delphi) you would have to revert to Windows API calls to get better DND support. I remember seeing them (the Lazarus team) extending the default limited DND a bit to support dropping files on a LCL app, but that is a far cry from complete DND support. Out of interest, I ran the DND Demo of fpGUI, which shows what mime-types the source of a DND action is willing to supply. I dragged the URL from the Chrome web browser and dropped in onto the Text Edit field. Below that is the complete list of mime-types (8 in total) that Chrome was willing to supply the data in. I don't know if this information will help you with your LCL application in any way.

fpGUI is something I should be trying out more. I have remember that Lazarus doesn't always mean LCL :)

Your example fits my need perfectly.

Show quoted text 15 lines
-- Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Frank Church ======================= http://devblog.brahmancreations.com

Reply by email