tableview fixes

This commit is contained in:
Randy authored and Francisco Ryan Tolmasky I committed 2009-08-21 20:03:26 -07:00
1 parent 8a1c1b931f
commit 58aef6ef74
3 files changed
+278 -28

No files matched your search

+34 -1
View File
@@ -89,7 +89,9 @@
bounds.size.width = [tableColumns[aColumnIndex] width] + tableSpacing.width;
while (--aColumnIndex >= 0)
{
bounds.origin.x += [tableColumns[aColumnIndex] width] + tableSpacing.width;
}
return bounds;
}
@@ -106,7 +108,7 @@
var column = [tableColumns objectAtIndex:i],
headerView = [column headerView];
columnRect.size.width = [column width] + spacing.width;
columnRect.size.width = [column width] + spacing.width;
[headerView setFrame:columnRect];
@@ -116,4 +118,35 @@
}
}
- (void)drawRect:(CGRect)aRect
{
[_tableView sizeLastColumnToFit];
[[_tableView gridColor] setStroke];
if ([_tableView gridStyleMask] & CPTableViewSolidVerticalGridLineMask)
{
var context = [[CPGraphicsContext currentContext] graphicsPort];
var exposedColumnIndexes = exposedColumnIndexes = [_tableView columnIndexesInRect:aRect],
columnsArray = [];
[exposedColumnIndexes getIndexes:columnsArray maxCount:-1 inIndexRange:nil]; //may have to set inIndexRange: to a range if nil doesn't work after compilation.
var columnArrayIndex = 0,
columnArrayCount = columnsArray.length;
for(; columnArrayIndex < columnArrayCount; ++columnArrayIndex)
{
// grab each column rect and add horizontal lines
var columnToStroke = [self headerRectOfColumn:columnArrayIndex];
CGContextBeginPath(context);
CGContextMoveToPoint(context, ROUND(columnToStroke.origin.x + columnToStroke.size.width) - 0.5, ROUND(columnToStroke.origin.y) - 0.5);
CGContextAddLineToPoint(context, ROUND(columnToStroke.origin.x + columnToStroke.size.width) - 0.5, ROUND(columnToStroke.origin.y + columnToStroke.size.height) - 0.5);
CGContextSetLineWidth(context, 1);
CGContextStrokePath(context);
}
}
}
@end