mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-28 19:08:50 +00:00
Support level indicators as table cells through nib2cib.
This commit is contained in:
1 parent
71364c9b1a
commit
a6ee37e030
3 files changed
+28
-10
No files matched your search
@@ -1544,7 +1544,6 @@ NOT YET IMPLEMENTED
|
||||
_numberOfHiddenColumns += 1;
|
||||
_tableColumnRanges[index] = CPMakeRange(x, 0.0);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var width = [_tableColumns[index] width] + _intercellSpacing.width;
|
||||
@@ -1843,7 +1842,7 @@ NOT YET IMPLEMENTED
|
||||
leftInset = FLOOR(_intercellSpacing.width / 2.0),
|
||||
topInset = FLOOR(_intercellSpacing.height / 2.0);
|
||||
|
||||
return _CGRectMake(tableColumnRange.location + leftInset, _CGRectGetMinY(rectOfRow) + topInset, tableColumnRange.length - _intercellSpacing.width, _CGRectGetHeight(rectOfRow) - _intercellSpacing.height);
|
||||
return _CGRectMake(tableColumnRange.location + leftInset, _CGRectGetMinY(rectOfRow) + topInset, tableColumnRange.length - _intercellSpacing.width, _CGRectGetHeight(rectOfRow) - _intercellSpacing.height);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
{
|
||||
var cell = [aCoder decodeObjectForKey:@"NSCell"];
|
||||
|
||||
// Initialise before [super ...] to ensure setObjectValue constrains the values properly.
|
||||
_minValue = [cell minValue];
|
||||
_maxValue = [cell maxValue];
|
||||
|
||||
@@ -35,19 +36,32 @@
|
||||
|
||||
if (self)
|
||||
{
|
||||
_levelIndicatorStyle = [cell levelIndicatorStyle];
|
||||
_warningValue = [cell warningValue];
|
||||
_criticalValue = [cell criticalValue];
|
||||
_tickMarkPosition = [cell tickMarkPosition];
|
||||
_numberOfTickMarks = [cell numberOfTickMarks];
|
||||
_numberOfMajorTickMarks = [cell numberOfMajorTickMarks];
|
||||
|
||||
[self setEditable:[cell isEditable]];
|
||||
self = [self NS_initWithCell:cell];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/*!
|
||||
Intialise the receiver given a cell. This method is meant for reuse by controls which contain
|
||||
cells other than CPLevelIndicator itself.
|
||||
*/
|
||||
- (id)NS_initWithCell:(NSCell)cell
|
||||
{
|
||||
_minValue = [cell minValue];
|
||||
_maxValue = [cell maxValue];
|
||||
_levelIndicatorStyle = [cell levelIndicatorStyle];
|
||||
_warningValue = [cell warningValue];
|
||||
_criticalValue = [cell criticalValue];
|
||||
_tickMarkPosition = [cell tickMarkPosition];
|
||||
_numberOfTickMarks = [cell numberOfTickMarks];
|
||||
_numberOfMajorTickMarks = [cell numberOfMajorTickMarks];
|
||||
|
||||
[self setEditable:[cell isEditable]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSLevelIndicator : CPLevelIndicator
|
||||
|
||||
@@ -78,6 +78,11 @@
|
||||
_dataView = [[CPButton alloc] initWithFrame:CGRectMakeZero()];
|
||||
_dataView = [_dataView NS_initWithCell:dataViewCell];
|
||||
}
|
||||
else if ([dataViewCell isKindOfClass:[NSLevelIndicatorCell class]])
|
||||
{
|
||||
_dataView = [[CPLevelIndicator alloc] initWithFrame:CGRectMakeZero()];
|
||||
_dataView = [_dataView NS_initWithCell:dataViewCell];
|
||||
}
|
||||
|
||||
[_dataView setValue:[dataViewCell alignment] forThemeAttribute:@"alignment"];
|
||||
|
||||
|
||||
Reference in new issue
Block a user