• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Drag and drop with tables, changing the cursor, more
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Drag and drop with tables, changing the cursor, more
      • From: Greg Casey <email@hidden>
  • Prev by Date: Adding text attributes to current cursor position
  • Next by Date: Re: Drag and drop with tables, changing the cursor, more
  • Previous by thread: Re: Adding text attributes to current cursor position
  • Next by thread: Re: Drag and drop with tables, changing the cursor, more
  • Index(es):
    • Date
    • Thread