home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / ClassEditor.0.4 / Source / CECellMatrix.m < prev    next >
Encoding:
Text File  |  1995-06-04  |  871 b   |  46 lines

  1. /* 
  2.  * CECellMatrix
  3.  *
  4.  */
  5.  
  6. #import "CECellMatrix.h"
  7. #import "CEBrowserCell.h"
  8.  
  9. @implementation CECellMatrix
  10.  
  11. - mouseDown:(NXEvent *)theEvent
  12. {
  13.     id    theCell;
  14.     int    row;
  15.     int    col;
  16.     
  17.     NXPoint    theSpot;
  18.     
  19.     theSpot.x = (theEvent->location).x;
  20.     theSpot.y = (theEvent->location).y;
  21.     [self convertPoint:&theSpot fromView:nil];
  22.     
  23.     // It is IMPORTANT that we really use row and col here.
  24.     // The matrix method has a BUG which would return a wrong
  25.     // cell if we use only one int for both values.
  26.     // It seams to use them internally to store the row/col infos!!
  27.     
  28.     theCell = [self getRow:&row andCol:&col forPoint:&theSpot];
  29.     
  30.     if( theCell != nil && 
  31.         [theCell respondsTo:@selector(mouseDown:forView:)] )
  32.         {
  33.             if( [theCell mouseDown:theEvent forView:self] == nil ) 
  34.                 return self;
  35.         }
  36.     
  37.     return [super mouseDown:theEvent];
  38. }
  39.  
  40. - (BOOL)acceptsFirstResponder
  41. {
  42.     return YES;
  43. }
  44.  
  45. @end
  46.