forked from jerrykrinock/ClassesObjC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSSTableView.m
52 lines (39 loc) · 1.12 KB
/
SSTableView.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
#import "SSTableView.h"
@interface NSObject ( ContextualMenuDelegate )
- (NSMenu*)menuForTableColumnIndex:(int)iCol rowIndex:(int)iRow ;
@end
@implementation SSTableView
//- (id)initWithFrame:(NSRect)frameRect
//{
// if ((self = [super initWithFrame:frameRect]) != nil)
// {
// // Add initialization code here
// }
// return self;
//}
//
//- (void)drawRect:(NSRect)rect
//{
// [super drawRect:rect] ;
//}
-(NSMenu*)menuForEvent:(NSEvent*)evt
{
NSMenu* output = nil ;
NSPoint point = [self convertPoint:[evt locationInWindow] fromView:nil] ;
int iCol = [self columnAtPoint:point];
int iRow = [self rowAtPoint:point];
if ( iCol >= 0
&& iRow >= 0
&& [[self delegate] respondsToSelector:@selector(menuForTableColumnIndex:rowIndex:)] ) {
output = [[self delegate] menuForTableColumnIndex:iCol rowIndex:iRow];
}
return output;
}
// ***** NSDraggingSource Methods (These must be here, in the subclass, not in its dataSource!) ***** //
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isIntraApp;
{
return isIntraApp
? (NSDragOperationCopy | NSDragOperationMove)
: NSDragOperationCopy ;
}
@end