Re: Drag and drop with tables, changing the cursor, more
Re: Drag and drop with tables, changing the cursor, more
- Subject: Re: Drag and drop with tables, changing the cursor, more
- From: Greg Casey <email@hidden>
- Date: Sat, 22 Feb 2003 01:32:07 -0500
Jan,
You should be returning an NSDragOperation value from
tableView:validateDrop:proposedRow:proposedDropOperation:.
In the snippet below you are returning an NSTableViewDropOperation, not
an NSDragOperation. Try returning NSDragOperationMove.
draggingSourceOperationMaskForLocal: is used for letting drag
destinations know what type of drag operations you support as a drag
source and has nothing to do with what you are trying to do at the
moment, I don't believe.
-gtc
On Saturday, February 22, 2003, at 12:51 AM, Jan Van Tol wrote:
I've checked the archives for information on drag and drop with
NSTableViews, but there only appears to be one thread, which doesn't
answer my main question.
What I'm going for is a tableView that I can reorder the items in it
by DD. I've got the actual reordering working great, but I've got one
small problem.
The cursor always shows the plus sign next to it, while my drag
operation represents a move, not a copy. Do I adjust this in the
validateDrop method? Mine is implementing like this:
- (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id
<NSDraggingInfo>)info proposedRow:(int)row
proposedDropOperation:(NSTableViewDropOperation)op {
if (op == NSTableViewDropOn) {
[tv setDropRow:(row+1) dropOperation:NSTableViewDropAbove];
}
return NSTableViewDropAbove;
}
Now, the only other thing I can return is NSTableViewDropOn, which (I
think) makes it not accept drops at all. Which leads me to believe
what I'm looking for is in draggingSourceOperationMaskForLocal, which
I should override in the tableView. I've implemented it like this:
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal {
if (isLocal) {
return NSDragOperationMove;
} else {
return NSDragOperationCopy;
}
}
This does not appear to matter what the cursor is, even if I just
return NSDragOperationMove. Although I don't really understand what
all the different NSDragOperation type do, so if someone could
enlighten me...
Thanks in advance for any help.
-Jan Van Tol
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
-gtc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.