Created
December 24, 2009 10:46
-
-
Save jfahrenkrug/263141 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation IconViewBox | |
// ------------------------------------------------------------------------------- | |
// hitTest:aPoint | |
// ------------------------------------------------------------------------------- | |
- (NSView *)hitTest:(NSPoint)aPoint | |
{ | |
// don't allow any mouse clicks for subviews in this view | |
if(NSPointInRect(aPoint,[self convertRect:[self bounds] toView:[self superview]])) { | |
return self; | |
} else { | |
return nil; | |
} | |
} | |
-(void)mouseDown:(NSEvent *)theEvent { | |
[super mouseDown:theEvent]; | |
// check for click count above one, which we assume means it's a double click | |
if([theEvent clickCount] > 1) { | |
NSLog(@"double click!"); | |
if(delegate && [delegate respondsToSelector:@selector(doubleClick:)]) { | |
[delegate performSelector:@selector(doubleClick:) withObject:self]; | |
} | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment