ftp.nice.ch/pub/next/developer/apps/ClassEditor.0.4.NIHS.bsd.tar.gz#/ClassEditor.0.4.NIHS.bsd/Source/CECellMatrix.m

This is CECellMatrix.m in view mode; [Download] [Up]

/* 
 * CECellMatrix
 *
 */

#import "CECellMatrix.h"
#import "CEBrowserCell.h"

@implementation CECellMatrix

- mouseDown:(NXEvent *)theEvent
{
	id	theCell;
	int	row;
	int	col;
	
	NXPoint	theSpot;
	
	theSpot.x = (theEvent->location).x;
	theSpot.y = (theEvent->location).y;
	[self convertPoint:&theSpot fromView:nil];
	
	// It is IMPORTANT that we really use row and col here.
	// The matrix method has a BUG which would return a wrong
	// cell if we use only one int for both values.
	// It seams to use them internally to store the row/col infos!!
	
	theCell = [self getRow:&row andCol:&col forPoint:&theSpot];
	
	if( theCell != nil && 
		[theCell respondsTo:@selector(mouseDown:forView:)] )
		{
			if( [theCell mouseDown:theEvent forView:self] == nil ) 
				return self;
		}
	
	return [super mouseDown:theEvent];
}

- (BOOL)acceptsFirstResponder
{
	return YES;
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.