* Source/NSOutlineView.m: Handle rowAtPoint: returning -1.

* Source/NSTableView.m (drawRect:): Only call
        -highlightSelectionInClipRect: and -drawGridInClipRect: once.
        (-drawGridInClipRect:): Constrain the vertical grid line to the last
	 row drawn in the rect.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24071 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ratmice 2006-11-10 19:12:32 +00:00
parent 8a63fd2e1d
commit 84a779733b
3 changed files with 14 additions and 25 deletions

View file

@ -1,3 +1,11 @@
2006-11-10 Matt Rice <ratmice@gmail.com>
* Source/NSOutlineView.m: Handle rowAtPoint: returning -1.
* Source/NSTableView.m (drawRect:): Only call
-highlightSelectionInClipRect: and -drawGridInClipRect: once.
(-drawGridInClipRect:): Constrain the vertical grid line to the last row
drawn in the rect.
2006-11-10 Matt Rice <ratmice@gmail.com> 2006-11-10 Matt Rice <ratmice@gmail.com>
* Source/NSTableView.m (rowAtPoint:): Return -1 if the point is under * Source/NSTableView.m (rowAtPoint:): Return -1 if the point is under

View file

@ -832,7 +832,8 @@ static NSImage *unexpandable = nil;
_clickedRow = [self rowAtPoint: location]; _clickedRow = [self rowAtPoint: location];
_clickedColumn = [self columnAtPoint: location]; _clickedColumn = [self columnAtPoint: location];
if ([_tableColumns objectAtIndex: _clickedColumn] == _outlineTableColumn) if (_clickedRow != -1
&& [_tableColumns objectAtIndex: _clickedColumn] == _outlineTableColumn)
{ {
NSImage *image; NSImage *image;

View file

@ -4964,6 +4964,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
if (_numberOfColumns > 0) if (_numberOfColumns > 0)
{ {
int lastRowPosition = position - _rowHeight;
/* Draw vertical lines */ /* Draw vertical lines */
if (startingColumn == -1) if (startingColumn == -1)
startingColumn = 0; startingColumn = 0;
@ -4973,7 +4974,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
for (i = startingColumn; i <= endingColumn; i++) for (i = startingColumn; i <= endingColumn; i++)
{ {
DPSmoveto (ctxt, _columnOrigins[i], minY); DPSmoveto (ctxt, _columnOrigins[i], minY);
DPSlineto (ctxt, _columnOrigins[i], maxY); DPSlineto (ctxt, _columnOrigins[i], lastRowPosition);
DPSstroke (ctxt); DPSstroke (ctxt);
} }
position = _columnOrigins[endingColumn]; position = _columnOrigins[endingColumn];
@ -4982,7 +4983,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
if (endingColumn == (_numberOfColumns - 1)) if (endingColumn == (_numberOfColumns - 1))
position -= 1; position -= 1;
DPSmoveto (ctxt, position, minY); DPSmoveto (ctxt, position, minY);
DPSlineto (ctxt, position, maxY); DPSlineto (ctxt, position, lastRowPosition);
DPSstroke (ctxt); DPSstroke (ctxt);
} }
@ -5072,7 +5073,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
} }
/* Draw selection */ /* Draw selection */
// [self highlightSelectionInClipRect: aRect]; [self highlightSelectionInClipRect: aRect];
/* Draw grid */ /* Draw grid */
if (_drawsGrid) if (_drawsGrid)
@ -5098,31 +5099,10 @@ static BOOL selectContiguousRegion(NSTableView *self,
SEL sel = @selector(drawRow:clipRect:); SEL sel = @selector(drawRow:clipRect:);
IMP imp = [self methodForSelector: sel]; IMP imp = [self methodForSelector: sel];
NSRect localBackground;
localBackground = aRect;
localBackground.size.height = _rowHeight;
localBackground.origin.y = _bounds.origin.y + (_rowHeight * startingRow);
for (i = startingRow; i <= endingRow; i++) for (i = startingRow; i <= endingRow; i++)
{ {
[_backgroundColor set];
NSRectFill (localBackground);
[self highlightSelectionInClipRect: localBackground];
if (_drawsGrid)
{
[self drawGridInClipRect: localBackground];
}
localBackground.origin.y += _rowHeight;
(*imp)(self, sel, i, aRect); (*imp)(self, sel, i, aRect);
} }
if (NSMaxY(aRect) > NSMaxY(localBackground) - _rowHeight)
{
[_backgroundColor set];
localBackground.size.height =
aRect.size.height - aRect.origin.y + localBackground.origin.y;
NSRectFill (localBackground);
}
} }
} }