Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding initial drag/drop methods

  • Loading branch information...
commit 4bf96afafab43da006bdc6f7f18094eabcc7cddc 1 parent 70a98ca
@markhuot authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 src/MHOpenFiles.m
View
26 src/MHOpenFiles.m
@@ -60,10 +60,13 @@ - (id)initForTabs:(id)theTabs
return self;
}
+#define MyPrivateTableViewDataType @"MyPrivateTableViewDataType"
+
- (void)setOutlineView:(NSOutlineView *)theOutlineView
{
outlineView = theOutlineView;
[outlineView setIndentationPerLevel:0.0];
+ [outlineView registerForDraggedTypes: [NSArray arrayWithObject:MyPrivateTableViewDataType]];
[outlineView expandItem:[outlineView itemAtRow:0]];
}
@@ -177,6 +180,29 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification
[tabView selectTabWithIdentifier:item];
}
+- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pasteboard
+{
+ //NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes];
+ [pasteboard declareTypes:[NSArray arrayWithObject:MyPrivateTableViewDataType] owner:self];
+ //[pboard setData:data forType:MyPrivateTableViewDataType];
+ return YES;
+}
+
+- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id<NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
+{
+ if ([item isEqualToString:@"WORKSPACE"])
+ {
+ return NSDragOperationMove;
+ }
+
+ return NSDragOperationNone;
+}
+
+- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id<NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index
+{
+ return YES;
+}
+
- (void)resizeViews
{
float neededHeight = ([outlineView numberOfRows] * [outlineView rowHeight]) + (6.0 * [outlineView numberOfRows]) + 2.0;
Please sign in to comment.
Something went wrong with that request. Please try again.