From a0a158af27f4c8304a637d042201b5f763fee067 Mon Sep 17 00:00:00 2001 From: preble Date: Sat, 9 Oct 2010 11:44:27 -0400 Subject: [PATCH] Drag & drop working! Removed outline view, placing item picker in main window. --- English.lproj/MainMenu.xib | 1162 +++++++++++++-------------------- IJInventoryView.h | 11 + IJInventoryView.m | 29 +- IJInventoryWindowController.h | 3 +- IJInventoryWindowController.m | 156 +---- 5 files changed, 540 insertions(+), 821 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 9d87ea8..6d77a15 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -492,7 +492,7 @@ 15 2 - {{431, 188}, {551, 537}} + {{431, 250}, {728, 475}} 1954021376 Inside Job NSWindow @@ -503,474 +503,46 @@ 256 YES - - - 274 - - YES - - - 2304 - - YES - - - 4352 - {551, 160} - - YES - - - 256 - {551, 17} - - - - - - -2147483392 - {{427, 0}, {16, 17}} - - - - YES - - slot - 101 - 16 - 1000 - - 75628096 - 2048 - Slot - - LucidaGrande - 11 - 3100 - - - 3 - MC4zMzMzMzI5ODU2AA - - - 6 - System - headerTextColor - - 3 - MAA - - - - - 337772096 - 2048 - Text Cell - - LucidaGrande - 13 - 1044 - - - - 6 - System - controlBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - 3 - YES - - - - count - 64 - 10 - 3.4028234663852886e+38 - - 75628096 - 67110912 - Count - - - 6 - System - headerColor - - 3 - MQA - - - - - - 337772096 - -2080372736 - Text Cell - - - - YES - - YES - allowsFloats - formatterBehavior - locale - negativeInfinitySymbol - nilSymbol - positiveInfinitySymbol - - - YES - - - - - - -∞ - - +∞ - - - # - # - - - - - - - - NaN - - YES - - YES - - - YES - - - - - 0 - 0 - YES - NO - 1 - AAAAAAAAAAAAAAAAAAAAAA - - - - 3 - YES - YES - YES - - . - , - NO - NO - YES - - - - - - 3 - YES - YES - - - - item - 180 - 40 - 1000 - - 75628096 - 2048 - Item - - - - - - 337772096 - 2048 - Text Cell - - - - - - 3 - YES - YES - - - - id - 42 - 10 - 3.4028234663852886e+38 - - 75628096 - 2048 - Id - - - - - - 337772096 - -2147481600 - Text Cell - - - - YES - - YES - allowsFloats - formatterBehavior - locale - negativeInfinitySymbol - nilSymbol - positiveInfinitySymbol - - - YES - - - - -∞ - - +∞ - - - # - # - - - - - - - - NaN - - - - - - 3 - YES - YES - YES - - . - , - NO - NO - YES - - - - - - 3 - YES - YES - - - - damage - 149 - 10 - 3.4028234663852886e+38 - - 75628096 - 2048 - Damage - - - - - - 337772096 - -2147481600 - Text Cell - - - - YES - - YES - allowsFloats - formatterBehavior - locale - negativeInfinitySymbol - nilSymbol - positiveInfinitySymbol - - - YES - - - - -∞ - - +∞ - - - # - # - - - - - - - - NaN - - - - - - 3 - YES - YES - YES - - . - , - NO - NO - YES - - - - - - 3 - YES - YES - - - - 3 - 2 - - - 6 - System - gridColor - - 3 - MC41AA - - - 17 - -767557632 - - - 4 - 15 - 0 - YES - 0 - - - {{1, 17}, {551, 160}} - - - - - 4 - - - - -2147483392 - {{427, 17}, {15, 308}} - - - _doScroller: - 0.95614035087719296 - - - - -2147483392 - {{1, 325}, {441, 15}} - - 1 - - _doScroller: - 0.96836555360281196 - - - - 2304 - - YES - - - {{1, 0}, {551, 17}} - - - - - 4 - - - - {{-1, -1}, {553, 178}} - - - 562 - - - - - - QSAAAEEgAABBmAAAQZgAAA - 266 - {{211, 510}, {332, 14}} + {{211, 448}, {509, 14}} YES 68288064 71435264 Status - + + LucidaGrande + 11 + 3100 + 6 System controlColor - + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + - 268 - {{53, 471}, {85, 19}} + {{53, 409}, {85, 19}} YES @@ -994,7 +566,9 @@ YES - + + + -∞ @@ -1011,10 +585,25 @@ NaN - + + YES + + YES + + + YES + + - - + + 0 + 0 + YES + NO + 1 + AAAAAAAAAAAAAAAAAAAAAA + + 3 YES @@ -1033,7 +622,10 @@ 6 System textBackgroundColor - + + 3 + MQA + 6 @@ -1046,7 +638,7 @@ 268 - {{8, 473}, {40, 14}} + {{8, 411}, {40, 14}} YES @@ -1062,14 +654,18 @@ 10 - {{0, 496}, {551, 5}} + {{0, 434}, {728, 5}} {0, 0} 67239424 0 Box - + + LucidaGrande + 13 + 1044 + 3 @@ -1084,7 +680,7 @@ 268 - {{11, 505}, {195, 25}} + {{11, 443}, {195, 25}} YES @@ -1128,29 +724,286 @@ 2 - + 268 - {{78, 309}, {432, 144}} + {{78, 247}, {432, 144}} IJInventoryView - + 268 - {{78, 242}, {432, 48}} + {{78, 180}, {432, 48}} IJInventoryView - + 268 - {{11, 261}, {48, 192}} + {{11, 199}, {48, 192}} IJInventoryView + + + 265 + {{565, 406}, {152, 22}} + + YES + + 343014976 + 268436544 + + + + YES + 1 + + + + 130560 + 0 + search + + _searchFieldSearch: + + 138690815 + 0 + + 400 + 75 + + + 130560 + 0 + clear + + YES + + YES + + YES + AXDescription + NSAccessibilityEncodedAttributesValueType + + + YES + cancel + + + + + + _searchFieldCancel: + + 138690815 + 0 + + 400 + 75 + + 255 + + + + + 273 + + YES + + + 2304 + + YES + + + 256 + {173, 397} + + YES + + + -2147483392 + {{224, 0}, {16, 17}} + + + YES + + 40 + 40 + 1000 + + 75628096 + 2048 + + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + + + + 337772096 + -2080372736 + Text Cell + + + + YES + + YES + allowsFloats + formatterBehavior + locale + negativeInfinitySymbol + nilSymbol + positiveInfinitySymbol + + + YES + + + + -∞ + + +∞ + + + # + # + + + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + YES + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + YES + + + + 127 + 40 + 1000 + + 75628096 + 2048 + + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + -700448768 + + + 4 + 15 + 0 + YES + 0 + + + {{1, 1}, {173, 397}} + + + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + _doScroller: + 0.99668874172185429 + + + + -2147483392 + {{1, 119}, {223, 15}} + + 1 + + _doScroller: + 0.99425287356321834 + + + {{554, -1}, {175, 399}} + + + 562 + + + + QSAAAEEgAABBmAAAQZgAAA + - {551, 537} + {728, 475} {{0, 0}, {1440, 878}} @@ -1385,30 +1238,6 @@ 535 - - - dataSource - - - - 578 - - - - delegate - - - - 579 - - - - outlineView - - - - 580 - inventoryWindowController @@ -1441,14 +1270,6 @@ 604 - - - initialFirstResponder - - - - 605 - value: worldTime @@ -1469,7 +1290,7 @@ inventoryView - + 642 @@ -1477,7 +1298,7 @@ armorView - + 645 @@ -1485,7 +1306,7 @@ quickView - + 646 @@ -1855,15 +1676,16 @@ YES - - - - + + + + + @@ -1905,143 +1727,6 @@ - - 565 - - - YES - - - - - - - - - 566 - - - - - 567 - - - - - 568 - - - YES - - - - - - - - - - 569 - - - - - 570 - - - YES - - - - - - 571 - - - YES - - - - - - 572 - - - - - 573 - - - - - 574 - - - YES - - - - - - 575 - - - YES - - - - - - 576 - - - YES - - - - - - 577 - - - YES - - - - - - 581 - - - - - 582 - - - - - 587 - - - YES - - - - - - 588 - - - YES - - - - - - 589 - - - 591 @@ -2114,7 +1799,7 @@ 641 - + YES @@ -2122,14 +1807,96 @@ 643 - + 644 - + + + 647 + + + YES + + + + + + 648 + + + + + 649 + + + YES + + + + + + + + 650 + + + + + 651 + + + + + 652 + + + YES + + + + + + + 654 + + + YES + + + + + + 655 + + + YES + + + + + + 656 + + + + + 657 + + + YES + + + + + + 658 + + + @@ -2232,30 +1999,12 @@ 533.IBPluginDependency 56.IBPluginDependency 56.ImportedFromIB2 - 565.IBPluginDependency - 566.IBPluginDependency - 567.IBPluginDependency - 568.IBPluginDependency - 569.IBPluginDependency 57.IBEditorWindowLastContentRect 57.IBPluginDependency 57.ImportedFromIB2 57.editorWindowContentRectSynchronizationRect - 570.IBPluginDependency - 571.IBPluginDependency - 572.IBPluginDependency - 573.IBPluginDependency 58.IBPluginDependency 58.ImportedFromIB2 - 581.IBNumberFormatterBehaviorMetadataKey - 581.IBNumberFormatterLocalizesFormatMetadataKey - 581.IBPluginDependency - 582.IBNumberFormatterBehaviorMetadataKey - 582.IBNumberFormatterLocalizesFormatMetadataKey - 582.IBPluginDependency - 589.IBNumberFormatterBehaviorMetadataKey - 589.IBNumberFormatterLocalizesFormatMetadataKey - 589.IBPluginDependency 591.IBPluginDependency 591.IBViewBoundsToFrameTransform 592.IBPluginDependency @@ -2280,6 +2029,20 @@ 643.IBViewBoundsToFrameTransform 644.IBPluginDependency 644.IBViewBoundsToFrameTransform + 647.IBPluginDependency + 648.IBPluginDependency + 649.IBPluginDependency + 649.IBViewBoundsToFrameTransform + 650.IBPluginDependency + 651.IBPluginDependency + 652.IBPluginDependency + 654.IBPluginDependency + 655.IBPluginDependency + 656.IBPluginDependency + 657.IBPluginDependency + 658.IBNumberFormatterBehaviorMetadataKey + 658.IBNumberFormatterLocalizesFormatMetadataKey + 658.IBPluginDependency 74.IBPluginDependency 74.ImportedFromIB2 75.IBPluginDependency @@ -2379,9 +2142,9 @@ {{475, 832}, {234, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{105, 24}, {551, 537}} + {{80, 119}, {728, 475}} com.apple.InterfaceBuilder.CocoaPlugin - {{105, 24}, {551, 537}} + {{80, 119}, {728, 475}} {{33, 99}, {480, 360}} {3.40282e+38, 3.40282e+38} @@ -2395,30 +2158,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin {{392, 653}, {203, 183}} com.apple.InterfaceBuilder.CocoaPlugin {{23, 794}, {245, 183}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin P4AAAL+AAABDOgAAw8SAAA @@ -2465,6 +2210,22 @@ AUIQAABDSgAAA com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABEDUAAw8AAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2498,7 +2259,7 @@ - 646 + 658 @@ -2506,6 +2267,17 @@ IJInventoryView NSView + + delegate + id + + + delegate + + delegate + id + + IBProjectSource IJInventoryView.h @@ -3124,6 +2896,22 @@ AppKit.framework/Headers/NSScroller.h + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSSearchFieldCell + NSTextFieldCell + + IBFrameworkSource + AppKit.framework/Headers/NSSearchFieldCell.h + + NSSegmentedCell NSActionCell @@ -3148,14 +2936,6 @@ AppKit.framework/Headers/NSTableColumn.h - - NSTableHeaderView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSTableHeaderView.h - - NSTableView NSControl diff --git a/IJInventoryView.h b/IJInventoryView.h index 2db873b..fb2c494 100644 --- a/IJInventoryView.h +++ b/IJInventoryView.h @@ -8,6 +8,8 @@ #import +@protocol IJInventoryViewDelegate; +@class IJInventoryItem; @interface IJInventoryView : NSView { int rows; @@ -16,9 +18,18 @@ NSEvent *mouseDownEvent; NSArray *items; + + id delegate; } +@property (nonatomic, assign) id delegate; - (void)setRows:(int)numberOfRows columns:(int)numberOfColumns; - (void)setItems:(NSArray *)theItems; @end + + +@protocol IJInventoryViewDelegate +- (void)inventoryView:(IJInventoryView *)inventoryView removeItemAtIndex:(int)itemIndex; +- (void)inventoryView:(IJInventoryView *)inventoryView setItem:(IJInventoryItem *)item atIndex:(int)itemIndex; +@end diff --git a/IJInventoryView.m b/IJInventoryView.m index 59692f3..d11fbf8 100644 --- a/IJInventoryView.m +++ b/IJInventoryView.m @@ -16,6 +16,8 @@ const static CGFloat cellOffset = 40; @implementation IJInventoryView +@synthesize delegate; + - (id)initWithFrame:(NSRect)frameRect { if (self = [super initWithFrame:frameRect]) @@ -82,6 +84,7 @@ const static CGFloat cellOffset = 40; - (void)setItems:(NSArray *)theItems { + NSLog(@"%s", __PRETTY_FUNCTION__); [items autorelease]; [theItems retain]; items = theItems; @@ -103,11 +106,6 @@ const static CGFloat cellOffset = 40; return index; } -- (IJInventoryItem *)itemAtPoint:(NSPoint)point -{ - return [items objectAtIndex:[self itemIndexForPoint:point]]; -} - #pragma mark - #pragma mark Drag & Drop: Source @@ -128,7 +126,8 @@ const static CGFloat cellOffset = 40; // Find the IJInventoryItem: NSPoint pointInView = [self convertPoint:mouseDownPoint fromView:nil]; - IJInventoryItem *item = [self itemAtPoint:pointInView]; + int itemIndex = [self itemIndexForPoint:pointInView]; + IJInventoryItem *item = [items objectAtIndex:itemIndex]; if (item.itemId == 0) return; // can't drag nothing @@ -141,9 +140,12 @@ const static CGFloat cellOffset = 40; NSImage *image = item.image; + // Now clear out item: + [delegate inventoryView:self removeItemAtIndex:itemIndex]; + NSPoint dragPoint = NSMakePoint(pointInView.x - image.size.width*0.5, pointInView.y - image.size.height*0.5); - [self dragImage:item.image + [self dragImage:image at:dragPoint offset:NSZeroSize event:mouseDownEvent @@ -164,6 +166,11 @@ const static CGFloat cellOffset = 40; - (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation { NSLog(@"%s operation=%d", __PRETTY_FUNCTION__, operation); + + if (operation == NSDragOperationMove) + { + // + } } //- (void)draggedImage:(NSImage *)image movedTo:(NSPoint)screenPoint //{ @@ -218,6 +225,14 @@ const static CGFloat cellOffset = 40; } - (BOOL)performDragOperation:(id )sender { + NSLog(@"%s operation=%d", __PRETTY_FUNCTION__, sender.draggingSourceOperationMask); + + int index = [self itemIndexForPoint:[self convertPoint:[sender draggingLocation] fromView:nil]]; + + NSData *itemData = [[sender draggingPasteboard] dataForType:IJPasteboardTypeInventoryItem]; + IJInventoryItem *item = [NSKeyedUnarchiver unarchiveObjectWithData:itemData]; + + [delegate inventoryView:self setItem:item atIndex:index]; return YES; } - (void)concludeDragOperation:(id )sender diff --git a/IJInventoryWindowController.h b/IJInventoryWindowController.h index ee0d4d5..ef76319 100644 --- a/IJInventoryWindowController.h +++ b/IJInventoryWindowController.h @@ -7,11 +7,12 @@ // #import +#import "IJInventoryView.h" @class IJInventoryView; @class IJMinecraftLevel; -@interface IJInventoryWindowController : NSWindowController { +@interface IJInventoryWindowController : NSWindowController { IJMinecraftLevel *level; NSArray *inventory; diff --git a/IJInventoryWindowController.m b/IJInventoryWindowController.m index f0a82cb..801aa13 100644 --- a/IJInventoryWindowController.m +++ b/IJInventoryWindowController.m @@ -31,6 +31,9 @@ [inventoryView setRows:3 columns:9]; [quickView setRows:1 columns:9]; [armorView setRows:4 columns:1]; + inventoryView.delegate = self; + quickView.delegate = self; + armorView.delegate = self; } - (void)dealloc @@ -232,150 +235,59 @@ } #pragma mark - -#pragma mark Inventory Outline View +#pragma mark IJInventoryViewDelegate -- (id)outlineView:(NSOutlineView *)theOutlineView child:(NSInteger)index ofItem:(id)item +- (NSMutableArray *)itemArrayForInventoryView:(IJInventoryView *)theInventoryView slotOffset:(int*)slotOffset { - if (item == nil) + if (theInventoryView == inventoryView) { - return [rootItems objectAtIndex:index]; + *slotOffset = IJInventorySlotNormalFirst; + return inventoryItem; } - else + else if (theInventoryView == quickView) { - return [item objectAtIndex:index]; + *slotOffset = IJInventorySlotQuickFirst; + return quickItem; } - -} - -- (BOOL)outlineView:(NSOutlineView *)theOutlineView isItemExpandable:(id)item -{ - return item == nil || [rootItems containsObject:item]; -} - -- (NSInteger)outlineView:(NSOutlineView *)theOutlineView numberOfChildrenOfItem:(id)item -{ - if (item == nil) + else if (theInventoryView == armorView) { - return 3; + *slotOffset = IJInventorySlotArmorFirst; + return armorItem; } - else if ([rootItems containsObject:item]) - { - return [(NSArray *)item count]; - } - else - { - return 0; - } - -} - -- (id)outlineView:(NSOutlineView *)theOutlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item -{ - if ([rootItems containsObject:item]) - { - if ([tableColumn.identifier isEqual:@"slot"]) - { - if (item == armorItem) - return @"Armor"; - else if (item == quickItem) - return @"Quick Inventory"; - else if (item == inventoryItem) - return @"Inventory"; - } - else - { - return nil; - } - } - - IJInventoryItem *invItem = item; - - if ([tableColumn.identifier isEqual:@"slot"]) - { - return [NSString stringWithFormat:@"%d", invItem.slot]; - } - else if ([tableColumn.identifier isEqual:@"id"]) - { - if (invItem.itemId) - return [NSNumber numberWithShort:invItem.itemId]; - else - return nil; - } - else if ([tableColumn.identifier isEqual:@"item"]) - { - if (invItem.itemId) - return invItem.itemName; - else - return @""; - } - else if ([tableColumn.identifier isEqual:@"count"]) - { - if (invItem.count) - return [NSNumber numberWithUnsignedChar:invItem.count]; - else - return nil; - } - else if ([tableColumn.identifier isEqual:@"damage"]) - { - if (invItem.damage) - return [NSNumber numberWithShort:invItem.damage]; - else - return nil; - } - return nil; } -- (void)outlineView:(NSOutlineView *)theOutlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item +- (void)inventoryView:(IJInventoryView *)theInventoryView removeItemAtIndex:(int)itemIndex { - IJInventoryItem *invItem = item; - if ([tableColumn.identifier isEqual:@"id"]) + int slotOffset = 0; + NSMutableArray *itemArray = [self itemArrayForInventoryView:theInventoryView slotOffset:&slotOffset]; + + if (itemArray) { - invItem.itemId = [object shortValue]; - [self markDirty]; - } - else if ([tableColumn.identifier isEqual:@"count"]) - { - invItem.count = [object unsignedCharValue]; - if (invItem.count > 64) - invItem.count = 64; - [self markDirty]; - } - else if ([tableColumn.identifier isEqual:@"damage"]) - { - invItem.damage = [object shortValue]; - [self markDirty]; + IJInventoryItem *item = [IJInventoryItem emptyItemWithSlot:slotOffset + itemIndex]; + [itemArray replaceObjectAtIndex:itemIndex withObject:item]; + [theInventoryView setItems:itemArray]; } + [self markDirty]; } -- (BOOL)outlineView:(NSOutlineView *)theOutlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item +- (void)inventoryView:(IJInventoryView *)theInventoryView setItem:(IJInventoryItem *)item atIndex:(int)itemIndex { - if ([rootItems containsObject:item]) - return NO; - else if ([tableColumn.identifier isEqual:@"item"]) + int slotOffset = 0; + NSMutableArray *itemArray = [self itemArrayForInventoryView:theInventoryView slotOffset:&slotOffset]; + + if (itemArray) { - IJInventoryItem *invItem = item; - [[IJItemPickerWindowController sharedController] showPickerWithInitialItemId:invItem.itemId completionBlock:^(uint16_t itemId) { - invItem.itemId = itemId; - [outlineView reloadItem:item]; - [self markDirty]; - }]; - return NO; - } - else - { - return [tableColumn.identifier isEqual:@"slot"] == NO; + [itemArray replaceObjectAtIndex:itemIndex withObject:item]; + item.slot = slotOffset + itemIndex; + [theInventoryView setItems:itemArray]; } + [self markDirty]; } #pragma mark - -#pragma mark NSCollectionViewDelegate +#pragma mark Item Picker + -- (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pasteboard -{ - NSLog(@"%s", __PRETTY_FUNCTION__); - [pasteboard declareTypes:[NSArray arrayWithObjects:@"net.adampreble.insidejob.item", nil] owner:self]; - return YES; -} @end