-rowForView: early return if arg is not a CPView. Was causing an error when you click on table whose window was not frontmost.

Simplify -hitTest:, limit select-row behavior to left mouse events and extend to all data views accepting FR.
This commit is contained in:
cacaodev
2012-07-27 09:48:36 +02:00
parent 0faf38a1e1
commit c6ccf1d487
+6 -3
View File
@@ -1870,6 +1870,9 @@ NOT YET IMPLEMENTED
*/
- (CPInteger)rowOrColumn:(BOOL)rowOrColumn forView:(CPView)aView
{
if (![aView isKindOfClass:[CPView class]])
return -1;
var cellView = aView,
contentView = [[self window] contentView];
@@ -4821,10 +4824,10 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
{
var hit = [super hitTest:aPoint];
if (!hit || ![hit isKindOfClass:[CPTextField class]] || [self isRowSelected:[self rowForView:hit]])
return hit;
if ([[CPApp currentEvent] type] == CPLeftMouseDown && [hit acceptsFirstResponder] && ![self isRowSelected:[self rowForView:hit]])
return self;
return self;
return hit;
}
- (void)_startObservingFirstResponder