Methods


tabView:writeItem:toPasteboard:
Writes the given tab view item to the pasteboard.
tabView:dragEndedAtPoint:withOperation:forItem:
Notification that a drag of a tab item has concluded.
tabView:validateDrop:proposedItemIndex:proposedDropOperation:
Validates a proposed drop operation.
tabView:acceptDrop:itemIndex:dropOperation:
Performs the drop.
tabView:menuForItemAtIndex:event:
Message sent to delegate when the tab view needs a context menu.

tabView:acceptDrop:itemIndex:dropOperation:

Performs the drop.
- ( BOOL ) tabView:
        (id ) tabView acceptDrop:
        (id ) info itemIndex:
        (int ) itemIndex dropOperation:
        (MOTabViewDropOperation ) op;

Performs the drop. This method is called when the mouse is released over a tab view that previously decided to allow a drop via the -tabView:validateDrop:proposedItemIndex:proposedDropOperation: method. The delegate should incorporate the data from the dragging pasteboard at this time. The itemIndex and op will be whatever values were last passed to setDropItemIndex:dropOperation: or, if the delegate never called that method, the last proposed index and op that were passed to the -tabView:validateDrop:proposedItemIndex:proposedDropOperation: method.

Parameter Descriptions
tabView
The sender.
info
The NSDraggingInfo for the in-progress drag operation.
itemIndex
The drop index.
op
The drop operation.
method result
Whether the drop was completed successfully.

tabView:dragEndedAtPoint:withOperation:forItem:

Notification that a drag of a tab item has concluded.
- ( void ) tabView:
        (id ) tabView dragEndedAtPoint:
        (NSPoint ) aPoint withOperation:
        (NSDragOperation ) dragOp forItem:
        (NSTabViewItem *) item;

Notification that a drag of a tab item has concluded. This method is called after a drag initiated by the tab view has ended. dragOp indicates what the operation was and can be used to determine if the drag succeeded or not.

Parameter Descriptions
tabView
The sender.
aPoint
The drop point in screen coordinates.
dragOp
The drag operation (NSDragOperationNone if there was no successful drop).
item
The item for the tab that was dragged.

tabView:menuForItemAtIndex:event:

Message sent to delegate when the tab view needs a context menu.
- ( NSMenu *) tabView:
        (id ) tabView menuForItemAtIndex:
        (int ) itemIndex event:
        (NSEvent *) event;

Message sent to delegate when the tab view needs a context menu. This message is sent when the user right-clicks or control-clicks in the tab bar of a tab view. The delegate can return a menu to use as the context menu.

Parameter Descriptions
tabView
The sender
itemIndex
The index of the tab that the mouse is over, or -1 if the mouse is over the tab bar but not an actual tab.
event
The event.
method result
A menu to use as the context menu or nil if there should be no menu.

tabView:validateDrop:proposedItemIndex:proposedDropOperation:

Validates a proposed drop operation.
- ( NSDragOperation ) tabView:
        (id ) tabView validateDrop:
        (id ) info proposedItemIndex:
        (int ) itemIndex proposedDropOperation:
        (MOTabViewDropOperation ) op;

Validates a proposed drop operation. This method is used by MOTabView to determine a valid drop target. Based on the mouse position, the tab view will suggest a proposed drop location. This method must return a value that indicates which dragging operation the delegate will perform. The delegate may "re-target" a drop if desired by calling -setDropItemIndex:dropOperation: on the sender and then returning something other than NSDragOperationNone. One may choose to re-target for various reasons (eg. for better visual feedback when inserting into a sorted position). See the documentation for -setDropItemIndex:dropOperation: for more info on what the itemIndex and op mean.

Parameter Descriptions
tabView
The sender.
info
The NSDraggingInfo for the in-progress drag operation.
itemIndex
The proposed drop index.
op
The proposed drop operation.
method result
The drag operation that would occur if the drop happened at the current point.

tabView:writeItem:toPasteboard:

Writes the given tab view item to the pasteboard.
- ( BOOL ) tabView:
        (id ) tabView writeItem:
        (NSTabViewItem *) item toPasteboard:
        (NSPasteboard *) pboard;

Writes the given tab view item to the pasteboard. This method is invoked by MOTabView when the user starts to drag a tab. To refuse the drag, return NO. To start a drag, return YES and place the drag data onto the pasteboard (data, owner, etc...). The drag image and other drag related information will be set up and provided by the tab view once this call returns with YES.

Parameter Descriptions
tabView
The sender.
item
The item for the tab being dragged.
pboard
The pasteboard to write to.
method result
Whether the delegate wrote the item to the pasteboard.

(Last Updated 3/20/2005)