Drag and drop with tables, changing the cursor, more
Drag and drop with tables, changing the cursor, more
- Subject: Drag and drop with tables, changing the cursor, more
- From: Jan Van Tol <email@hidden>
- Date: Fri, 21 Feb 2003 23:51:19 -0600
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.