forked from pmougin/F-Script
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathFSObjectBrowserMatrix.m
115 lines (88 loc) · 3.2 KB
/
FSObjectBrowserMatrix.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// FSObjectBrowserMatrix.m Copyright (c) 2002-2009 Philippe Mougin.
// This software is open source. See the license.
#import <AppKit/AppKit.h>
#import "FSObjectBrowserMatrix.h"
@implementation FSObjectBrowserMatrix
/*- (id)initWithFrame:(NSRect)frameRect mode:(int)aMode cellClass:(Class)classId numberOfRows:(int)numRows numberOfColumns:(int)numColumns
{
NSLog(@"initWithFrameblabla:");
[super initWithFrame:frameRect mode:NSRadioModeMatrix cellClass:classId numberOfRows:numRows numberOfColumns:numColumns];
[self setMode:NSRadioModeMatrix];
return self;
}
- (id)initWithFrame:(NSRect)frameRect
{
NSLog(@"initWithFrame:");
[super initWithFrame:frameRect];
[self setMode:NSRadioModeMatrix];
return self;
} */
/*- (id)initWithFrame:(NSRect)frameRect mode:(int)aMode prototype:(NSCell *)aCell numberOfRows:(int)numRows numberOfColumns:(int)numColumns
{
NSLog(@"initWithFrameblabla2:");
[super initWithFrame:frameRect mode:NSListModeMatrix prototype:aCell numberOfRows:numRows numberOfColumns:numColumns];
[self setMode:NSListModeMatrix];
return self;
}
- (void)mouseMoved:(NSEvent *)theEvent
{
NSLog(@"moved");
}
- (void)mouseDragged:(NSEvent *)theEvent
{
NSSize dragOffset = NSMakeSize(0.0, 0.0);
NSPasteboard *pboard;
NSLog(@"dragged");
pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
[pboard declareTypes:[NSArray arrayWithObject:NSTIFFPboardType] owner:self];
[pboard setData:[[[NSBundle mainBundle] loadImageNamed:@"build.tiff"] TIFFRepresentation] forType:NSTIFFPboardType];
[self dragImage:[[NSBundle mainBundle] loadImageNamed:@"build.tiff"] at:[NSEvent mouseLocation] offset:dragOffset event:theEvent pasteboard:pboard source:self slideBack:YES];
[super mouseDragged:(NSEvent *)theEvent];
}
- (void)setMode:(NSMatrixMode)aMode
{
[super setMode:NSListModeMatrix];
}
- (NSMatrixMode)mode
{
return NSListModeMatrix;
}
- (void)mouseDown:(NSEvent *)theEvent
{
//NSSize dragOffset = NSMakeSize(0.0, 0.0);
//NSPasteboard *pboard;
NSLog(@"mouseDown:");
NSLog(@"mode=%d", [self mode]);
//pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
//[pboard declareTypes:[NSArray arrayWithObject:NSTIFFPboardType] owner:self];
//[pboard setData:[[[NSBundle mainBundle] loadImageNamed:@"build.tiff"] TIFFRepresentation] forType:NSTIFFPboardType];
//[self dragImage:[[NSBundle mainBundle] loadImageNamed:@"build.tiff"] at:[NSEvent mouseLocation] offset:dragOffset event:theEvent pasteboard:pboard source:self slideBack:YES];
[super mouseDown:(NSEvent *)theEvent];
}
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
{
if (isLocal) return NSDragOperationEvery;
else return NSDragOperationCopy;
}*/
+ (id)allocWithZone:(NSZone *)zone
{
id r = [super allocWithZone:zone];
//NSLog([NSString stringWithFormat:@"FSObjectBrowserMatrix %p allocWithZone:", r]);
return r;
}
- (id)retain
{
//NSLog([NSString stringWithFormat:@"FSObjectBrowserMatrix %p retain", self]);
return [super retain];
}
- (oneway void)release
{
//NSLog([NSString stringWithFormat:@"FSObjectBrowserMatrix %p release", self]);
[super release];
}
- (void) dealloc
{
//NSLog([NSString stringWithFormat:@"FSObjectBrowserMatrix %p dealloc", self]);
[super dealloc];
}
@end