Fix for incorrectly sized header views

This commit is contained in:
Ross Boucher committed 2009-06-24 22:52:42 -07:00
1 parent e97b78477b
commit ac6c03f2c7
4 files changed
+27 -17

No files matched your search

+4 -3
View File
@@ -176,11 +176,12 @@
// [_verticalScroller setEnabled:NO];
// [_horizontalScroller setEnabled:NO];
}
[_contentView setFrame:[self clipViewFrame]];
[_headerClipView setFrame:[self headerClipViewFrame]];
--_recursionCount;
return;
}
+14 -10
View File
@@ -94,21 +94,25 @@
return bounds;
}
- (void)drawRect:(CGRect)aRect
- (void)layoutSubviews
{
var tableColumns = [_tableView tableColumns];
var count = [tableColumns count];
var columnRect = [self bounds];
var spacing = [_tableView intercellSpacing];
var tableColumns = [_tableView tableColumns],
count = [tableColumns count],
columnRect = [self bounds],
spacing = [_tableView intercellSpacing];
for (i = 0; i < count; ++i) {
var column = [tableColumns objectAtIndex:i];
var headerView = [column headerView] ;
for (i = 0; i < count; ++i)
{
var column = [tableColumns objectAtIndex:i],
headerView = [column headerView];
columnRect.size.width = [column width] + spacing.width;
// [headerView setHighlighted:[_tableView isColumnSelected:[[_tableView tableColumns] indexOfObject:column]]];
[headerView setFrame:columnRect];
columnRect.origin.x += [column width] + spacing.width;
[self addSubview:headerView] ;
[self addSubview:headerView];
}
}
+6 -1
View File
@@ -121,7 +121,6 @@ CPTableViewSelectionHighlightStyleSourceList = 1;
_rowHeight = 24.0;
_headerView = [[CPTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, [self bounds].size.width, _rowHeight)];
[_headerView setAutoresizingMask:CPViewWidthSizable];
[_headerView setTableView:self];
@@ -1117,6 +1116,12 @@ _cachedDataViews[dataView.identifier].push(dataView);
}
}
- (void)setFrameSize:(CGSize)aSize
{
[super setFrameSize:aSize];
[_headerView setFrameSize:CGSizeMake(aSize.width, [_headerView frame].size.height)];
}
- (void)layoutSubviews
{
[self load];
+3 -3
View File
@@ -48,15 +48,15 @@ CPLogRegister(CPLogConsole);
[[column headerView] setStringValue:"Number "+i];
[[column headerView] sizeToFit];
[column setWidth:[[column headerView] frame].size.width + 20];
//[column setWidth:[[column headerView] frame].size.width + 20];
//[column setWidth:200.0];
[column setWidth:170.0];
[column setDataView:textDataView];
[tableView addTableColumn:column];
}
var scrollView = [[CPScrollView alloc] initWithFrame:[view bounds]];
[scrollView setDocumentView:tableView];