Re: Drag'n'Drop : Dragging a file into an app



Rob,

> I'm looking for some help. I was wondering if anyone could point me to an
> example of how enable dragging files into an app. I can get dragging of
> objects from one shell to another running - but not from a non Dolphin
> source.

That functionality isn't exposed in vanilla Dolphin, so you'll need an
extension. I use Louis and Steve's 'DH Shell Data Transfer' package which is
part of their 'Shell' project at:
http://www.dolphinharbor.org/dh/projects/shell/index.html

To use it, do something like:

ShellDragDropSession registerDropTarget: each view.

for each of the presenters you want to be 'active'. I do that in my main
Shell's #onViewOpened. Similarly you need to call:

ShellDragDropSession revokeDropTarget: each view.

in your #onViewClosed.

Unfortunately, I don't know of any way to make the whole window, including
sub-panes, be 'active' except my looping over them. A Windows thing...

With that in place, the "normal" Dolphin drag-and-drop stuff is hooked into the
Windows stuff (as a drop target, I don't know whether it's also possible to
make it a drag source as easily). You'll also (as normal) have to make the
relevant Views be
#isDropTarget: true
either in the view composer or from code. And you'll have to register interest
in the #dragOver: and #drop: events triggered off the relevant Presenters (not
their Views), which is also as per normal.

Files dropped into the app show up as objects with format #Filenames (note the
plural -- the object is a collection of filenames) in the DragDropSession.

I've found one problem with it, which may be because I'm not using it quite
right (so beware ;-) When the image is saved and restarted, the connection to
Windows is implicitly revoked (obviously) so ShellDragDropSession attempts to
reconnect automatically, but that doesn't (for me anyway) seem to work
properly. I haven't found a workaround for it (simply hooking image startup
from my Shell to reconnect then doesn't work since that interferes with
ShellDragDropSession's own attempt). But since it is irrelevant to deployed
applications, and I don't often close down my image anyway, I haven't worried
too much about it.

-- chris



.



Relevant Pages

  • Re: Windows CE Splash and Shell
    ... for each Launch key windows CE checks signal started ... dependencies before launching the App. ... Windows Embedded Manager ... have a Windows CE image with standard shell working ...
    (microsoft.public.windowsce.embedded)
  • Re: Custom shell window management
    ... have multiple non-modal windows, then click on the 'background' shell ... app, all of the spawned windows are 'hidden' behind the shell. ... that seem common to custom shell creation. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Custom shell window management
    ... I'd recommend you to create your shell app with CreateWindowEx API with the WS_EX_NOACTIVATE ex-style set. ... have multiple non-modal windows, then click on the 'background' shell ... that seem common to custom shell creation. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Windows CE Splash and Shell
    ... have a Windows CE image with standard shell working ... Windows Embedded Manager ... Ive written a small app displaying a splash screen, ...
    (microsoft.public.windowsce.embedded)
  • Re: DragnDrop : Dragging a file into an app
    ... example of how enable dragging files into an app. ... I can get dragging of objects from one shell to another running - but not from a non Dolphin source. ... in the #dragOver: and #drop: events triggered off the relevant Presenters (not ... Windows is implicitly revoked so ShellDragDropSession attempts to ...
    (comp.lang.smalltalk.dolphin)