Re: IKImageBrowserView Dragging outside
Re: IKImageBrowserView Dragging outside
- Subject: Re: IKImageBrowserView Dragging outside
- From: Tobias Jordan <email@hidden>
- Date: Mon, 26 Oct 2009 17:51:02 +0100
Hey Jonathan & Thomas,
it's finally working and even more easier than I've thought: So I made
a subclass of my IKImageBrowserView and added a new delegate method,
the one's missing:
//
-------------------------------------------------------------------------------
// -browserView:droppedIndexes:atDestination:
//
-------------------------------------------------------------------------------
- (void)browserView:(ESPImageBrowserView *)bv droppedIndexes:
(NSIndexSet *)indexSet atDestination:(NSURL *)dropDestination
{
if (self.delegate)
{
if ([self.delegate
respondsToSelector
:@selector(browserView:droppedIndexes:atDestination:)])
{
[self.delegate browserView:bv droppedIndexes:indexSet
atDestination:dropDestination];
}
}
}
it's called from:
//
-------------------------------------------------------------------------------
// -namesOfPromisedFilesDroppedAtDestination:
//
-------------------------------------------------------------------------------
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL
*)dropDestination
{
[self browserView:self droppedIndexes:[self selectionIndexes]
atDestination:dropDestination];
return nil;
}
No need to implement :mouseDown- or -mouseDragged: :-)
Thank you for your help!
Best regards,
Tobias Jordan.
On Oct 25, 2009, at 12:41 PM, email@hidden wrote:
That might prove to be the case.
Others think the same: http://www.cocoabuilder.com/archive/message/cocoa/2009/7/29/241852
An approach might be to use an NSTableView instance as a drag source
proxy.
When your IKImageBrowserView instance gets a drag request pass it on
to the tableview which can deliver on the promise.
You would have to keep the datasources synchronised of course.
Either that or populate the tableview with just the items to be
dragged when the IKImageBrowserView
drag begins.
Just an idea. Might be tricky to pull off in practice.
Regards
Jonathan Mitchell
Developer
http://www.mugginsoft.com
On Oct 25, 2009, at 3:41 PM, Thomas Goossens wrote:
Ok, I didn't catch you need to create special folder structures.
So you can only do that with promised files and since there is no
equivalent to "tableView:namesOfPromisedFilesDroppedAtDestination"
in the IKImageBrowseView, you will have to do everything at the
NSView level using
"dragPromisedFilesOfTypes:fromRect:source:slideBack:event:" and
"namesOfPromisedFilesDroppedAtDestination:".
But that means you will have to detect when the drag should start
(with mouseDown/mouseDragged + IK's indexOfItemAtPoint) and setup
your drag image yourself.
-- Thomas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden