drag-drop help please.... 
Author Message
 drag-drop help please....

Hi all,
back again for some more help from this great group....
I'm trying to implement drag & drop for a listview on one of my shell
windows. Basically, I want to be able to move an element's position
higher or lower in the list via drag/drop.
In the RC, I've selected "isDragSource" and "isDropTarget" for the
listview.
In my Shell's createSchematicWiring, I've added the following
triggers:
        ( self presenterNamed: 'questionListView' )
                when: #drag
                send: #onDrag
                to: self.
        ( self presenterNamed: 'questionListView' )
                when: #drop
                send: #onDropOver
                to: self.
        ( self presenterNamed: 'questionListView' )
                when: #dragOver
                send: #onDragOver
                to: self.
And in the onDrag method, I've created a new InternalDragDropObject,
and used #format:data: to set the format and data for that object.
My problem: my code doesn't seem to be initiating a DD session. I can
pick up an object (and get the "Not Allowed" cursor), but that's it.
If I set breakpoints in any of my onDragXXX or onDropXXX methods,
execution never halts, so it seems like the wiring from
#createSchematicWiring is ignored. I thought I had everything I needed
to at least trigger the DD event but.....

Any hints or clues as to what I may be doing wrong here?
Sorry for the rambling post -- it's late, I'm tired, and I just can't
seem to find an awful lot of info/documentation on DD with
Dolphin.....

Thanks,

KeithB



Sat, 09 Apr 2005 13:13:33 GMT  
 drag-drop help please....

Quote:
> Hi all,
> back again for some more help from this great group....
> I'm trying to implement drag & drop for a listview on one of my shell
> windows. Basically, I want to be able to move an element's position
> higher or lower in the list via drag/drop.
> In the RC, I've selected "isDragSource" and "isDropTarget" for the
> listview.

...

I think you may have the wrong event names in your method (unless it is just
a transcription error).  Your events do not have colons on the end.  Look at
the published aspects of the View class for the event names.  The actual
drag/drop events have arguments.

Quote:
> And in the onDrag method, I've created a new InternalDragDropObject,
> and used #format:data: to set the format and data for that object.
> My problem: my code doesn't seem to be initiating a DD session. I can
> pick up an object (and get the "Not Allowed" cursor), but that's it.
> If I set breakpoints in any of my onDragXXX or onDropXXX methods,
> execution never halts, so it seems like the wiring from
> #createSchematicWiring is ignored. I thought I had everything I needed
> to at least trigger the DD event but.....

If you can't get events to fire one thing I would check is to make sure your
onViewOpened method does a super send if you have one.  If you override this
method and forget to do a super send then createSchematicWiring will not be
called.  While you are at it you might check any standard MVP methods to
make sure you are super sending them if needed.

I had a heck of a time implementing drag and drop my self a few months ago.
I believe I had a mistaken assumption that one of the events (drag over
perhaps) was optional, when in fact it was required.  I tried to quickly add
drag and drop support by taking a shortcut and implementing as little code
as possible.  However I came to realize that drag and drop support can not
be added hastily (especially if you don't have experience with it in
Dolphin).  So I backed out and took a more thoughtful approach and got it
working.

Quote:
> Any hints or clues as to what I may be doing wrong here?
> Sorry for the rambling post -- it's late, I'm tired, and I just can't
> seem to find an awful lot of info/documentation on DD with
> Dolphin.....

I could not find any documentation about drag and drop in Dolphin either.  I
just had to use the system tools as an example, and the comments as a
reference.

Chris



Sun, 10 Apr 2005 06:45:15 GMT  
 drag-drop help please....
Thanks for the help, Chris!
You were exactly right....I was missing the colons on the selector
names.

I like Dolphin, but I think real improvement is needed in the area of
documentation. Having great resources like yourself, Ian and others is
fine, but for me, there's nothing quite like having a manual I can
flip through (or a .pdf file I can page through) to give me that "big
picture". Plus, good documentation is a *whole* lot lighter! (can't
imagine trying to stuff you or Ian in my back pocket :-)

