Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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
Add Comment
Please, Sign In to add comment