mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-12 11:37:07 +00:00
Merge branch 'master' of git://github.com/280north/cappuccino into imports
Conflicts: Foundation/CPDecimalNumber.j Foundation/CPPredicate/CPComparisonPredicate.j Foundation/CPPredicate/CPCompoundPredicate.j Foundation/CPPredicate/CPExpression.j Foundation/CPPredicate/CPExpression_aggregate.j Foundation/CPPredicate/CPExpression_constant.j Foundation/CPPredicate/CPExpression_function.j Foundation/CPPredicate/CPExpression_keypath.j Foundation/CPPredicate/CPExpression_self.j Foundation/CPPredicate/CPExpression_set.j Foundation/CPPredicate/CPExpression_subquery.j Foundation/CPPredicate/CPExpression_variable.j Foundation/CPPredicate/CPPredicate.j
This commit is contained in:
commit
37323b811c
35 files changed
+4898
-349
No files matched your search
+24
-1
@@ -515,7 +515,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
|
||||
|
||||
/*!
|
||||
Sets the table column you want to display the disclosure button in.
|
||||
|
||||
If you do not want an outline column pass nil.
|
||||
@param aTableColumn - The CPTableColumn you want to use for hierarchical data.
|
||||
*/
|
||||
- (void)setOutlineTableColumn:(CPTableColumn)aTableColumn
|
||||
@@ -954,6 +954,29 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
|
||||
[self reloadItem:nil reloadChildren:YES];
|
||||
}
|
||||
|
||||
/*!
|
||||
Adds a new table column to the reciever. If this is the first column added it will automatically be set to the outline column.
|
||||
Also see -setOutlineTableColumn:
|
||||
NOTE: This behavior deviates from cocoa slightly.
|
||||
@param CPTableColumn aTableColumn - The table column to add.
|
||||
*/
|
||||
- (void)addTableColumn:(CPTableColumn)aTableColumn
|
||||
{
|
||||
[super addTableColumn:aTableColumn];
|
||||
|
||||
if ([self numberOfColumns] === 1)
|
||||
_outlineTableColumn = aTableColumn;
|
||||
}
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)removeTableColumn:(CPTableColumn)aTableColumn
|
||||
{
|
||||
if (aTableColumn === [self outlineTableColumn])
|
||||
CPLog("CPOutlineView cannot remove outlineTableColumn with removeTableColumn:. User setOutlineTableColumn: instead.");
|
||||
else
|
||||
[super removeTableColumn:aTableColumn];
|
||||
}
|
||||
/*!
|
||||
@ignore
|
||||
We overide this because we need a special behaviour for the outline column
|
||||
|
||||
@@ -1933,6 +1933,13 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// now that we've reached the end we know there are likely rounding errors
|
||||
// so we should size the last resized to fit
|
||||
var delta = superviewWidth - _CGRectGetMaxX([self rectOfColumn:[self numberOfColumns] - 1]),
|
||||
newSize = [item width] + delta;
|
||||
|
||||
[item _tryToResizeToWidth:newSize];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
+29
-5
@@ -486,11 +486,15 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
#if PLATFORM(DOM)
|
||||
|
||||
var string = [self stringValue],
|
||||
element = [self _inputElement];
|
||||
element = [self _inputElement],
|
||||
font = [self currentValueForThemeAttribute:@"font"];
|
||||
|
||||
// generate the font metric
|
||||
[font _getMetrics];
|
||||
|
||||
element.value = string;
|
||||
element.style.color = [[self currentValueForThemeAttribute:@"text-color"] cssString];
|
||||
element.style.font = [[self currentValueForThemeAttribute:@"font"] cssString];
|
||||
element.style.font = [font cssString];
|
||||
element.style.zIndex = 1000;
|
||||
|
||||
switch ([self alignment])
|
||||
@@ -502,12 +506,32 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
default: element.style.textAlign = "left";
|
||||
}
|
||||
|
||||
var contentRect = [self contentRectForBounds:[self bounds]];
|
||||
var contentRect = [self contentRectForBounds:[self bounds]],
|
||||
verticalAlign = [self currentValueForThemeAttribute:"vertical-alignment"];
|
||||
|
||||
element.style.top = _CGRectGetMinY(contentRect) + "px";
|
||||
switch(verticalAlign)
|
||||
{
|
||||
case CPTopVerticalTextAlignment:
|
||||
var topPoint = (_CGRectGetMinY(contentRect) + 1) + "px"; // for the same reason we have a -1 for the left, we also have a + 1 here
|
||||
break;
|
||||
|
||||
case CPCenterVerticalTextAlignment:
|
||||
var topPoint = (_CGRectGetMidY(contentRect) - (font._lineHeight / 2) + 1) + "px";
|
||||
break;
|
||||
|
||||
case CPBottomVerticalTextAlignment:
|
||||
var topPoint = (_CGRectGetMaxY(contentRect) - font._lineHeight) + "px";
|
||||
break;
|
||||
|
||||
default:
|
||||
var topPoint = (_CGRectGetMinY(contentRect) + 1) + "px";
|
||||
break;
|
||||
}
|
||||
|
||||
element.style.top = topPoint;
|
||||
element.style.left = (_CGRectGetMinX(contentRect) - 1) + "px"; // why -1?
|
||||
element.style.width = _CGRectGetWidth(contentRect) + "px";
|
||||
element.style.height = _CGRectGetHeight(contentRect) + "px";
|
||||
element.style.height = font._lineHeight + "px"; // private ivar for the line height of the DOM text at this particaulr size
|
||||
|
||||
_DOMElement.appendChild(element);
|
||||
|
||||
|
||||
@@ -804,6 +804,7 @@ var themedButtonValues = nil,
|
||||
// Global for reuse by CPTokenField.
|
||||
themedTextFieldValues =
|
||||
[
|
||||
[@"vertical-alignment", CPTopVerticalTextAlignment, CPThemeStateBezeled],
|
||||
[@"bezel-color", bezelColor, CPThemeStateBezeled],
|
||||
[@"bezel-color", bezelFocusedColor, CPThemeStateBezeled | CPThemeStateEditing],
|
||||
[@"bezel-color", bezelDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
|
||||
|
||||
+93
-64
@@ -102,7 +102,7 @@ CPDecimal format:
|
||||
function CPDecimalMakeWithString(string, locale)
|
||||
{
|
||||
if (!string)
|
||||
return CPDecimalMakeZero();
|
||||
return CPDecimalMakeNaN();
|
||||
|
||||
// Regexp solution as found in JSON spec, with working regexp (I added groupings)
|
||||
// Test here: http://www.regexplanet.com/simple/index.html
|
||||
@@ -116,7 +116,7 @@ function CPDecimalMakeWithString(string, locale)
|
||||
// If yes simply add '?' after integer part group, ie ([+\-]?)((?:0|[1-9]\d*)?)
|
||||
var matches = string.match(/^([+\-]?)((?:0|[1-9]\d*))(?:\.(\d*))?(?:[eE]([+\-]?)(\d+))?$/);
|
||||
if (!matches)
|
||||
return nil;
|
||||
return CPDecimalMakeNaN();
|
||||
|
||||
var ds = matches[1],
|
||||
intpart = matches[2],
|
||||
@@ -143,23 +143,23 @@ function CPDecimalMakeWithString(string, locale)
|
||||
}
|
||||
|
||||
if (exponent > CPDecimalMaxExponent || exponent < CPDecimalMinExponent)
|
||||
return nil;
|
||||
return CPDecimalMakeNaN();
|
||||
|
||||
// Representation internally starts at most significant digit
|
||||
var m = [CPArray array],
|
||||
var m = [],
|
||||
i = 0;
|
||||
for (; i < (intpart?intpart.length:0); i++)
|
||||
{
|
||||
if (i >= CPDecimalMaxDigits)
|
||||
break; // truncate
|
||||
[m addObject:parseInt(intpart.charAt(i))];
|
||||
Array.prototype.push.call(m, parseInt(intpart.charAt(i)));
|
||||
}
|
||||
var j = 0;
|
||||
for (; j < (decpart?decpart.length:0); j++)
|
||||
{
|
||||
if ((i + j) >= CPDecimalMaxDigits)
|
||||
break; // truncate
|
||||
[m addObject:parseInt(decpart.charAt(j))];
|
||||
Array.prototype.push.call(m, parseInt(decpart.charAt(j)));
|
||||
}
|
||||
|
||||
var dcm = {_exponent:exponent, _isNegative:isNegative, _isCompact:NO, _isNaN:NO, _mantissa:m};
|
||||
@@ -177,7 +177,7 @@ function CPDecimalMakeWithString(string, locale)
|
||||
*/
|
||||
function CPDecimalMakeWithParts(mantissa, exponent)
|
||||
{
|
||||
var m = [CPArray array],
|
||||
var m = [],
|
||||
isNegative = NO;
|
||||
|
||||
if (mantissa < 0 )
|
||||
@@ -187,15 +187,15 @@ function CPDecimalMakeWithParts(mantissa, exponent)
|
||||
}
|
||||
|
||||
if (mantissa == 0)
|
||||
[m addObject: 0];
|
||||
Array.prototype.push.call(m, 0);
|
||||
|
||||
if (exponent > CPDecimalMaxExponent || exponent < CPDecimalMinExponent)
|
||||
return nil;
|
||||
return CPDecimalMakeNaN();
|
||||
|
||||
// remaining digits are disposed of via truncation
|
||||
while ((mantissa > 0) && ([m count] < CPDecimalMaxDigits)) // count selector here could be optimised away
|
||||
while ((mantissa > 0) && (m.length < CPDecimalMaxDigits)) // count selector here could be optimised away
|
||||
{
|
||||
[m insertObject:parseInt(mantissa % 10) atIndex:0];
|
||||
Array.prototype.unshift.call(m, parseInt(mantissa % 10));
|
||||
mantissa = FLOOR(mantissa / 10);
|
||||
}
|
||||
|
||||
@@ -239,6 +239,27 @@ function CPDecimalMakeNaN()
|
||||
return d;
|
||||
}
|
||||
|
||||
// private methods
|
||||
function _CPDecimalMakeMaximum()
|
||||
{
|
||||
var s = @"",
|
||||
i = 0;
|
||||
for (; i < CPDecimalMaxDigits; i++)
|
||||
s += "9";
|
||||
s += "e" + CPDecimalMaxExponent;
|
||||
return CPDecimalMakeWithString(s);
|
||||
}
|
||||
|
||||
function _CPDecimalMakeMinimum()
|
||||
{
|
||||
var s = @"-",
|
||||
i = 0;
|
||||
for (; i < CPDecimalMaxDigits; i++)
|
||||
s += "9";
|
||||
s += "e" + CPDecimalMaxExponent;
|
||||
return CPDecimalMakeWithString(s);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ingroup foundation
|
||||
Checks to see if a CPDecimal is zero. Can handle uncompacted strings.
|
||||
@@ -270,7 +291,7 @@ function CPDecimalIsOne(dcm)
|
||||
// exponent doesnt matter as long as mantissa = 0
|
||||
if (!dcm._isNaN)
|
||||
{
|
||||
if (dcm._mantissa && ([dcm._mantissa count] == 1) && (dcm._mantissa[0] == 1))
|
||||
if (dcm._mantissa && (dcm._mantissa.length == 1) && (dcm._mantissa[0] == 1))
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
@@ -284,12 +305,12 @@ function _CPDecimalSet(t,s)
|
||||
t._isNegative = s._isNegative;
|
||||
t._isCompact = s._isCompact;
|
||||
t._isNaN = s._isNaN;
|
||||
t._mantissa = [s._mantissa copy];
|
||||
t._mantissa = Array.prototype.slice.call(s._mantissa, 0);
|
||||
}
|
||||
|
||||
function _CPDecimalSetZero(result)
|
||||
{
|
||||
result._mantissa = [CPArray arrayWithObject:0];
|
||||
result._mantissa = [0];
|
||||
result._exponent = 0;
|
||||
result._isNegative = NO;
|
||||
result._isCompact = YES;
|
||||
@@ -298,7 +319,7 @@ function _CPDecimalSetZero(result)
|
||||
|
||||
function _CPDecimalSetOne(result)
|
||||
{
|
||||
result._mantissa = [CPArray arrayWithObject:1];
|
||||
result._mantissa = [1];
|
||||
result._exponent = 0;
|
||||
result._isNegative = NO;
|
||||
result._isCompact = YES;
|
||||
@@ -327,7 +348,7 @@ function CPDecimalCopy(dcm)
|
||||
_isNegative:dcm._isNegative,
|
||||
_isCompact:dcm._isCompact,
|
||||
_isNaN:dcm._isNaN,
|
||||
_mantissa:[dcm._mantissa copy]
|
||||
_mantissa:Array.prototype.slice.call(dcm._mantissa, 0)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -341,6 +362,9 @@ function CPDecimalCopy(dcm)
|
||||
*/
|
||||
function CPDecimalCompare(leftOperand, rightOperand)
|
||||
{
|
||||
if (leftOperand._isNaN && rightOperand._isNaN)
|
||||
return CPOrderedSame;
|
||||
|
||||
if (leftOperand._isNegative != rightOperand._isNegative)
|
||||
{
|
||||
if (rightOperand._isNegative)
|
||||
@@ -349,8 +373,8 @@ function CPDecimalCompare(leftOperand, rightOperand)
|
||||
return CPOrderedAscending;
|
||||
}
|
||||
|
||||
var s1 = leftOperand._exponent + [leftOperand._mantissa count],
|
||||
s2 = rightOperand._exponent + [rightOperand._mantissa count];
|
||||
var s1 = leftOperand._exponent + leftOperand._mantissa.length,
|
||||
s2 = rightOperand._exponent + rightOperand._mantissa.length;
|
||||
|
||||
// Sign is the same, quick check size (length + exp)
|
||||
if (s1 < s2)
|
||||
@@ -369,7 +393,7 @@ function CPDecimalCompare(leftOperand, rightOperand)
|
||||
}
|
||||
|
||||
// Same size, so check mantissa
|
||||
var l = MIN([leftOperand._mantissa count], [rightOperand._mantissa count]),
|
||||
var l = MIN(leftOperand._mantissa.length, rightOperand._mantissa.length),
|
||||
i = 0;
|
||||
|
||||
for (; i < l; i++)
|
||||
@@ -393,14 +417,14 @@ function CPDecimalCompare(leftOperand, rightOperand)
|
||||
}
|
||||
|
||||
// Same digits, check length
|
||||
if ([leftOperand._mantissa count] > [rightOperand._mantissa count])
|
||||
if (leftOperand._mantissa.length > rightOperand._mantissa.length)
|
||||
{
|
||||
if (rightOperand._isNegative)
|
||||
return CPOrderedAscending;
|
||||
else
|
||||
return CPOrderedDescending;
|
||||
}
|
||||
if ([leftOperand._mantissa count] < [rightOperand._mantissa count])
|
||||
if (leftOperand._mantissa.length < rightOperand._mantissa.length)
|
||||
{
|
||||
if (rightOperand._isNegative)
|
||||
return CPOrderedDescending;
|
||||
@@ -420,8 +444,8 @@ function _SimpleAdd(result, leftOperand, rightOperand, roundingMode, longMode)
|
||||
|
||||
_CPDecimalSet(result, leftOperand);
|
||||
|
||||
var j = [leftOperand._mantissa count] - [rightOperand._mantissa count],
|
||||
l = [rightOperand._mantissa count],
|
||||
var j = leftOperand._mantissa.length - rightOperand._mantissa.length,
|
||||
l = rightOperand._mantissa.length,
|
||||
i = l - 1,
|
||||
carry = 0,
|
||||
error = CPCalculationNoError;
|
||||
@@ -443,7 +467,7 @@ function _SimpleAdd(result, leftOperand, rightOperand, roundingMode, longMode)
|
||||
|
||||
if (carry)
|
||||
{
|
||||
for (i = j-1; i >= 0; i--)
|
||||
for (i = j - 1; i >= 0; i--)
|
||||
{
|
||||
if (result._mantissa[i] != 9)
|
||||
{
|
||||
@@ -456,13 +480,13 @@ function _SimpleAdd(result, leftOperand, rightOperand, roundingMode, longMode)
|
||||
|
||||
if (carry)
|
||||
{
|
||||
[result._mantissa insertObject:1 atIndex:0];
|
||||
Array.prototype.splice.call(result._mantissa, 0, 0, 1);
|
||||
|
||||
// The number must be shifted to the right
|
||||
if ((CPDecimalMaxDigits * factor) == [leftOperand._mantissa count])
|
||||
if ((CPDecimalMaxDigits * factor) == leftOperand._mantissa.length)
|
||||
{
|
||||
var scale = - result._exponent - 1;
|
||||
CPDecimalRound(result, result,scale,roundingMode);
|
||||
CPDecimalRound(result, result, scale, roundingMode);
|
||||
}
|
||||
|
||||
if (CPDecimalMaxExponent < result._exponent)
|
||||
@@ -526,8 +550,8 @@ function CPDecimalAdd(result, leftOperand, rightOperand, roundingMode, longMode)
|
||||
|
||||
// below is equiv of simple compare
|
||||
var comp = 0,
|
||||
ll = [n1._mantissa count],
|
||||
lr = [n2._mantissa count];
|
||||
ll = n1._mantissa.length,
|
||||
lr = n2._mantissa.length;
|
||||
if (ll == lr)
|
||||
comp = CPOrderedSame;
|
||||
else if (ll > lr)
|
||||
@@ -581,8 +605,8 @@ function _SimpleSubtract(result, leftOperand, rightOperand, roundingMode)
|
||||
{
|
||||
var error = CPCalculationNoError,
|
||||
borrow = 0,
|
||||
l = [rightOperand._mantissa count],
|
||||
j = [leftOperand._mantissa count] - l,
|
||||
l = rightOperand._mantissa.length,
|
||||
j = leftOperand._mantissa.length - l,
|
||||
i = l - 1;
|
||||
|
||||
_CPDecimalSet(result, leftOperand);
|
||||
@@ -604,7 +628,7 @@ function _SimpleSubtract(result, leftOperand, rightOperand, roundingMode)
|
||||
|
||||
if (borrow)
|
||||
{
|
||||
for (i = j-1; i >= 0; i--)
|
||||
for (i = j - 1; i >= 0; i--)
|
||||
{
|
||||
if (result._mantissa[i] != 0)
|
||||
{
|
||||
@@ -735,10 +759,10 @@ function _SimpleDivide(result, leftOperand, rightOperand, roundingMode)
|
||||
|
||||
_CPDecimalSetZero(result);
|
||||
|
||||
n1._mantissa = [CPArray array];
|
||||
n1._mantissa = [];
|
||||
|
||||
while ((k < [leftOperand._mantissa count]) || ([n1._mantissa count]
|
||||
&& !(([n1._mantissa count] == 1) && (n1._mantissa[0] == 0))))
|
||||
while ((k < leftOperand._mantissa.length) || (n1._mantissa.length
|
||||
&& !((n1._mantissa.length == 1) && (n1._mantissa[0] == 0))))
|
||||
{
|
||||
while (CPOrderedAscending == CPDecimalCompare(n1, rightOperand))
|
||||
{
|
||||
@@ -747,19 +771,19 @@ function _SimpleDivide(result, leftOperand, rightOperand, roundingMode)
|
||||
if (n1._exponent)
|
||||
{
|
||||
// Put back zeros removed by compacting
|
||||
[n1._mantissa addObject:0];
|
||||
Array.prototype.push.call(n1._mantissa, 0);
|
||||
n1._exponent--;
|
||||
n1._isCompact = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (used < [leftOperand._mantissa count])
|
||||
if (used < leftOperand._mantissa.length)
|
||||
{
|
||||
// Fill up with own digits
|
||||
if ([n1._mantissa count] || leftOperand._mantissa[used])
|
||||
if (n1._mantissa.length || leftOperand._mantissa[used])
|
||||
{
|
||||
// only add 0 if there is already something
|
||||
[n1._mantissa addObject:(leftOperand._mantissa[used])];
|
||||
Array.prototype.push.call(n1._mantissa, (leftOperand._mantissa[used]));
|
||||
n1._isCompact = NO;
|
||||
}
|
||||
used++;
|
||||
@@ -773,7 +797,7 @@ function _SimpleDivide(result, leftOperand, rightOperand, roundingMode)
|
||||
break;
|
||||
}
|
||||
// Borrow one digit
|
||||
[n1._mantissa addObject:0];
|
||||
Array.prototype.push.call(n1._mantissa, 0);
|
||||
result._exponent--;
|
||||
}
|
||||
|
||||
@@ -898,11 +922,11 @@ function _SimpleMultiply(result, leftOperand, rightOperand, roundingMode, powerM
|
||||
|
||||
// Do every digit of the second number
|
||||
var i = 0;
|
||||
for (; i < [rightOperand._mantissa count]; i++)
|
||||
for (; i < rightOperand._mantissa.length; i++)
|
||||
{
|
||||
_CPDecimalSetZero(n);
|
||||
|
||||
n._exponent = [rightOperand._mantissa count] - i - 1;
|
||||
n._exponent = rightOperand._mantissa.length - i - 1;
|
||||
carry = 0;
|
||||
d = rightOperand._mantissa[i];
|
||||
|
||||
@@ -910,7 +934,7 @@ function _SimpleMultiply(result, leftOperand, rightOperand, roundingMode, powerM
|
||||
continue;
|
||||
|
||||
var j = 0;
|
||||
for (j = [leftOperand._mantissa count]-1; j >= 0; j--)
|
||||
for (j = leftOperand._mantissa.length - 1; j >= 0; j--)
|
||||
{
|
||||
e = leftOperand._mantissa[j] * d + carry;
|
||||
if (e >= 10)
|
||||
@@ -943,11 +967,11 @@ function _SimpleMultiply(result, leftOperand, rightOperand, roundingMode, powerM
|
||||
result._exponent += exp;
|
||||
|
||||
// perform round to CPDecimalMaxDigits
|
||||
if ([result._mantissa count] > CPDecimalMaxDigits && !powerMode)
|
||||
if (result._mantissa.length > CPDecimalMaxDigits && !powerMode)
|
||||
{
|
||||
result._isCompact = NO;
|
||||
var scale = CPDecimalMaxDigits - ([result._mantissa count] + result._exponent);
|
||||
CPDecimalRound(result, result, scale ,roundingMode); // calls compact
|
||||
var scale = CPDecimalMaxDigits - (result._mantissa.length + result._exponent);
|
||||
CPDecimalRound(result, result, scale, roundingMode); // calls compact
|
||||
|
||||
error = CPCalculationLossOfPrecision;
|
||||
}
|
||||
@@ -1003,8 +1027,8 @@ function CPDecimalMultiply(result, leftOperand, rightOperand, roundingMode, powe
|
||||
|
||||
// below is equiv of simple compare
|
||||
var comp = 0,
|
||||
ll = [n1._mantissa count],
|
||||
lr = [n2._mantissa count];
|
||||
ll = n1._mantissa.length,
|
||||
lr = n2._mantissa.length;
|
||||
if (ll == lr)
|
||||
comp = CPOrderedSame;
|
||||
else if (ll > lr)
|
||||
@@ -1159,8 +1183,8 @@ function CPDecimalNormalize(dcm1, dcm2, roundingMode, longMode)
|
||||
e2 = dcm2._exponent;
|
||||
|
||||
// Add zeros
|
||||
var l2 = [dcm2._mantissa count],
|
||||
l1 = [dcm1._mantissa count],
|
||||
var l2 = dcm2._mantissa.length,
|
||||
l1 = dcm1._mantissa.length,
|
||||
l = 0;
|
||||
|
||||
var e = 0;
|
||||
@@ -1178,16 +1202,16 @@ function CPDecimalNormalize(dcm1, dcm2, roundingMode, longMode)
|
||||
e = e1 - e2;
|
||||
|
||||
if (e2 > e1)
|
||||
l = MIN((CPDecimalMaxDigits*factor) - l2, e); //(e2 - e1));
|
||||
l = MIN((CPDecimalMaxDigits * factor) - l2, e); //(e2 - e1));
|
||||
else
|
||||
l = MIN((CPDecimalMaxDigits*factor) - l1, e); //(e1 - e2));
|
||||
l = MIN((CPDecimalMaxDigits * factor) - l1, e); //(e1 - e2));
|
||||
|
||||
for (var i = 0; i < l; i++)
|
||||
{
|
||||
if (e2 > e1)
|
||||
[dcm2._mantissa addObject:0]; //dcm2._mantissa[i + l2] = 0;
|
||||
Array.prototype.push.call(dcm2._mantissa, 0); //dcm2._mantissa[i + l2] = 0;
|
||||
else
|
||||
[dcm1._mantissa addObject:0];
|
||||
Array.prototype.push.call(dcm1._mantissa, 0);
|
||||
}
|
||||
if (e2 > e1)
|
||||
{
|
||||
@@ -1222,7 +1246,7 @@ function CPDecimalNormalize(dcm1, dcm2, roundingMode, longMode)
|
||||
// Some zeros where cut of again by compacting
|
||||
if (e2 > e1)
|
||||
{
|
||||
l1 = [dcm1._mantissa count];
|
||||
l1 = dcm1._mantissa.length;
|
||||
l = MIN((CPDecimalMaxDigits * factor) - l1, ABS(dcm1._exponent - dcm2._exponent));
|
||||
for (var i = 0; i < l; i++)
|
||||
{
|
||||
@@ -1233,7 +1257,7 @@ function CPDecimalNormalize(dcm1, dcm2, roundingMode, longMode)
|
||||
}
|
||||
else
|
||||
{
|
||||
l2 = [dcm2._mantissa count];
|
||||
l2 = dcm2._mantissa.length;
|
||||
l = MIN((CPDecimalMaxDigits * factor) - l2, ABS(dcm2._exponent - dcm1._exponent));
|
||||
for (var i = 0; i < l; i++)
|
||||
{
|
||||
@@ -1277,7 +1301,7 @@ function CPDecimalRound(result, dcm, scale ,roundingMode)
|
||||
|
||||
_CPDecimalSet(result,dcm);
|
||||
|
||||
var mc = [result._mantissa count],
|
||||
var mc = result._mantissa.length,
|
||||
l = mc + scale + result._exponent;
|
||||
|
||||
if (mc <= l)
|
||||
@@ -1326,7 +1350,7 @@ function CPDecimalRound(result, dcm, scale ,roundingMode)
|
||||
break;
|
||||
}
|
||||
// cut mantissa
|
||||
result._mantissa = [result._mantissa subarrayWithRange:CPMakeRange(0, l)];
|
||||
result._mantissa = Array.prototype.slice.call(result._mantissa, 0, l);
|
||||
|
||||
if (up)
|
||||
{
|
||||
@@ -1349,7 +1373,7 @@ function CPDecimalRound(result, dcm, scale ,roundingMode)
|
||||
// Overflow in rounding.
|
||||
// Add one zero add the end. There must be space as
|
||||
// we just cut off some digits.
|
||||
[result._mantissa addObject:0];
|
||||
Array.prototype.push.call(result._mantissa, 0);
|
||||
}
|
||||
else
|
||||
result._exponent++;
|
||||
@@ -1368,7 +1392,7 @@ function CPDecimalRound(result, dcm, scale ,roundingMode)
|
||||
function CPDecimalCompact(dcm)
|
||||
{
|
||||
// if positive or zero exp leading zeros simply delete, trailing ones u need to increment exponent
|
||||
if (!dcm || [dcm._mantissa count] == 0 || CPDecimalIsNotANumber(dcm) )
|
||||
if (!dcm || dcm._mantissa.length == 0 || CPDecimalIsNotANumber(dcm) )
|
||||
return;
|
||||
|
||||
|
||||
@@ -1382,12 +1406,12 @@ function CPDecimalCompact(dcm)
|
||||
// if exp is zero does it make sense to have them? dont think so so delete them
|
||||
while (dcm._mantissa[0] === 0)
|
||||
{
|
||||
[dcm._mantissa removeObjectAtIndex:0];
|
||||
Array.prototype.shift.call(dcm._mantissa);
|
||||
}
|
||||
// trailing zeros, strip them
|
||||
while ([dcm._mantissa lastObject] === 0)
|
||||
while (dcm._mantissa[dcm._mantissa.length - 1] === 0)
|
||||
{
|
||||
[dcm._mantissa removeLastObject];
|
||||
Array.prototype.pop.call(dcm._mantissa);
|
||||
dcm._exponent++;
|
||||
if (dcm._exponent + 1 > CPDecimalMaxExponent)
|
||||
{
|
||||
@@ -1411,13 +1435,18 @@ function CPDecimalString(dcm, locale)
|
||||
{
|
||||
// Cocoa seems to just add all the zeros... this maybe controlled by locale,
|
||||
// will check.
|
||||
if (dcm._isNaN)
|
||||
return @"NaN";
|
||||
|
||||
var string = @"",
|
||||
i = 0;
|
||||
|
||||
if (dcm._isNegative)
|
||||
string += "-";
|
||||
var k = [dcm._mantissa count],
|
||||
|
||||
var k = dcm._mantissa.length,
|
||||
l = ((dcm._exponent < 0) ? dcm._exponent : 0) + k;
|
||||
|
||||
if (l < 0)
|
||||
{
|
||||
// add leading zeros
|
||||
|
||||
+689
-141
File diff suppressed because it is too large.
Load diff
@@ -1,8 +1,11 @@
|
||||
/*
|
||||
* CPComparisonPredicate.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Portions based on NSComparisonPredicate.m in Cocotron (http://www.cocotron.org/)
|
||||
* Copyright (c) 2006-2007 Christopher J. W. Lloyd
|
||||
*
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
/*
|
||||
* CPCompoundPredicate.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Portions based on NSCompoundPredicate.m in Cocotron (http://www.cocotron.org/)
|
||||
* Copyright (c) 2006-2007 Christopher J. W. Lloyd
|
||||
*
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* CPExpression.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -134,7 +134,6 @@ CPMinusSetExpressionType = 9;
|
||||
return [[CPExpression_keypath alloc] initWithKeyPath:keyPath];
|
||||
}
|
||||
|
||||
//Creating a Collection Expression
|
||||
/*!
|
||||
Returns a new aggregate expression for a given collection.
|
||||
@param collection A collection object (an instance of CPArray, CPSet, or CPDictionary) that contains further expressions.
|
||||
@@ -147,7 +146,7 @@ CPMinusSetExpressionType = 9;
|
||||
|
||||
/*!
|
||||
Returns a new CPExpression object that represent the union of a given set and collection.
|
||||
@param left An expression that evaluates to an CPSet object.
|
||||
@param left An expression that evaluates to a CPSet object.
|
||||
@param right An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
|
||||
@return A new CPExpression object that represents the union of left and right.
|
||||
*/
|
||||
@@ -158,7 +157,7 @@ CPMinusSetExpressionType = 9;
|
||||
|
||||
/*!
|
||||
Returns a new CPExpression object that represent the intersection of a given set and collection.
|
||||
@param left An expression that evaluates to an CPSet object.
|
||||
@param left An expression that evaluates to a CPSet object.
|
||||
@param right An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
|
||||
@return A new CPExpression object that represents the intersection of left and right.
|
||||
*/
|
||||
@@ -169,7 +168,7 @@ CPMinusSetExpressionType = 9;
|
||||
|
||||
/*!
|
||||
Returns a new CPExpression object that represent the subtraction of a given collection from a given set.
|
||||
@param left An expression that evaluates to an CPSet object.
|
||||
@param left An expression that evaluates to a CPSet object.
|
||||
@param left An expression that evaluates to a collection object (an instance of CPArray, CPSet, or CPDictionary).
|
||||
@return A new CPExpression object that represents the subtraction of right from left.
|
||||
*/
|
||||
@@ -217,16 +216,8 @@ CPMinusSetExpressionType = 9;
|
||||
trunc: one CPExpression instance representing a number CPNumber
|
||||
uppercase: one CPExpression instance representing a string CPString
|
||||
lowercase: one CPExpression instance representing a string CPString
|
||||
random none CPNumber (integer)
|
||||
random: one CPExpression instance representing a number CPNumber (integer) such that 0 <= rand < param
|
||||
now none [CPDate now]
|
||||
bitwiseAnd:with: two CPExpression instances representing numbers CPNumber (numbers will be treated as CPInteger)
|
||||
bitwiseOr:with: two CPExpression instances representing numbers CPNumber (numbers will be treated as CPInteger)
|
||||
bitwiseXor:with: two CPExpression instances representing numbers CPNumber (numbers will be treated as CPInteger)
|
||||
leftshift:by: two CPExpression instances representing numbers CPNumber (numbers will be treated as CPInteger)
|
||||
rightshift:by: two CPExpression instances representing numbers CPNumber (numbers will be treated as CPInteger)
|
||||
onesComplement: one CPExpression instance representing a numbers CPNumber (numbers will be treated as CPInteger)
|
||||
@endverbatim
|
||||
now: none [CPDate now]
|
||||
|
||||
This method raises an exception immediately if the selector is invalid; it raises an exception at runtime if the parameters are incorrect.
|
||||
*/
|
||||
@@ -238,16 +229,23 @@ CPMinusSetExpressionType = 9;
|
||||
/*!
|
||||
Returns an expression which will return the result of invoking on a given target a selector with a given name using given arguments.
|
||||
@param target A CPExpression object which will evaluate an object on which the selector identified by name may be invoked.
|
||||
@param function_name The name of the method to be invoked.
|
||||
@param selectorName The name of the method to be invoked.
|
||||
@param parameters An array containing CPExpression objects which can be evaluated to provide parameters for the method specified by name.
|
||||
@return An expression which will return the result of invoking the selector named name on the result of evaluating the target expression with the parameters specified by evaluating the elements of parameters.
|
||||
See the description of expressionForFunction:arguments: for examples of how to construct the parameter array.
|
||||
*/
|
||||
+ (CPExpression)expressionForFunction:(CPExpression)target selectorName:(CPString)function_name arguments:(CPArray)parameters
|
||||
+ (CPExpression)expressionForFunction:(CPExpression)target selectorName:(CPString)selectorName arguments:(CPArray)parameters
|
||||
{
|
||||
return [[CPExpression_function alloc] initWithTarget:target selector:CPSelectorFromString(function_name) arguments:parameters];
|
||||
return [[CPExpression_function alloc] initWithTarget:target selector:CPSelectorFromString(selectorName) arguments:parameters];
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns an expression that filters a collection by storing elements in the collection in a given variable and keeping the elements for which qualifier returns true.
|
||||
@param expression A CPExpression that evaluates to a collection.
|
||||
@param variable Used as a local variable, and will shadow any instances of variable in the bindings dictionary. The variable is removed or the old value replaced once evaluation completes.
|
||||
@param predicate The predicate used to determine whether the element belongs in the result collection.
|
||||
@return An expression that filters a collection by storing elements in the collection in the variable variable and keeping the elements for which qualifier returns true.
|
||||
*/
|
||||
+ (CPExpression)expressionForSubquery:(CPExpression)expression usingIteratorVariable:(CPString)variable predicate:(CPPredicate)predicate
|
||||
{
|
||||
return [[CPExpression_subquery alloc] initWithExpression:expression usingIteratorVariable:variable predicate:predicate];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* CPExpression_aggregate.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
/*
|
||||
* CPExpression_constant.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Portions based on NSExpression_constant.m in Cocotron (http://www.cocotron.org/)
|
||||
* Copyright (c) 2006-2007 Christopher J. W. Lloyd
|
||||
*
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* CPExpression_function.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -272,7 +272,7 @@ var CPSelectorNameKey = @"CPSelectorName",
|
||||
return ABS(num);
|
||||
}
|
||||
|
||||
+ (CPDate)now
|
||||
+ (CPDate)now:(id)_
|
||||
{
|
||||
return [CPDate date];
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
/*
|
||||
* CPExpression_keypath.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Portions based on NSExpression_keypath.m in Cocotron (http://www.cocotron.org/)
|
||||
* Copyright (c) 2006-2007 Christopher J. W. Lloyd
|
||||
*
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* CPExpression_self.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* CPExpression_set.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* CPExpression_subquery.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
/*
|
||||
* CPExpression_variable.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* Portions based on NSExpression_variable.m in Cocotron (http://www.cocotron.org/)
|
||||
* Copyright (c) 2006-2007 Christopher J. W. Lloyd
|
||||
*
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
/*
|
||||
* CPPredicate.j
|
||||
* Foundation
|
||||
*
|
||||
* Copyright 2009, 280 North, Inc.
|
||||
* CPPredicate parsing based on NSPredicate.m in GNUStep Base Library (http://www.gnustep.org/)
|
||||
* Copyright (c) 2005 Free Software Foundation.
|
||||
*
|
||||
* Created by cacaodev.
|
||||
* Copyright 2010.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -799,15 +802,28 @@ function(newValue)\
|
||||
if (![self scanString:@"]" intoString:NULL])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
}
|
||||
else if ([self scanString:@":(" intoString:NULL])
|
||||
else if ([self scanString:@":" intoString:NULL])
|
||||
{
|
||||
// function - this parser allows for (max)(a, b, c) to be properly
|
||||
// recognized and even (%K)(a, b, c) if %K evaluates to "max"
|
||||
var args = [];
|
||||
|
||||
if (![left keyPath])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
|
||||
var selector = [left keyPath] + @":",
|
||||
args = [];
|
||||
|
||||
if (![self scanString:@"(" intoString:NULL])
|
||||
{
|
||||
var str;
|
||||
[self scanCharactersFromSet:[CPCharacterSet lowercaseLetterCharacterSet] intoString:REFERENCE(str)];
|
||||
|
||||
if (![self scanString:@":(" intoString:NULL])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
|
||||
selector += str + @":";
|
||||
}
|
||||
|
||||
if (![self scanString:@")" intoString:NULL])
|
||||
{
|
||||
[args addObject:[self parseExpression]];
|
||||
@@ -817,7 +833,8 @@ function(newValue)\
|
||||
if (![self scanString:@")" intoString:NULL])
|
||||
CPRaiseParseError(self, @"expression");
|
||||
}
|
||||
left = [CPExpression expressionForFunction:([left keyPath] + ":") arguments:args];
|
||||
|
||||
left = [CPExpression expressionForFunction:selector arguments:args];
|
||||
}
|
||||
else if ([self scanString:@"UNION" intoString:NULL])
|
||||
{
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <Foundation/CPString.j>
|
||||
@import <Foundation/CPDecimalNumber.j>
|
||||
@import <Foundation/CPKeyedArchiver.j>
|
||||
@import <Foundation/CPKeyedUnarchiver.j>
|
||||
@import <Foundation/CPString.j>
|
||||
|
||||
@implementation CPDecimalNumberHandlerTest : OJTestCase
|
||||
|
||||
@@ -46,7 +48,7 @@
|
||||
|
||||
- (void)testdefaultDecimalNumberHandler
|
||||
{
|
||||
[self assert:_cappdefaultDcmHandler equals:[CPDecimalNumberHandler defaultDecimalNumberHandler] message:"T1 defaultDecimalNumberHandler returned different handler than the current default"];
|
||||
[self assertTrue:[CPDecimalNumberHandler defaultDecimalNumberHandler] message:"T1 defaultDecimalNumberHandler returned nothing"];
|
||||
}
|
||||
|
||||
- (void)testroundingMode
|
||||
@@ -72,8 +74,8 @@
|
||||
var h1 = [CPDecimalNumberHandler decimalNumberHandlerWithRoundingMode:CPRoundDown scale:0 raiseOnExactness:NO raiseOnOverflow:NO raiseOnUnderflow:NO raiseOnDivideByZero:NO];
|
||||
[self assertTrue:h1 message:"T1 exceptionDuringOperation: no alloc"];
|
||||
|
||||
var a = [CPDecimalNumber decimalNumberWithString:@"100"];
|
||||
var b = [CPDecimalNumber decimalNumberWithString:@"100"];
|
||||
var a = [CPDecimalNumber decimalNumberWithString:@"100"],
|
||||
b = [CPDecimalNumber decimalNumberWithString:@"100"];
|
||||
|
||||
// no throw first
|
||||
try {
|
||||
@@ -146,4 +148,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testEncoding
|
||||
{
|
||||
var handler = [CPDecimalNumberHandler decimalNumberHandlerWithRoundingMode:CPRoundDown scale:3 raiseOnExactness:NO raiseOnOverflow:NO raiseOnUnderflow:YES raiseOnDivideByZero:NO],
|
||||
encoded = [CPKeyedArchiver archivedDataWithRootObject:handler],
|
||||
decoded = [CPKeyedUnarchiver unarchiveObjectWithData:encoded];
|
||||
|
||||
[self assert:[handler roundingMode] equals:[decoded roundingMode]];
|
||||
[self assert:[handler scale] equals:[decoded scale]];
|
||||
|
||||
try {
|
||||
[decoded exceptionDuringOperation:nil error:CPCalculationDivideByZero leftOperand:CPDecimalMakeZero() rightOperand:CPDecimalMakeZero()];
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
[self fail:"Should not have thrown a divide by zero exception"];
|
||||
}
|
||||
|
||||
try {
|
||||
[decoded exceptionDuringOperation:nil error:CPCalculationUnderflow leftOperand:CPDecimalMakeZero() rightOperand:CPDecimalMakeZero()];
|
||||
[self fail:"Should have thrown an underflow exception"];
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -93,7 +93,7 @@
|
||||
[self assert:NO equals:dcm._isNegative message:"decimalNumberWithMantissa:exponent:isNegative: - sign"];
|
||||
|
||||
// Def behavior
|
||||
[self assert:[CPDecimalNumber defaultBehavior] equals:_cappdefaultDcmHandler message:"defaultBehavior: - returned different object"];
|
||||
[self assertTrue:[CPDecimalNumber defaultBehavior] message:"defaultBehavior: - returned nothing"];
|
||||
|
||||
[CPDecimalNumber setDefaultBehavior:_dcmnhWithExactness];
|
||||
[self assertTrue:[CPDecimalNumber defaultBehavior]._raiseOnExactness message:"setDefaultBehavior: - new behavior not set"];
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
dcmn = [CPDecimalNumber minimumDecimalNumber];
|
||||
dcm = [dcmn decimalValue];
|
||||
[self assert:CPDecimalMinExponent equals:dcm._exponent message:"minimumDecimalNumber: - exponent"];
|
||||
[self assert:CPDecimalMaxExponent equals:dcm._exponent message:"minimumDecimalNumber: - exponent"];
|
||||
[self assert:[9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9] equals:dcm._mantissa message:"minimumDecimalNumber: - mantissa"];
|
||||
[self assert:YES equals:dcm._isNegative message:"minimumDecimalNumber: - sign"];
|
||||
|
||||
@@ -139,63 +139,26 @@
|
||||
dcm = [dcmn boolValue];
|
||||
[self assert:true equals:dcm message:"boolValue: - should be true"];
|
||||
|
||||
// exceptions
|
||||
try {
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"];
|
||||
[self fail:"initWithString: TEX1: overflow from string"];
|
||||
} catch (e)
|
||||
{
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"foo"];
|
||||
[self fail:"initWithString: TEX2: invalid string"];
|
||||
} catch (e)
|
||||
{
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@".123"];
|
||||
[self fail:"initWithString: TEX3: invalid string"];
|
||||
} catch (e)
|
||||
{
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"-.123"];
|
||||
[self fail:"initWithString: TEX4: invalid string"];
|
||||
} catch (e)
|
||||
{
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"0123"];
|
||||
[self fail:"initWithString: TEX5: invalid string"];
|
||||
} catch (e)
|
||||
{
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"1e200"];
|
||||
[self fail:"initWithString: TEX6: exponent overflow"];
|
||||
} catch (e)
|
||||
{
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
try{
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"12312e-23421"];
|
||||
[self fail:"initWithString: TEX7: exponent underflow"];
|
||||
} catch (e)
|
||||
{
|
||||
if ((e.isa) && [e name] == AssertionFailedError)
|
||||
throw e;
|
||||
}
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 1 overflow should return NaN"];
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"foo"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 2 overflow should return NaN"];
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@".123"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 3 overflow should return NaN"];
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"-.123"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 4 overflow should return NaN"];
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"0123"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 5 overflow should return NaN"];
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"1e200"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 6 overflow should return NaN"];
|
||||
|
||||
dcmn = [[CPDecimalNumber alloc] initWithString:@"12312e-23421"];
|
||||
[self assert:CPOrderedSame equals:[dcmn compare:[CPDecimalNumber notANumber]] message:"initWithString: 7 overflow should return NaN"];
|
||||
}
|
||||
|
||||
- (void)testAdd
|
||||
@@ -532,4 +495,18 @@
|
||||
[self assert:"82346.2341144" equals:[dcmn descriptionWithLocale:nil] message:"descriptionWithLocale: - large number"];
|
||||
}
|
||||
|
||||
|
||||
- (void)testEncoding
|
||||
{
|
||||
var number = [CPDecimalNumber decimalNumberWithString:@"-1.233e24"],
|
||||
encoded = [CPKeyedArchiver archivedDataWithRootObject:number],
|
||||
decoded = [CPKeyedUnarchiver unarchiveObjectWithData:encoded];
|
||||
|
||||
[self assert:21 equals:decoded._data._exponent message:"exponent not unarchived correctly"];
|
||||
[self assert:[1,2,3,3] equals:decoded._data._mantissa message:"mantissa not unarchived correctly"];
|
||||
[self assert:YES equals:decoded._data._isNegative message:"sign not unarchived correctly"];
|
||||
[self assert:NO equals:decoded._data._isNaN message:"isNaN not unarchived correctly"];
|
||||
[self assert:YES equals:decoded._data._isCompact message:"isCompact not unarchived correctly"];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -68,27 +68,42 @@
|
||||
[self assert:NO equals:dcm._isNaN message:"CPDecimalMakeWithString() Tf4: NaN is incorrectly set"];
|
||||
|
||||
dcm = CPDecimalMakeWithString(@"000000000000000000");
|
||||
[self assertNull:dcm message:"CPDecimalMakeWithString() Tf5: Should be invalid"];
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Tf5: Should be invalid"];
|
||||
|
||||
// too large return nil
|
||||
[self assertNull:CPDecimalMakeWithString(@"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") message:"CPDecimalMakeWithString() To1: number overflow handling"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"-1e1000") message:"CPDecimalMakeWithString() To2: exponent overflow not caught"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"-1e-2342") message:"CPDecimalMakeWithString() To3: exponent underflow not caught"];
|
||||
// too large return NaN
|
||||
dcm = CPDecimalMakeWithString(@"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() To1: number overflow handling. Should return NaN"];
|
||||
dcm =CPDecimalMakeWithString(@"-1e1000");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() To2: exponent overflow not caught. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"-1e-2342");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() To3: exponent underflow not caught. Should return NaN"];
|
||||
|
||||
// Tests for invalid strings
|
||||
[self assertNull:CPDecimalMakeWithString(@"abc") message:"CPDecimalMakeWithString() Ti1: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"123a") message:"CPDecimalMakeWithString() Ti2: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"12.7e") message:"CPDecimalMakeWithString() Ti3: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"e") message:"CPDecimalMakeWithString() Ti4: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"12 ") message:"CPDecimalMakeWithString() Ti5: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"1 2 3") message:"CPDecimalMakeWithString() Ti6: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"e10") message:"CPDecimalMakeWithString() Ti7: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"123ee") message:"CPDecimalMakeWithString() Ti8: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"0001") message:"CPDecimalMakeWithString() Ti9: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"-0001") message:"CPDecimalMakeWithString() Ti10: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@".123") message:"CPDecimalMakeWithString() Ti11: catch of invalid number string"];
|
||||
[self assertNull:CPDecimalMakeWithString(@"-.1") message:"CPDecimalMakeWithString() Ti12: catch of invalid number string"];
|
||||
|
||||
dcm = CPDecimalMakeWithString(@"abc");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti1: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"123a");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti2: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"12.7e");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti3: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"e");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti4: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"12 ");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti5: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"1 2 3");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti6: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"e10");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti7: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"123ee");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti8: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"0001");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti9: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"-0001");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti10: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@".123");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti11: catch of invalid number string. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithString(@"-.1");
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithString() Ti12: catch of invalid number string. Should return NaN"];
|
||||
|
||||
//test make with parts
|
||||
dcm = CPDecimalMakeWithParts(10127658,2);
|
||||
[self assert:2 equals:dcm._exponent message:"CPDecimalMakeWithParts() Tmp1: exponent"];
|
||||
@@ -101,8 +116,10 @@
|
||||
[self assert:YES equals:dcm._isNegative message:"CPDecimalMakeWithParts() Tmp2: sign"];
|
||||
[self assert:NO equals:dcm._isNaN message:"CPDecimalMakeWithParts() Tmp2: NaN is incorrectly set"];
|
||||
|
||||
[self assertNull:CPDecimalMakeWithParts(1,10000) message:"CPDecimalMakeWithParts() Tmp3: exponent overflow not caught"];
|
||||
[self assertNull:CPDecimalMakeWithParts(-1,-1000) message:"CPDecimalMakeWithParts() Tmp4: exponent underflow not caught"];
|
||||
dcm = CPDecimalMakeWithParts(1,10000);
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithParts() Tmp3: exponent overflow not caught. Should return NaN"];
|
||||
dcm = CPDecimalMakeWithParts(-1,-1000);
|
||||
[self assertTrue:dcm._isNaN message:"CPDecimalMakeWithParts() Tmp4: exponent underflow not caught. Should return NaN"];
|
||||
}
|
||||
|
||||
- (void)testZeros
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
[self assertTrue:[predicate evaluateWithObject:dict] message:[predicate description] + " should be true"];
|
||||
|
||||
// Test Symbolic token
|
||||
predicate = [CPPredicate predicateWithFormat:@"Record1.Children[FIRST] = 'Kid1'"];
|
||||
predicate = [CPPredicate predicateWithFormat:@"Record1.Children[ FIRST ] = 'Kid1'"];
|
||||
[self assertTrue:[predicate evaluateWithObject:dict] message:[predicate description] + " should be true"];
|
||||
|
||||
predicate = [CPPredicate predicateWithFormat:@"Record1.Children[1] = 'Kid2'"];
|
||||
@@ -332,8 +332,8 @@
|
||||
predicate = [CPPredicate predicateWithFormat: @"sum:(1,1) = 2"];
|
||||
[self assertTrue:[predicate evaluateWithObject:nil] message:"Predicate " + predicate + " should evaluate to TRUE"];
|
||||
|
||||
// predicate = [CPPredicate predicateWithFormat: @"multiply:by:(5,3) = 15"];
|
||||
// [self assertTrue:[predicate evaluateWithObject:nil] message:"Predicate " + predicate + " should evaluate to TRUE"];
|
||||
predicate = [CPPredicate predicateWithFormat: @"multiply:by:(5,3) = 15"];
|
||||
[self assertTrue:[predicate evaluateWithObject:nil] message:"Predicate " + predicate + " should evaluate to TRUE"];
|
||||
|
||||
// TEST custom functions
|
||||
predicate = [CPPredicate predicateWithFormat:@"FUNCTION('a/path', 'lastPathComponent') = 'path'"];
|
||||
@@ -342,14 +342,16 @@
|
||||
predicate = [CPPredicate predicateWithFormat:@"FUNCTION('a/path', 'substringFromIndex:', 2) = 'path'"];
|
||||
[self assertTrue:[predicate evaluateWithObject:nil] message:"Predicate " + predicate + " should evaluate to TRUE"];
|
||||
|
||||
predicate = [CPPredicate predicateWithFormat:@"FUNCTION('toto', 'stringByReplacingOccurrencesOfString:withString:', 'o', 'a') == 'tata'"];
|
||||
[self assertTrue:[predicate evaluateWithObject:nil] message:"Predicate " + predicate + " should be TRUE"];
|
||||
|
||||
// TEST Subquery -- This means: search people who have 2 boys.
|
||||
predicate = [CPPredicate predicateWithFormat: @"SUBQUERY(Record1.Children, $x, $x BEGINSWITH 'Kid')[SIZE] = 2"];
|
||||
[self assertTrue:[predicate evaluateWithObject:dict] message:"Predicate " + predicate + " should evaluate to TRUE"];
|
||||
|
||||
// Test Set expressions
|
||||
// Parsing is ok but the evaluation of this predicate will return NO for 2 reasons:
|
||||
// 1- CPSet -isEqual: is unimplemented.
|
||||
// 2- lhs will evaluate to a CPSet and rhs to a CPArray (aggregate exp). Comparing sets against arrays will always fail in CPComparisonPredicate. This is also cocoa behavior but i guess it's for historical reasons (set expressions are 10.5+) and should be changed in capp in my opinion.
|
||||
// Parsing is ok but the evaluation of this predicate will return NO because:
|
||||
// - lhs will evaluate to a CPSet and rhs to a CPArray (aggregate exp). Comparing sets against arrays will always fail in CPComparisonPredicate. This is also cocoa behavior but i guess it's for historical reasons (set expressions are 10.5+) and should be changed in capp in my opinion.
|
||||
var object = [CPDictionary dictionaryWithObject:[CPSet setWithObjects:@"a"] forKey:"a"],
|
||||
result = [CPSet setWithObjects:@"a",@"b"];
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPOutlineViewCibTest
|
||||
*
|
||||
* Created by cacaodev on January 14, 2011.
|
||||
* Copyright 2011, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
CPWindow theWindow;
|
||||
CPOutlineView outlineView;
|
||||
|
||||
CPDictionary rootItem;
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
var path = [[CPBundle mainBundle] pathForResource:@"InitInfo.dict"],
|
||||
request = [CPURLRequest requestWithURL:path],
|
||||
connection = [CPURLConnection connectionWithRequest:request delegate:self];
|
||||
|
||||
rootItem = nil;
|
||||
[theWindow setFullBridge:YES];
|
||||
}
|
||||
|
||||
- (void)connection:(CPURLConnection)connection didReceiveData:(CPString)dataString
|
||||
{
|
||||
if (!dataString)
|
||||
return;
|
||||
|
||||
var data = [[CPData alloc] initWithRawString:dataString],
|
||||
rootItem = [CPPropertyListSerialization propertyListFromData:data format:CPPropertyListXMLFormat_v1_0];
|
||||
|
||||
[outlineView reloadData];
|
||||
}
|
||||
|
||||
// ==========================
|
||||
// ! CPOutlineView Delegate
|
||||
// ==========================
|
||||
|
||||
- (int)outlineView:(CPOutlineView)theOutlineView numberOfChildrenOfItem:(id)theItem
|
||||
{
|
||||
if (theItem == nil)
|
||||
theItem = rootItem;
|
||||
|
||||
if ([theItem isKindOfClass:[CPString class]])
|
||||
return 0;
|
||||
|
||||
return [[theItem objectForKey:"Children"] count];
|
||||
}
|
||||
|
||||
- (id)outlineView:(CPOutlineView)theOutlineView child:(int)theIndex ofItem:(id)theItem
|
||||
{
|
||||
if (theItem == nil)
|
||||
theItem = rootItem;
|
||||
|
||||
return [[theItem objectForKey:"Children"] objectAtIndex:theIndex];
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(CPOutlineView)theOutlineView isItemExpandable:(id)theItem
|
||||
{
|
||||
if (theItem == nil)
|
||||
theItem = rootItem;
|
||||
|
||||
return ![theItem isKindOfClass:[CPString class]];
|
||||
}
|
||||
|
||||
- (id)outlineView:(CPOutlineView)anOutlineView objectValueForTableColumn:(CPTableColumn)theColumn byItem:(id)theItem
|
||||
{
|
||||
if ([theItem isKindOfClass:[CPString class]])
|
||||
return theItem;
|
||||
|
||||
return [theItem objectForKey:"Name"];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Main cib file base name</key>
|
||||
<string>MainMenu.cib</string>
|
||||
<key>CPBundleName</key>
|
||||
<string>CPOutlineViewCibTest</string>
|
||||
<key>CPPrincipalClass</key>
|
||||
<string>CPApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CPOutlineViewCibTest
|
||||
*
|
||||
* Created by You on January 14, 2011.
|
||||
* Copyright 2011, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
JAKE = require("jake"),
|
||||
task = JAKE.task,
|
||||
FileList = JAKE.FileList,
|
||||
app = require("cappuccino/jake").app,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
||||
OS = require("os");
|
||||
|
||||
app ("CPOutlineViewCibTest", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CPOutlineViewCibTest.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CPOutlineViewCibTest");
|
||||
task.setIdentifier("com.yourcompany.CPOutlineViewCibTest");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CPOutlineViewCibTest");
|
||||
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
|
||||
task.setResources(new FileList("Resources/**"));
|
||||
task.setIndexFilePath("index.html");
|
||||
task.setInfoPlistPath("Info.plist");
|
||||
task.setNib2CibFlags("-R Resources/");
|
||||
|
||||
if (configuration === "Debug")
|
||||
task.setCompilerFlags("-DDEBUG -g");
|
||||
else
|
||||
task.setCompilerFlags("-O");
|
||||
});
|
||||
|
||||
task ("default", ["CPOutlineViewCibTest"], function()
|
||||
{
|
||||
printResults(configuration);
|
||||
});
|
||||
|
||||
task ("build", ["default"]);
|
||||
|
||||
task ("debug", function()
|
||||
{
|
||||
ENV["CONFIGURATION"] = "Debug";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("release", function()
|
||||
{
|
||||
ENV["CONFIGURATION"] = "Release";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("run", ["debug"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Debug", "CPOutlineViewCibTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "CPOutlineViewCibTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "CPOutlineViewCibTest"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "CPOutlineViewCibTest"), FILE.join("Build", "Deployment", "CPOutlineViewCibTest")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", "CPOutlineViewCibTest"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPOutlineViewCibTest"), FILE.join("Build", "Desktop", "CPOutlineViewCibTest", "CPOutlineViewCibTest.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", "CPOutlineViewCibTest", "CPOutlineViewCibTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPOutlineViewCibTest"));
|
||||
print("----------------------------");
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<string>Monty</string>
|
||||
<string>Smithers</string>
|
||||
<string>Frink</string>
|
||||
<string>Carl</string>
|
||||
<string>Cletus</string>
|
||||
<string>Bobo</string>
|
||||
<string>Duff</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Simpsons</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<string>Mountain Unicycling</string>
|
||||
<string>Rock Climbing</string>
|
||||
<string>Bouldering</string>
|
||||
<string>Snowboarding</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Sports</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<string>Eating Strawberries</string>
|
||||
<string>Mangoes</string>
|
||||
<string>Treehouses</string>
|
||||
<string>Good Weather</string>
|
||||
<string>Maui</string>
|
||||
<string>Trogdor</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Just Fun Stuff</string>
|
||||
</dict>
|
||||
<string>Foo with the Bar</string>
|
||||
<string>Bar</string>
|
||||
<string>BooFar</string>
|
||||
<string>Foo Bar</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Shows</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<string>Big Sur</string>
|
||||
<string>New York</string>
|
||||
<string>Naples</string>
|
||||
<string>Chez Panisse</string>
|
||||
<string>Lucia</string>
|
||||
<string>Switzerland</string>
|
||||
<string>Ireland</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Vacation</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<string>Green Bay</string>
|
||||
<string>Milwaukee</string>
|
||||
<string>Monroe</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Other</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Travel</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<string>Kark</string>
|
||||
<string>Valen</string>
|
||||
<string>Kosh</string>
|
||||
<string>Red Letter</string>
|
||||
<string>Fluffy Ears</string>
|
||||
<string>Hiro</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Science Fiction</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Favorite Things Group</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<string>Mischief</string>
|
||||
<string>Mayhem</string>
|
||||
<string>Soap</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Movies Group with a Long Title</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Children</key>
|
||||
<array>
|
||||
<string>ObjC</string>
|
||||
<string>Cocoa</string>
|
||||
<string>KVC</string>
|
||||
<string>NSTooblar</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>Things That Rule</string>
|
||||
</dict>
|
||||
<string>Eagle</string>
|
||||
<string>Boiler</string>
|
||||
<string>Tarheel</string>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
<string>OVRoot</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;4E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;7E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;9E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;2;10E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;2;11E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;2;12E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;2;13E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;2;14E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;16E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;18E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;125E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;133E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;138E;D;K;6;CP$UIDd;3;139E;D;K;6;CP$UIDd;3;140E;D;K;6;CP$UIDd;3;141E;D;K;6;CP$UIDd;3;142E;D;K;6;CP$UIDd;3;143E;D;K;6;CP$UIDd;3;144E;D;K;6;CP$UIDd;3;145E;D;K;6;CP$UIDd;3;146E;D;K;6;CP$UIDd;3;147E;D;K;6;CP$UIDd;3;148E;D;K;6;CP$UIDd;3;149E;D;K;6;CP$UIDd;3;150E;D;K;6;CP$UIDd;3;151E;D;K;6;CP$UIDd;3;152E;D;K;6;CP$UIDd;3;153E;D;K;6;CP$UIDd;3;154E;D;K;6;CP$UIDd;3;155E;D;K;6;CP$UIDd;3;156E;D;K;6;CP$UIDd;3;157E;D;K;6;CP$UIDd;3;158E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;159E;D;K;6;CP$UIDd;3;160E;D;K;6;CP$UIDd;3;161E;D;K;6;CP$UIDd;3;162E;D;K;6;CP$UIDd;3;163E;D;K;6;CP$UIDd;3;164E;D;K;6;CP$UIDd;3;165E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;3;168E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;3;170E;D;K;6;CP$UIDd;3;171E;D;K;6;CP$UIDd;3;172E;D;K;6;CP$UIDd;3;173E;D;K;6;CP$UIDd;3;174E;D;K;6;CP$UIDd;3;175E;D;K;6;CP$UIDd;3;176E;D;K;6;CP$UIDd;3;177E;D;K;6;CP$UIDd;3;178E;D;K;6;CP$UIDd;3;179E;D;K;6;CP$UIDd;3;180E;D;K;6;CP$UIDd;3;181E;D;K;6;CP$UIDd;3;182E;D;K;6;CP$UIDd;3;183E;D;K;6;CP$UIDd;3;184E;D;K;6;CP$UIDd;3;185E;D;K;6;CP$UIDd;3;186E;D;K;6;CP$UIDd;3;187E;D;K;6;CP$UIDd;3;188E;D;K;6;CP$UIDd;3;189E;D;K;6;CP$UIDd;3;190E;D;K;6;CP$UIDd;3;191E;D;K;6;CP$UIDd;3;192E;D;K;6;CP$UIDd;3;193E;D;K;6;CP$UIDd;3;194E;D;K;6;CP$UIDd;3;195E;D;K;6;CP$UIDd;3;196E;D;K;6;CP$UIDd;3;197E;D;K;6;CP$UIDd;3;198E;D;K;6;CP$UIDd;3;199E;D;K;6;CP$UIDd;3;200E;D;K;6;CP$UIDd;3;201E;D;K;6;CP$UIDd;3;202E;D;K;6;CP$UIDd;3;203E;D;K;6;CP$UIDd;3;204E;D;K;6;CP$UIDd;3;205E;D;K;6;CP$UIDd;3;206E;D;K;6;CP$UIDd;3;207E;D;K;6;CP$UIDd;3;208E;D;K;6;CP$UIDd;3;209E;D;K;6;CP$UIDd;3;210E;D;K;6;CP$UIDd;3;211E;D;K;6;CP$UIDd;3;212E;D;K;6;CP$UIDd;3;213E;D;K;6;CP$UIDd;3;214E;D;K;6;CP$UIDd;3;215E;D;KLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,103 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
CPOutlineViewCibTest
|
||||
|
||||
Created by You on January 14, 2011.
|
||||
Copyright 2011, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||
|
||||
<title>CPOutlineViewCibTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
objj_msgSend_reset();
|
||||
|
||||
// DEBUG OPTIONS:
|
||||
|
||||
// Uncomment to enable printing of backtraces on exceptions:
|
||||
//objj_msgSend_decorate(objj_backtrace_decorator);
|
||||
|
||||
// Uncomment to supress exceptions that take place inside a message
|
||||
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
|
||||
|
||||
// Uncomment to enable runtime type checking:
|
||||
//objj_msgSend_decorate(objj_typecheck_decorator);
|
||||
|
||||
// Uncomment (along with both above) to print backtraces on type check errors:
|
||||
//objj_typecheck_prints_backtrace = true;
|
||||
|
||||
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
|
||||
//CPLogUnregister(CPLogDefault);
|
||||
|
||||
// Uncomment to enable a specific logger:
|
||||
//CPLogRegister(CPLogConsole);
|
||||
//CPLogRegister(CPLogPopup);
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPOutlineViewCibTest...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!--
|
||||
index.html
|
||||
CPOutlineViewCibTest
|
||||
|
||||
Created by You on January 14, 2011.
|
||||
Copyright 2011, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||
|
||||
<title>CPOutlineViewCibTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPOutlineViewCibTest...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPOutlineViewCibTest
|
||||
*
|
||||
* Created by cacaodev on January 14, 2011.
|
||||
* Copyright 2011, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -180,13 +180,13 @@ CustomOutlineViewDragType = @"CustomOutlineViewDragType";
|
||||
|
||||
var column = [[CPTableColumn alloc] initWithIdentifier:@"One"];
|
||||
[_outlineView addTableColumn:column];
|
||||
[_outlineView setOutlineTableColumn:column];
|
||||
//[_outlineView setOutlineTableColumn:column];
|
||||
setTimeout(function(){
|
||||
[column setWidth:200];
|
||||
},0);
|
||||
|
||||
[_outlineView addTableColumn:[[CPTableColumn alloc] initWithIdentifier:@"Two"]];
|
||||
[_outlineView addTableColumn:[[CPTableColumn alloc] initWithIdentifier:@"Three"]];
|
||||
[_outlineView addTableColumn:[[CPTableColumn alloc] initWithIdentifier:@"Three"]];
|
||||
|
||||
[_outlineView registerForDraggedTypes:[CustomOutlineViewDragType]];
|
||||
|
||||
|
||||
@@ -36,7 +36,10 @@
|
||||
else
|
||||
_outlineTableColumn = [[self tableColumns] objectAtIndex:0];
|
||||
|
||||
_indentationPerLevel = [aCoder decodeFloatForKey:@"NSOutlineViewIndentationPerLevelKey"];
|
||||
if ([aCoder containsValueForKey:"NSOutlineViewIndentationPerLevelKey"])
|
||||
_indentationPerLevel = [aCoder decodeFloatForKey:@"NSOutlineViewIndentationPerLevelKey"];
|
||||
else
|
||||
_indentationPerLevel = 16;
|
||||
|
||||
_outlineViewDataSource = [aCoder decodeObjectForKey:@"NSDataSource"];
|
||||
_outlineViewDelegate = [aCoder decodeObjectForKey:@"NSDelegate"];
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
{
|
||||
var frame = [self frame];
|
||||
|
||||
[self setFrameOrigin:CGPointMake(frame.origin.x - 4.0, frame.origin.y - 4.0)];
|
||||
[self setFrameSize:CGSizeMake(frame.size.width + 8.0, frame.size.height + 8.0)];
|
||||
[self setFrameOrigin:CGPointMake(frame.origin.x - 3.0, frame.origin.y - 3.0)];
|
||||
[self setFrameSize:CGSizeMake(frame.size.width + 7.0, frame.size.height + 7.0)];
|
||||
}
|
||||
|
||||
CPLog.debug([self stringValue] + " => isBordered=" + [self isBordered] + ", isBezeled=" + [self isBezeled] + ", bezelStyle=" + [self bezelStyle] + "("+[cell stringValue]+", " + [cell placeholderString] + ")");
|
||||
|
||||
Reference in new issue
Block a user