Thanks again...

KeithB

Quote:


> > Hi all,
> > back again for some more help from this great group....
> > I'm trying to implement drag & drop for a listview on one of my shell
> > windows. Basically, I want to be able to move an element's position
> > higher or lower in the list via drag/drop.
> > In the RC, I've selected "isDragSource" and "isDropTarget" for the
> > listview.
> ...

> I think you may have the wrong event names in your method (unless it is just
> a transcription error).  Your events do not have colons on the end.  Look at
> the published aspects of the View class for the event names.  The actual
> drag/drop events have arguments.

> > And in the onDrag method, I've created a new InternalDragDropObject,
> > and used #format:data: to set the format and data for that object.
> > My problem: my code doesn't seem to be initiating a DD session. I can
> > pick up an object (and get the "Not Allowed" cursor), but that's it.
> > If I set breakpoints in any of my onDragXXX or onDropXXX methods,
> > execution never halts, so it seems like the wiring from
> > #createSchematicWiring is ignored. I thought I had everything I needed
> > to at least trigger the DD event but.....

> If you can't get events to fire one thing I would check is to make sure your
> onViewOpened method does a super send if you have one.  If you override this
> method and forget to do a super send then createSchematicWiring will not be
> called.  While you are at it you might check any standard MVP methods to
> make sure you are super sending them if needed.

> I had a heck of a time implementing drag and drop my self a few months ago.
> I believe I had a mistaken assumption that one of the events (drag over
> perhaps) was optional, when in fact it was required.  I tried to quickly add
> drag and drop support by taking a shortcut and implementing as little code
> as possible.  However I came to realize that drag and drop support can not
> be added hastily (especially if you don't have experience with it in
> Dolphin).  So I backed out and took a more thoughtful approach and got it
> working.

> > Any hints or clues as to what I may be doing wrong here?
> > Sorry for the rambling post -- it's late, I'm tired, and I just can't
> > seem to find an awful lot of info/documentation on DD with
> > Dolphin.....

> I could not find any documentation about drag and drop in Dolphin either.  I
> just had to use the system tools as an example, and the comments as a
> reference.

> Chris



Sun, 10 Apr 2005 11:25:23 GMT  
 drag-drop help please....

Quote:

> > Any hints or clues as to what I may be doing wrong here?
> > Sorry for the rambling post -- it's late, I'm tired, and I just can't
> > seem to find an awful lot of info/documentation on DD with
> > Dolphin.....

> I could not find any documentation about drag and drop in Dolphin either.  I
> just had to use the system tools as an example, and the comments as a
> reference.

I've got a little tutorial on my website to implement drag&drop

<http://homepage.ntlworld.com/ted.bracht/id22.htm>

Hope that helps,

Ted



Sun, 10 Apr 2005 16:07:34 GMT  
 drag-drop help please....

Quote:
> I like Dolphin, but I think real improvement is needed in the area of
> documentation. Having great resources like yourself, Ian and others is
> fine, but for me, there's nothing quite like having a manual I can
> flip through (or a .pdf file I can page through) to give me that "big
> picture".

I'd like to see improvements in the documentation too.


Wed, 20 Apr 2005 12:37:46 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Bwidgets: Explain Coding Specifics for Drag and Drop Please

2. Drag&Drop update (dragdrop-1.1)

3. Drag and Drop - How to get what was dropped onto

4. Need help for Win32 drag and drop.

5. Drag and drop Folder on APPL [HELP]

6. drag and drop a line: HELP

7. Drag and Drop Help for Newbie

8. DRAG AND DROP HELP

9. Help with drag and drop controls

10. Drag and Drop Help needed!

11. VO Help: Drag-and-Drop example neede!

12. HELP: VX-REXX Drag and Drop

 

 
Powered by phpBB® Forum Software