Merge remote-tracking branch 'upstream/master' into CPAnimationContext

This commit is contained in:
cacaodev committed 2015-03-03 23:03:10 +01:00
commit cd7b9d31c9
45 files changed
+3530 -1386

No files matched your search

+9
View File
@@ -450,3 +450,12 @@ function CPBrowserCSSProperty(aProperty)
return browserProperty.toLowerCase();
}
function CPBrowserBackingStorePixelRatio(context)
{
return context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio || 1;
}
+8
View File
@@ -323,6 +323,14 @@ CPEraDatePickerElementFlag = 0x0100;
*/
- (void)_setDateValue:(CPDate)aDateValue timeInterval:(CPTimeInterval)aTimeInterval
{
// Make sure to have a valid date and avoid NaN values
if (!isFinite(aDateValue))
{
[CPException raise:CPInvalidArgumentException
reason:@"aDateValue is not valid"];
return;
}
if (_minDate)
aDateValue = new Date (MAX(aDateValue, _minDate));
+1 -1
View File
@@ -749,7 +749,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
- (void)setValue:(id)theValue forKey:(CPString)theKeyPath
{
[self setValue:theKeyPath forKeyPath:theKeyPath];
[self setValue:theValue forKeyPath:theKeyPath];
}
- (unsigned)count
+57 -96
View File
@@ -223,6 +223,22 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
return self;
}
- (void)_initSubclass
{
_BlockDeselectView = function(view, row, column)
{
[view unsetThemeState:CPThemeStateSelectedDataView];
[_disclosureControlsForRows[row] unsetThemeState:CPThemeStateSelected];
};
_BlockSelectView = function(view, row, column)
{
[view setThemeState:CPThemeStateSelectedDataView];
[_disclosureControlsForRows[row] setThemeState:CPThemeStateSelected];
};
}
/*!
In addition to standard delegation, the outline view also supports data
source delegation. This method sets the data source object. Just like the
@@ -679,7 +695,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
[self _cleanPendingItem];
[super reloadData];
[super _reloadDataViews];
}
- (void)_reloadItem:(id)anItem
@@ -1308,7 +1324,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
/*!
Reloads all the data of the outlineview.
*/
- (void)reloadData
- (void)_reloadDataViews
{
[self reloadItem:nil reloadChildren:YES];
}
@@ -1340,6 +1356,25 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
else
[super removeTableColumn:aTableColumn];
}
- (void)_addDraggedDataView:(CPView)aDataView toView:(CPView)aSuperview forColumn:(CPInteger)column row:(CPInteger)row offset:(CGPoint)offset
{
var control;
[super _addDraggedDataView:aDataView toView:aSuperview forColumn:column row:row offset:offset];
if (_tableColumns[column] === _outlineTableColumn && (control = _disclosureControlsForRows[row]))
{
var controlFrame = [self frameOfOutlineDisclosureControlAtRow:row];
controlFrame.origin.x -= offset.x;
controlFrame.origin.y -= offset.y;
[control setFrame:controlFrame];
[aSuperview addSubview:control];
}
}
/*!
@ignore
We override this because we need a special behavior for the outline
@@ -1355,67 +1390,6 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
return [super frameOfDataViewAtColumn:aColumn row:aRow];
}
/*!
@ignore
We need to offset the dataview and add the disclosure triangle.
*/
- (CPView)_dragViewForColumn:(CPInteger)theColumnIndex event:(CPEvent)theDragEvent offset:(CGPoint)theDragViewOffset
{
var dragView = [[_CPColumnDragView alloc] initWithLineColor:[self gridColor]],
tableColumn = [[self tableColumns] objectAtIndex:theColumnIndex],
defaultRowHeight = [self valueForThemeAttribute:@"default-row-height"],
bounds = CGRectMake(0.0, 0.0, [tableColumn width], CGRectGetHeight([self exposedRect]) + defaultRowHeight),
columnRect = [self rectOfColumn:theColumnIndex],
headerView = [tableColumn headerView],
row = [_exposedRows firstIndex];
while (row !== CPNotFound)
{
var dataView = [self _newDataViewForRow:row tableColumn:tableColumn],
dataViewFrame = [self frameOfDataViewAtColumn:theColumnIndex row:row];
// Only one column is ever dragged so we just place the view at
dataViewFrame.origin.x = 0.0;
// Offset by table header height - scroll position
dataViewFrame.origin.y = (CGRectGetMinY(dataViewFrame) - CGRectGetMinY([self exposedRect])) + defaultRowHeight;
[dataView setFrame:dataViewFrame];
[dataView setObjectValue:[self _objectValueForTableColumn:tableColumn row:row]];
if (tableColumn === _outlineTableColumn)
{
// first inset the dragview
var indentationWidth = ([self levelForRow:row] + 1) * [self indentationPerLevel];
dataViewFrame.origin.x += indentationWidth;
dataViewFrame.size.width -= indentationWidth;
[dataView setFrame:dataViewFrame];
}
[dragView addSubview:dataView];
row = [_exposedRows indexGreaterThanIndex:row];
}
// Add the column header view
var headerFrame = [headerView frame];
headerFrame.origin = CGPointMakeZero();
var columnHeaderView = [[_CPTableColumnHeaderView alloc] initWithFrame:headerFrame];
[columnHeaderView setStringValue:[headerView stringValue]];
[columnHeaderView setThemeState:[headerView themeState]];
[dragView addSubview:columnHeaderView];
[dragView setBackgroundColor:[CPColor whiteColor]];
[dragView setAlphaValue:0.7];
[dragView setFrame:bounds];
return dragView;
}
/*!
Retargets the drop item for the outlineview.
@@ -1539,43 +1513,22 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
@ignore
We need to move the disclosure control too.
*/
- (void)_layoutDataViewsInRows:(CPIndexSet)rows columns:(CPIndexSet)columns
- (void)_layoutViewsForRowIndexes:(CPIndexSet)rowIndexes columnIndexes:(CPIndexSet)columnIndexes
{
var rowArray = [],
columnArray = [];
[rows getIndexes:rowArray maxCount:-1 inIndexRange:nil];
[columns getIndexes:columnArray maxCount:-1 inIndexRange:nil];
var columnIndex = 0,
columnsCount = columnArray.length;
for (; columnIndex < columnsCount; ++columnIndex)
[self _enumerateViewsInRows:rowIndexes columns:columnIndexes usingBlock:function(view, row, column, stop)
{
var column = columnArray[columnIndex],
tableColumn = _tableColumns[column],
tableColumnUID = [tableColumn UID],
dataViewsForTableColumn = _dataViewsForTableColumns[tableColumnUID],
rowIndex = 0,
rowsCount = rowArray.length;
var control;
for (; rowIndex < rowsCount; ++rowIndex)
[view setFrame:[self frameOfDataViewAtColumn:column row:row]];
if (_tableColumns[column] === _outlineTableColumn && (control = _disclosureControlsForRows[row]))
{
var row = rowArray[rowIndex],
dataView = dataViewsForTableColumn[row],
dataViewFrame = [self frameOfDataViewAtColumn:column row:row];
[dataView setFrame:dataViewFrame];
if (tableColumn === _outlineTableColumn)
{
var control = _disclosureControlsForRows[row],
frame = [self frameOfOutlineDisclosureControlAtRow:row];
[control setFrame:frame];
}
var frame = [self frameOfOutlineDisclosureControlAtRow:row];
[control setFrame:frame];
}
}
}];
[self setNeedsDisplay:YES];
}
/*!
@@ -1587,7 +1540,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
var outlineColumn = [[self tableColumns] indexOfObjectIdenticalTo:[self outlineTableColumn]];
if (![columns containsIndex:outlineColumn] || [self outlineTableColumn] === _draggedColumn)
if (![columns containsIndex:outlineColumn] || outlineColumn === _draggedColumnIndex)
return;
var rowArray = [];
@@ -1890,6 +1843,14 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
return _implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_dataViewForTableColumn_item_;
}
- (id)_hitTest:(CPView)aView
{
if ([aView isKindOfClass:[CPDisclosureButton class]])
return aView;
return [super _hitTest:aView];
}
- (BOOL)_delegateRespondsToShouldExpandItem
{
return _implementedOutlineViewDelegateMethods & CPOutlineViewDelegate_outlineView_shouldExpandItem_;
+1 -2
View File
@@ -646,9 +646,8 @@ CPSegmentSwitchTrackingMomentary = 2;
if (i == count - 1)
continue;
var borderState = _themeStates[i].and(_themeStates[i + 1]);
borderState = (borderState.hasThemeState(CPThemeStateSelected) && !borderState.hasThemeState(CPThemeStateHighlighted)) ? CPThemeStateSelected : CPThemeStateNormal;
var borderState = _themeStates[i].and(_themeStates[i + 1]);
borderState = isDisabled ? borderState.and(CPThemeStateDisabled) : borderState;
+18 -7
View File
@@ -180,7 +180,7 @@ CPTableColumnUserResizingMask = 1 << 1;
columns = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(index, [tableView._exposedColumns lastIndex] - index + 1)];
// FIXME: Would be faster with some sort of -setNeedsDisplayInColumns: that updates a dirtyTableColumnForDisplay cache; then marked columns would relayout their data views at display time.
[tableView _layoutDataViewsInRows:rows columns:columns];
[tableView _layoutViewsForRowIndexes:rows columnIndexes:columns];
[tableView tile];
if (!_disableResizingPosting)
@@ -393,8 +393,8 @@ CPTableColumnUserResizingMask = 1 << 1;
*/
- (void)setDataView:(CPView)aView
{
if (_dataView)
_dataViewData = nil;
if (_dataView === aView)
return;
[aView setThemeState:CPThemeStateTableDataView];
@@ -546,11 +546,22 @@ CPTableColumnUserResizingMask = 1 << 1;
- (void)setValueFor:(CPString)aBinding
{
var tableView = [_source tableView],
column = [[tableView tableColumns] indexOfObjectIdenticalTo:_source],
rowIndexes = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, [tableView numberOfRows])],
columnIndexes = [CPIndexSet indexSetWithIndex:column];
newNumberOfRows = [tableView _numberOfRows];
[tableView reloadDataForRowIndexes:rowIndexes columnIndexes:columnIndexes];
if ([tableView numberOfRows] == newNumberOfRows)
{
var rowIndexes = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, newNumberOfRows)],
column = [[tableView tableColumns] indexOfObjectIdenticalTo:_source],
columnIndexes = [CPIndexSet indexSetWithIndex:column];
// Reloads objectValues only, not the views.
// FIXME: reload data for all rows or just rows intersecting exposed rows ?
[tableView _reloadDataForRowIndexes:rowIndexes columnIndexes:columnIndexes];
}
else
{
[tableView reloadData];
}
}
- (CPSortDescriptor)_defaultSortDescriptorPrototype
+394 -357
View File
File diff suppressed because it is too large. Load diff
+738 -629
View File
File diff suppressed because it is too large. Load diff
+15
View File
@@ -1033,6 +1033,21 @@ CPTokenFieldDeleteButtonType = 1;
[[[self window] platformWindow] _propagateCurrentDOMEvent:YES];
}
- (BOOL)performKeyEquivalent:(CPEvent)anEvent
{
var characters = [anEvent characters];
// Here we handle the event when getting a CPNewlineCharacter or CPCarriageReturnCharacter when the menu is open
// We don't want that the application dispatches the event to the other controls
if ([self hasThemeState:CPThemeStateAutocompleting] && (characters === CPNewlineCharacter || characters === CPCarriageReturnCharacter))
{
[self keyDown:anEvent];
return YES;
}
return [super performKeyEquivalent:anEvent];
}
- (void)textDidChange:(CPNotification)aNotification
{
if ([aNotification object] !== self)
+60 -9
View File
@@ -129,6 +129,8 @@ var CPViewFlags = { },
CPViewHasCustomDrawRect = 1 << 0,
CPViewHasCustomLayoutSubviews = 1 << 1;
var CPViewHighDPIDrawingEnabled = YES;
/*!
@ingroup appkit
@@ -208,6 +210,10 @@ var CPViewFlags = { },
CGSize _hierarchyScaleSize;
CGSize _scaleSize;
// Drawing high DPI
BOOL _needToSetTransformMatrix;
float _highDPIRatio;
// Layout Support
BOOL _needsLayout;
JSObject _ephemeralSubviews;
@@ -270,6 +276,24 @@ var CPViewFlags = { },
return [super _binderClassForBinding:aBinding];
}
/*!
Controls whether high DPI drawing is activated or not. Defaults to YES.
@param isEnabled YES to enable high DPI drawing
*/
+ (void)setHighDPIDrawingEnabled:(BOOL)isEnabled
{
CPViewHighDPIDrawingEnabled = isEnabled;
}
/*!
Returns whether high DPI drawing is enabled.
@return BOOL - YES if high DPI drawing is activated, otherwise NO.
*/
+ (BOOL)isHighDPIDrawingEnabled
{
return CPViewHighDPIDrawingEnabled;
}
- (void)_setupViewFlags
{
var theClass = [self class],
@@ -1075,12 +1099,6 @@ var CPViewFlags = { },
#if PLATFORM(DOM)
[self _setDisplayServerSetStyleSize:size];
if (_DOMContentsElement)
{
CPDOMDisplayServerSetSize(_DOMContentsElement, size.width, size.height);
CPDOMDisplayServerSetStyleSize(_DOMContentsElement, size.width, size.height);
}
if (_backgroundType !== BackgroundTrivialColor)
{
if (_backgroundType === BackgroundTransparentColor)
@@ -1205,7 +1223,16 @@ var CPViewFlags = { },
{
#if PLATFORM(DOM)
var scale = [self scaleSize];
CPDOMDisplayServerSetStyleSize(_DOMElement, aSize.width * 1 / scale.width, aSize.height * 1 / scale.height);
if (_DOMContentsElement)
{
CPDOMDisplayServerSetSize(_DOMContentsElement, aSize.width * _highDPIRatio * 1 / scale.width, aSize.height * _highDPIRatio * 1 / scale.height);
CPDOMDisplayServerSetStyleSize(_DOMContentsElement, aSize.width * 1 / scale.width, aSize.height * 1 / scale.height);
_needToSetTransformMatrix = YES;
}
#endif
}
@@ -2534,7 +2561,11 @@ setBoundsOrigin:
#if PLATFORM(DOM)
var width = CGRectGetWidth(_frame),
height = CGRectGetHeight(_frame);
height = CGRectGetHeight(_frame),
devicePixelRatio = window.devicePixelRatio || 1,
backingStoreRatio = CPBrowserBackingStorePixelRatio(graphicsPort);
_highDPIRatio = CPViewHighDPIDrawingEnabled ? (devicePixelRatio / backingStoreRatio) : 1;
_DOMContentsElement = graphicsPort.DOMElement;
@@ -2544,7 +2575,7 @@ setBoundsOrigin:
_DOMContentsElement.style.position = "absolute";
_DOMContentsElement.style.visibility = "visible";
CPDOMDisplayServerSetSize(_DOMContentsElement, width, height);
CPDOMDisplayServerSetSize(_DOMContentsElement, width * _highDPIRatio, height * _highDPIRatio);
CPDOMDisplayServerSetStyleLeftTop(_DOMContentsElement, NULL, 0.0, 0.0);
CPDOMDisplayServerSetStyleSize(_DOMContentsElement, width, height);
@@ -2557,8 +2588,15 @@ setBoundsOrigin:
CPDOMDisplayServerAppendChild(_DOMElement, _DOMContentsElement);
#endif
_graphicsContext = [CPGraphicsContext graphicsContextWithGraphicsPort:graphicsPort flipped:YES];
_needToSetTransformMatrix = YES;
}
#if PLATFORM(DOM)
if (_needToSetTransformMatrix)
[_graphicsContext graphicsPort].setTransform(_highDPIRatio, 0, 0 , _highDPIRatio, 0, 0);
#endif
_needToSetTransformMatrix = NO;
[CPGraphicsContext setCurrentContext:_graphicsContext];
CGContextSaveGState([_graphicsContext graphicsPort]);
@@ -2576,14 +2614,27 @@ setBoundsOrigin:
- (void)setNeedsLayout
{
if (!(_viewClassFlags & CPViewHasCustomLayoutSubviews))
[self setNeedsLayout:YES];
}
- (void)setNeedsLayout:(BOOL)needLayout
{
if (!(_viewClassFlags & CPViewHasCustomLayoutSubviews) || !needLayout)
{
_needsLayout = NO;
return;
}
_needsLayout = YES;
_CPDisplayServerAddLayoutObject(self);
}
- (BOOL)needsLayout
{
return _needsLayout;
}
- (void)layoutIfNeeded
{
if (_needsLayout)
+6 -156
View File
@@ -20,34 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define DOM_OPTIMIZATION 0
#define SetStyleOrigin 0
#define SetStyleLeftTop 0
#define SetStyleRightTop 1
#define SetStyleLeftBottom 2
#define SetStyleRightBottom 3
#define SetStyleSize 4
#define SetSize 5
#define AppendChild 6
#define InsertBefore 7
#define RemoveChild 8
#define CPDOMDisplayServerSetStyleOrigin(anInstruction, aDOMElement, aTransform, x, y)\
if (!aDOMElement.CPDOMDisplayContext)\
aDOMElement.CPDOMDisplayContext = [];\
var __index = aDOMElement.CPDOMDisplayContext[SetStyleOrigin];\
if (!(__index >= 0))\
{\
__index = aDOMElement.CPDOMDisplayContext[SetStyleOrigin] = CPDOMDisplayServerInstructionCount;\
CPDOMDisplayServerInstructionCount += 5;\
}\
CPDOMDisplayServerInstructions[__index] = anInstruction;\
CPDOMDisplayServerInstructions[__index + 1] = aDOMElement;\
CPDOMDisplayServerInstructions[__index + 2] = aTransform;\
CPDOMDisplayServerInstructions[__index + 3] = x;\
CPDOMDisplayServerInstructions[__index + 4] = y;
#if !DOM_OPTIMIZATION
#define CPDOMDisplayServerSetStyleLeftTop(aDOMElement, aTransform, aLeft, aTop) \
if (aTransform) var ____p = CGPointApplyAffineTransform(CGPointMake(aLeft, aTop), aTransform); \
else var ____p = CGPointMake(aLeft, aTop); \
@@ -83,136 +55,14 @@ aDOMElement.style.bottom = ROUND(____p.y) + "px";
#define CPDOMDisplayServerSetStyleBackgroundSize(aDOMElement, aWidth, aHeight)\
aDOMElement.style.backgroundSize = aWidth + ' ' + aHeight;
#define CPDOMDisplayServerAppendChild(aParentElement, aChildElement) aParentElement.appendChild(aChildElement)
#define CPDOMDisplayServerAppendChild(aParentElement, aChildElement) \
aParentElement.appendChild(aChildElement);
#define CPDOMDisplayServerInsertBefore(aParentElement, aChildElement, aBeforeElement) aParentElement.insertBefore(aChildElement, aBeforeElement)
#define CPDOMDisplayServerInsertBefore(aParentElement, aChildElement, aBeforeElement) \
aParentElement.insertBefore(aChildElement, aBeforeElement);
#define CPDOMDisplayServerRemoveChild(aParentElement, aChildElement) aParentElement.removeChild(aChildElement)
#define CPDOMDisplayServerRemoveChild(aParentElement, aChildElement) \
aParentElement.removeChild(aChildElement);
#define PREPARE_DOM_OPTIMIZATION()
#define EXECUTE_DOM_INSTRUCTIONS()
#else
#define CPDOMDisplayServerSetStyleLeftTop(aDOMElement, aTransform, aLeft, aTop) CPDOMDisplayServerSetStyleOrigin(SetStyleLeftTop, aDOMElement, aTransform, aLeft, aTop)
#define CPDOMDisplayServerSetStyleRightTop(aDOMElement, aTransform, aRight, aTop) CPDOMDisplayServerSetStyleOrigin(SetStyleRightTop, aDOMElement, aTransform, aRight, aTop)
#define CPDOMDisplayServerSetStyleLeftBottom(aDOMElement, aTransform, aLeft, aBottom) CPDOMDisplayServerSetStyleOrigin(SetStyleLeftBottom, aDOMElement, aTransform, aLeft, aBottom)
#define CPDOMDisplayServerSetStyleRightBottom(aDOMElement, aTransform, aRight, aBottom) CPDOMDisplayServerSetStyleOrigin(SetStyleRightBottom, aDOMElement, aTransform, aRight, aBottom)
#define CPDOMDisplayServerSetStyleSize(aDOMElement, aWidth, aHeight)\
if (!aDOMElement.CPDOMDisplayContext)\
aDOMElement.CPDOMDisplayContext = [];\
var __index = aDOMElement.CPDOMDisplayContext[SetStyleSize];\
if (!(__index >= 0))\
{\
__index = aDOMElement.CPDOMDisplayContext[SetStyleSize] = CPDOMDisplayServerInstructionCount;\
CPDOMDisplayServerInstructionCount += 4;\
}\
CPDOMDisplayServerInstructions[__index] = SetStyleSize;\
CPDOMDisplayServerInstructions[__index + 1] = aDOMElement;\
CPDOMDisplayServerInstructions[__index + 2] = aWidth;\
CPDOMDisplayServerInstructions[__index + 3] = aHeight;
#define CPDOMDisplayServerSetSize(aDOMElement, aWidth, aHeight)\
if (!aDOMElement.CPDOMDisplayContext)\
aDOMElement.CPDOMDisplayContext = [];\
var __index = aDOMElement.CPDOMDisplayContext[SetSize];\
if (!(__index >= 0))\
{\
__index = aDOMElement.CPDOMDisplayContext[SetSize] = CPDOMDisplayServerInstructionCount;\
CPDOMDisplayServerInstructionCount += 4;\
}\
CPDOMDisplayServerInstructions[__index] = SetSize;\
CPDOMDisplayServerInstructions[__index + 1] = aDOMElement;\
CPDOMDisplayServerInstructions[__index + 2] = aWidth;\
CPDOMDisplayServerInstructions[__index + 3] = aHeight;
#define CPDOMDisplayServerSetStyleBackgroundSize(aDOMElement, aWidth, aHeight)\
aDOMElement.style.backgroundSize = aWidth + ' ' + aHeight;
#define CPDOMDisplayServerAppendChild(aParentElement, aChildElement)\
if (aChildElement.CPDOMDisplayContext) aChildElement.CPDOMDisplayContext[SetStyleOrigin] = -1;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = AppendChild;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aParentElement;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aChildElement;
#define CPDOMDisplayServerInsertBefore(aParentElement, aChildElement, aBeforeElement)\
if (aChildElement.CPDOMDisplayContext) aChildElement.CPDOMDisplayContext[SetStyleOrigin] = -1;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = InsertBefore;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aParentElement;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aChildElement;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aBeforeElement;
#define CPDOMDisplayServerRemoveChild(aParentElement, aChildElement)\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = RemoveChild;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aParentElement;\
CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++] = aChildElement;
#define PREPARE_DOM_OPTIMIZATION()\
CPDOMDisplayServerInstructions = [];\
CPDOMDisplayServerInstructionCount = 0;
#define EXECUTE_DOM_INSTRUCTIONS()\
var index = 0;\
while (index < CPDOMDisplayServerInstructionCount)\
{\
var instruction = CPDOMDisplayServerInstructions[index++];\
try{\
switch (instruction)\
{\
case SetStyleLeftTop:\
case SetStyleRightTop:\
case SetStyleLeftBottom:\
case SetStyleRightBottom: var element = CPDOMDisplayServerInstructions[index],\
style = element.style,\
x = (instruction == SetStyleLeftTop || instruction == SetStyleLeftBottom) ? "left" : "right",\
y = (instruction == SetStyleLeftTop || instruction == SetStyleRightTop) ? "top" : "bottom";\
CPDOMDisplayServerInstructions[index++] = nil;\
var transform = CPDOMDisplayServerInstructions[index++];\
if (transform)\
{\
var point = CGPointMake(CPDOMDisplayServerInstructions[index++], CPDOMDisplayServerInstructions[index++]),\
transformed = CGPointApplyAffineTransform(point, transform);\
style[x] = ROUND(transformed.x) + "px";\
style[y] = ROUND(transformed.y) + "px";\
}\
else\
{\
style[x] = ROUND(CPDOMDisplayServerInstructions[index++]) + "px";\
style[y] = ROUND(CPDOMDisplayServerInstructions[index++]) + "px";\
}\
element.CPDOMDisplayContext[SetStyleOrigin] = -1;\
break;\
case SetStyleSize: var element = CPDOMDisplayServerInstructions[index],\
style = element.style;\
CPDOMDisplayServerInstructions[index++] = nil;\
element.CPDOMDisplayContext[SetStyleSize] = -1;\
style.width = MAX(0.0, ROUND(CPDOMDisplayServerInstructions[index++])) + "px";\
style.height = MAX(0.0, ROUND(CPDOMDisplayServerInstructions[index++])) + "px";\
break;\
case SetSize: var element = CPDOMDisplayServerInstructions[index];\
CPDOMDisplayServerInstructions[index++] = nil;\
element.CPDOMDisplayContext[SetSize] = -1;\
element.width = MAX(0.0, ROUND(CPDOMDisplayServerInstructions[index++]));\
element.height = MAX(0.0, ROUND(CPDOMDisplayServerInstructions[index++]));\
break;\
case AppendChild: CPDOMDisplayServerInstructions[index].appendChild(CPDOMDisplayServerInstructions[index + 1]);\
CPDOMDisplayServerInstructions[index++] = nil;\
CPDOMDisplayServerInstructions[index++] = nil;\
break;\
case InsertBefore: CPDOMDisplayServerInstructions[index].insertBefore(CPDOMDisplayServerInstructions[index + 1], CPDOMDisplayServerInstructions[index + 2]);\
CPDOMDisplayServerInstructions[index++] = nil;\
CPDOMDisplayServerInstructions[index++] = nil;\
CPDOMDisplayServerInstructions[index++] = nil;\
break;\
case RemoveChild: CPDOMDisplayServerInstructions[index].removeChild(CPDOMDisplayServerInstructions[index + 1]);\
CPDOMDisplayServerInstructions[index++] = nil;\
CPDOMDisplayServerInstructions[index++] = nil;\
break;\
}\
}\
catch(e) { CPLog("e " + e + " " + instruction); }\
}\
CPDOMDisplayServerInstructionCount = 0;
#endif
+2
View File
@@ -1482,6 +1482,8 @@ var themedButtonValues = nil,
[@"font", [CPFont systemFontOfSize:CPFontCurrentSystemSize], CPThemeStateNormal],
[@"text-color", regularDisabledTextColor, CPThemeStateDisabled],
[@"text-color", [CPColor colorWithCalibratedWhite:51.0 / 255.0 alpha:1.0], CPThemeStateTableDataView],
[@"text-color", [CPColor whiteColor], [CPThemeStateTableDataView, CPThemeStateSelectedDataView, CPThemeStateFirstResponder, CPThemeStateKeyWindow]],
[@"image-offset", CPCheckBoxImageOffset],
// CPThemeStateControlSizeRegular
+16 -2
View File
@@ -181,7 +181,14 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
return;
_isObservingFrame = YES;
[_targetView addObserver:self forKeyPath:@"frame" options:0 context:nil];
var view = _targetView;
while (view)
{
[view addObserver:self forKeyPath:@"frame" options:0 context:nil];
view = [view superview];
}
}
/*!
@@ -194,7 +201,14 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
return;
_isObservingFrame = NO;
[_targetView removeObserver:self forKeyPath:@"frame"];
var view = _targetView;
while (view)
{
[view removeObserver:self forKeyPath:@"frame"];
view = [view superview];
}
}
/*!
+86 -1
View File
@@ -22,7 +22,7 @@
@import "CPObject.j"
var _CPCollectionKVCOperatorSimpleRE = /^@(avg|count|m(ax|in)|sum)(\.|$)/;
var _CPCollectionKVCOperatorSimpleRE = /^@(avg|count|m(ax|in)|sum|unionOfObjects|distinctUnionOfObjects|unionOfArrays|distinctUnionOfArrays|distinctUnionOfSets)(\.|$)/;
@implementation _CPCollectionKVCOperator : CPObject
@@ -125,4 +125,89 @@ var _CPCollectionKVCOperatorSimpleRE = /^@(avg|count|m(ax|in)|sum)(\.|$)/;
return [aCollection count];
}
+ (CPArray)unionOfObjectsForCollection:(id)aCollection propertyPath:(CPString)propertyPath
{
if (!propertyPath)
return [aCollection valueForUndefinedKey:@"@unionOfObjects"];
var objects = [aCollection valueForKeyPath:propertyPath];
if ([objects isKindOfClass:[CPSet class]])
return [objects allObjects];
return objects;
}
+ (CPArray)distinctUnionOfObjectsForCollection:(id)aCollection propertyPath:(CPString)propertyPath
{
if (!propertyPath)
return [aCollection valueForUndefinedKey:@"@distinctUnionOfObjects"];
var objects = [aCollection valueForKeyPath:propertyPath],
distinctObjects = [CPMutableArray new],
enumerator = [objects objectEnumerator],
object;
while ((object = [enumerator nextObject]) !== nil)
{
if ([distinctObjects indexOfObject:object] == CPNotFound)
[distinctObjects addObject:object];
}
return distinctObjects;
}
+ (CPArray)unionOfArraysForCollection:(id)aCollection propertyPath:(CPString)propertyPath
{
if (!propertyPath)
return [aCollection valueForUndefinedKey:@"@unionOfArrays"];
var objects = [],
number = [aCollection count];
for (var i = 0; i < number; i++)
[objects addObjectsFromArray:[aCollection[i] valueForKeyPath:propertyPath]];
return objects;
}
+ (CPArray)distinctUnionOfArraysForCollection:(id)aCollection propertyPath:(CPString)propertyPath
{
if (!propertyPath)
return [aCollection valueForUndefinedKey:@"@distinctUnionOfArrays"];
var objects = [],
number = [aCollection count];
for (var i = 0; i < number; i++)
[objects addObjectsFromArray:[aCollection[i] valueForKeyPath:propertyPath]];
var distinctObjects = [CPMutableArray new],
enumerator = [objects objectEnumerator],
object;
while ((object = [enumerator nextObject]) !== nil)
{
if ([distinctObjects indexOfObject:object] == CPNotFound)
[distinctObjects addObject:object];
}
return distinctObjects;
}
+ (CPArray)distinctUnionOfSetsForCollection:(id)aCollection propertyPath:(CPString)propertyPath
{
if (!propertyPath)
return [aCollection valueForUndefinedKey:@"@distinctUnionOfSets"];
var objects = [CPMutableSet new],
number = [aCollection count],
sets = [aCollection allObjects];
for (var i = 0; i < number; i++)
[objects addObjectsFromArray:[[sets[i] valueForKeyPath:propertyPath] allObjects]];
return objects;
}
@end
+98
View File
@@ -0,0 +1,98 @@
@import <OJUnit/OJTestCase.j>
#include "../../AppKit/Platform/DOM/CPDOMDisplayServer.h"
@implementation CPDOMDisplayServerTest : OJTestCase
{
JSObject DOMElement;
BOOL aTransform;
}
- (void)setUp
{
// set up a dummy DOM element.
DOMElement = {
style: {
}
};
aTransform = NO;
}
- (void)testSetStyleRightBottom
{
var aRight = 10,
aBottom = 10;
CPDOMDisplayServerSetStyleRightBottom(DOMElement, aTransform, aRight, aBottom);
[self assert:DOMElement.style.right equals:"10px"];
[self assert:DOMElement.style.bottom equals:"10px"];
}
- (void)testSetStyleLeftBottom
{
var aLeft = 10,
aBottom = 10;
CPDOMDisplayServerSetStyleLeftBottom(DOMElement, aTransform, aLeft, aBottom);
[self assert:DOMElement.style.bottom equals:"10px"];
[self assert:DOMElement.style.left equals:"10px"];
}
- (void)testSetStyleLeftTop
{
var aTop = 10,
aLeft = 10;
CPDOMDisplayServerSetStyleLeftTop(DOMElement, aTransform, aLeft, aTop);
[self assert:DOMElement.style.top equals:"10px"];
[self assert:DOMElement.style.left equals:"10px"];
}
- (void)testSetStyleRightTop
{
var aTop = 10,
aRight = 10;
CPDOMDisplayServerSetStyleRightTop(DOMElement, aTransform, aRight, aTop);
[self assert:DOMElement.style.top equals:"10px"];
[self assert:DOMElement.style.right equals:"10px"];
}
- (void)testSetStyleWithTransform
{
aTransform = CGAffineTransformMakeTranslation(10, 10);
CPDOMDisplayServerSetStyleRightTop(DOMElement, aTransform, 10, 10)
[self assert:DOMElement.style.top equals:"20px"];
[self assert:DOMElement.style.right equals:"20px"];
}
- (void)testSetStyleSize
{
var width = 10,
height = 10;
CPDOMDisplayServerSetStyleSize(DOMElement, width, height);
[self assert:DOMElement.style.width equals:"10px"];
[self assert:DOMElement.style.height equals:"10px"];
}
- (void)testSetElementSize
{
var width = 10,
height = 10;
CPDOMDisplayServerSetSize(DOMElement, width, height);
[self assert:DOMElement.width equals:10];
[self assert:DOMElement.height equals:10];
}
@end
+2 -2
View File
@@ -32,14 +32,14 @@
[self assert:1 equals:[stepper doubleValue]];
}
- (void)testPerformIncreaseWithIncrement
- (void)testPerformClickUpIncreaseWithIncrement
{
[stepper setIncrement:10];
[stepper performClickUp:nil];
[self assert:10 equals:[stepper doubleValue]];
}
- (void)testPerformIncreaseWithIncrement
- (void)testPerformClickDownIncreaseWithIncrement
{
[stepper setIncrement:10];
[stepper performClickDown:nil];
+63
View File
@@ -0,0 +1,63 @@
@import <AppKit/AppKit.j>
[CPApplication sharedApplication];
@implementation CPTableViewReloadDataTest : OJTestCase
{
CPWindow theWindow;
CPTableView tableView;
CPArray tableContent;
}
- (void)setUp
{
tableContent = [];
// setup a reasonable table
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
styleMask:CPWindowNotSizable];
tableView = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
[tableView setDataSource:self];
var itemIndex = 0,
items = [@"Colonne1", @"Colonne2", @"Colonne3", @"Colonne4"];
for (itemIndex ; itemIndex < [items count]; itemIndex++)
{
var item = [items objectAtIndex:itemIndex],
column = [[CPTableColumn alloc] initWithIdentifier:item];
[column setEditable:YES];
[column setMinWidth:50];
[[column headerView] setStringValue:item];
[tableView addTableColumn:column];
}
[[theWindow contentView] addSubview:tableView];
}
- (void)testReloadDataAfterModelCountChangesFromZero
{
tableContent = ["A", "B", "C"];
[tableView reloadData];
[tableView _enumerateViewsInRows:[CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, 3)] columns:[CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, 4)] usingBlock:function(view, row, column, stop)
{
var tableColumn = [[tableView tableColumns] objectAtIndex:column],
expected = [tableColumn identifier] + "_" + [tableContent objectAtIndex:row];
[self assertTrue:([view stringValue] == expected)];
}];
}
- (int)numberOfRowsInTableView:(CPTableView)aTableView
{
return [tableContent count];
}
- (id)tableView:(CPTableView)aTableView objectValueForTableColumn:(CPTableColumn)aColumn row:(int)aRowIndex
{
return [aColumn identifier] + "_" + [tableContent objectAtIndex:aRowIndex];
}
@end
+68
View File
@@ -0,0 +1,68 @@
@import <AppKit/AppKit.j>
[CPApplication sharedApplication];
@implementation CPTableViewTableColumnTest : OJTestCase
{
CPWindow theWindow;
CPTableView tableView;
}
- (void)setUp
{
// setup a reasonable table
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
styleMask:CPWindowNotSizable];
tableView = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
[tableView setDataSource:self];
var itemIndex = 0,
items = [@"Colonne1", @"Colonne2", @"Colonne3", @"Colonne4"];
for (itemIndex ; itemIndex < [items count]; itemIndex++)
{
var item = [items objectAtIndex:itemIndex],
column = [[CPTableColumn alloc] initWithIdentifier:item];
[column setEditable:YES];
[column setMinWidth:50];
[[column headerView] setStringValue:item];
[tableView addTableColumn:column];
}
[[theWindow contentView] addSubview:tableView];
[tableView reloadData];
}
- (void)testRemoveTableColumn
{
[self assertTrue:([[tableView tableColumns] count] == 4)];
[tableView removeTableColumn:[[tableView tableColumns] firstObject]];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
[self assertTrue:([[tableView tableColumns] count] == 3)];
[tableView removeTableColumn:[[tableView tableColumns] firstObject]];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
[self assertTrue:([[tableView tableColumns] count] == 2)];
[tableView enumerateAvailableViewsUsingBlock:function(view, row, column, stop)
{
var tableColumn = [[tableView tableColumns] objectAtIndex:column];
[self assert:("COLUMN_" + [tableColumn identifier] + "ROW_" + row) equals:[view objectValue]];
}];
}
- (int)numberOfRowsInTableView:(CPTableView)aTableView
{
return 15;
}
- (id)tableView:(CPTableView)aTableView objectValueForTableColumn:(CPTableColumn)aColumn row:(int)aRowIndex
{
return "COLUMN_" + [aColumn identifier] + "ROW_" + aRowIndex;
}
@end
+331 -13
View File
@@ -18,8 +18,7 @@
- (void)setUp
{
// setup a reasonable table
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
styleMask:CPWindowNotSizable];
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0) styleMask:CPWindowNotSizable];
tableView = [[FirstResponderConfigurableTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
tableColumn = [[CPTableColumn alloc] initWithIdentifier:@"Foo"];
@@ -98,19 +97,15 @@
[self assert:0 equals:selectionIsChangingNotificationsReceived message:"no isChanging notifications when programmatically selecting rows"];
[self assert:1 equals:selectionDidChangeNotificationsReceived message:"didChange notifications when selecting rows"];
// If we remove the last row, the selection should change and we should be notified.
[[dataSource tableEntries] removeObjectAtIndex:2];
[tableView reloadData];
[self assert:0 equals:selectionIsChangingNotificationsReceived message:"no isChanging notifications when selected rows disappear"];
[self assert:2 equals:selectionDidChangeNotificationsReceived message:"didChange notifications when selected rows disappear"];
selectionIsChangingNotificationsReceived = 0;
selectionDidChangeNotificationsReceived = 0;
[tableView selectRowIndexes:[CPIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
[self assert:selectionDidChangeNotificationsReceived equals:3 message:"CPTableViewSelectionDidChangeNotification expected when selecting rows"];
[self assert:selectionDidChangeNotificationsReceived equals:1 message:"CPTableViewSelectionDidChangeNotification expected when selecting rows"];
[[dataSource tableEntries] removeObjectAtIndex:1];
[tableView reloadData];
[self assert:selectionDidChangeNotificationsReceived equals:3 message:"no CPTableViewSelectionDidChangeNotification expected when removing a row which does not change the selection"];
[self assert:selectionDidChangeNotificationsReceived equals:1 message:"no CPTableViewSelectionDidChangeNotification expected when removing a row which does not change the selection"];
// Reset everything.
[dataSource setTableEntries:["A", "B", "C"]];
@@ -125,7 +120,18 @@
selectionIsChangingNotificationsReceived = 0;
selectionDidChangeNotificationsReceived = 0;
[tableView deselectAll];
[self assert:selectionDidChangeNotificationsReceived equals:2 message:"notification for deselect all"];
[self assert:1 equals:selectionDidChangeNotificationsReceived message:"notification for deselect all"];
[tableView selectRowIndexes:[CPIndexSet indexSetWithIndex:2] byExtendingSelection:NO];
selectionIsChangingNotificationsReceived = 0;
selectionDidChangeNotificationsReceived = 0;
// If we remove the last row, the selection should change and we should be notified.
[[dataSource tableEntries] removeObjectAtIndex:2];
[tableView reloadData];
[self assert:0 equals:selectionIsChangingNotificationsReceived message:"no isChanging notifications when selected rows disappear"];
[self assert:1 equals:selectionDidChangeNotificationsReceived message:"didChange notifications when selected rows disappear"];
}
- (void)selectionIsChanging:(CPNotification)aNotification
@@ -158,10 +164,10 @@
// Now some text field should be the first responder.
var fieldEditor = [theWindow firstResponder];
[self assert:[fieldEditor class] equals:CPTextField message:"table cell editor should be a text field"];
[self assert:CPTextField equals:[fieldEditor class] message:"table cell editor should be a text field"];
[fieldEditor setStringValue:"edited text"];
[fieldEditor performClick:nil];
[theWindow makeFirstResponder:tableView];
[self assert:"edited text" equals:[dataSource tableEntries][1] message:"table cell edit should propagate to model"]
@@ -200,6 +206,7 @@
[tableColumn setDataView:[CustomTextView0 new]];
[tableColumn1 setDataView:[CustomTextView1 new]];
// Process all events immediately to make sure table data views are reloaded.
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
[self assert:50 equals:[tableView numberOfRows] message:"tableView numberOfRows should reflect content array length"];
@@ -270,6 +277,53 @@
[contentBindingTable reloadData];
}
- (void)testColumnValueBinding
{
var table = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)],
container = [TestDataSource new];
var tc = [[CPTableColumn alloc] initWithIdentifier:@"A"];
[table addTableColumn:tc];
[container setTableEntries:@[@{@"name":@"B1"}, @{@"name":@"B2"}, @{@"name":@"B3"}]];
var ac = [[CPArrayController alloc] init];
[ac bind:@"contentArray" toObject:container withKeyPath:@"tableEntries" options:nil];
[tc bind:@"value" toObject:ac withKeyPath:@"arrangedObjects.name" options:nil];
[[theWindow contentView] addSubview:table];
[theWindow makeFirstResponder:table];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
// Should remove all table rows.
[self assertNoThrow:function()
{
[container setTableEntries:@[]];
}];
[container setTableEntries:@[@{@"name":@"B1"}, @{@"name":@"B2"}, @{@"name":@"B3"}]];
[self assertNoThrow:function()
{
[container setTableEntries:nil];
}];
[container setTableEntries:@[@{@"name":@"B1"}, @{@"name":@"B2"}, @{@"name":@"B3"}]];
// Change a value in row 0. The number of rows stays the same.
[container setTableEntries:@[@{@"name":@"B4"}, @{@"name":@"B2"}, @{@"name":@"B3"}]];
// Checks that the displayed data matches the model data.
[table enumerateAvailableViewsUsingBlock:function(dataView, aRow, aColumn, stop)
{
var data_value = [[[container tableEntries] objectAtIndex:aRow] objectForKey:@"name"];
[self assert:[dataView objectValue] equals:data_value];
}];
// We could also check that the dataviews in rows 1 and 2 are identical to the ones before mutation.
}
- (void)testInitiallyHiddenColumns
{
var table = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)],
@@ -305,6 +359,101 @@
[self assertTrue:[table bounds].size.width >= 200];
}
// Test internal method - (void)getColumn:(Function)columnRef row:(Function)rowRef forView:(CPView)aView
- (void)testGetColumnAndRow
{
var table = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)],
tableColumn1 = [[CPTableColumn alloc] initWithIdentifier:@"A"],
tableColumn2 = [[CPTableColumn alloc] initWithIdentifier:@"B"],
delegate = [ContentBindingTableDelegate new];
[delegate setTester:self];
[table setDelegate:delegate];
[delegate setTableEntries:[[@"A1", @"B1"], [@"A2", @"B2"], [@"A3", @"B3"]]];
[table bind:@"content" toObject:delegate withKeyPath:@"tableEntries" options:nil];
[[theWindow contentView] addSubview:table];
[tableColumn1 setWidth:50.0];
[tableColumn2 setWidth:100.0];
[table addTableColumn:tableColumn1];
[table addTableColumn:tableColumn2];
var table2 = [[CPTableView alloc] initWithFrame:CGRectMake(400, 0, 400, 400)],
table2Column1 = [[CPTableColumn alloc] initWithIdentifier:@"A"],
table2Column2 = [[CPTableColumn alloc] initWithIdentifier:@"B"],
delegate = [ContentBindingTableDelegate new];
[delegate setTester:self];
[table2 setDelegate:delegate];
[delegate setTableEntries:[[@"A1", @"B1"], [@"A2", @"B2"], [@"A3", @"B3"]]];
[table2 bind:@"content" toObject:delegate withKeyPath:@"tableEntries" options:nil];
[[theWindow contentView] addSubview:table2];
[table2Column1 setWidth:50.0];
[table2Column2 setWidth:100.0];
[table2 addTableColumn:tableColumn1];
[table2 addTableColumn:tableColumn2];
var row,
column;
// get row and column for a nil view
[table getColumn:@ref(column) row:@ref(row) forView:nil];
[self assert:CPNotFound equals:column];
[self assert:CPNotFound equals:row];
// get row and column for a random view
var v = [[CPView alloc] initWithFrame:CGRectMake(0,0,100,100)];
[table getColumn:@ref(column) row:@ref(row) forView:v];
[self assert:CPNotFound equals:column];
[self assert:CPNotFound equals:row];
// get row and column for the table view
[table getColumn:@ref(column) row:@ref(row) forView:table];
[self assert:CPNotFound equals:column];
[self assert:CPNotFound equals:row];
// get row and column for a view outside a table column
[table getColumn:@ref(column) row:@ref(row) forView:[theWindow contentView]];
[self assert:CPNotFound equals:column];
[self assert:CPNotFound equals:row];
// Enumerate views inside the table view and check that rows and columns are correct
[table enumerateAvailableViewsUsingBlock:function(dataView, aRow, aColumn, stop)
{
var getRow,
getColumn;
[table getColumn:@ref(getColumn) row:@ref(getRow) forView:dataView];
[self assert:aColumn equals:getColumn];
[self assert:aRow equals:getRow];
}];
// Enumerate views inside a different table view and check that rows and columns are not found
[table2 enumerateAvailableViewsUsingBlock:function(dataView, aRow, aColumn, stop)
{
var getRow,
getColumn;
[table getColumn:@ref(getColumn) row:@ref(getRow) forView:dataView];
[self assert:CPNotFound equals:getRow];
[self assert:CPNotFound equals:getColumn];
}];
}
-(void)testNotificationsRegistered
{
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:[@"_CPWindowDidChangeFirstResponderNotification"] message:@"Notications registered for the tableView in the notification center are wrong"];
@@ -332,6 +481,158 @@
[scrollView removeFromSuperview];
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:[] message:@"Notications registered for the tableView in the notification center are wrong"];
}
- (void)testTableDataViewState
{
var textField = [[CPTextField alloc] initWithFrame:CGRectMake(110, 0, 100, 32)];
[textField setEditable:YES];
[[theWindow contentView] addSubview:textField];
var dataSource = [TestDataSource new];
[dataSource setTableEntries:["A", "B", "C"]];
[tableView setDataSource:dataSource];
[tableView setDelegate:[EditableTableDelegate new]];
[theWindow makeFirstResponder:tableView];
[tableView selectRowIndexes:[CPIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
[tableView enumerateAvailableViewsUsingBlock:function(dataView, row, column, stop)
{
if (row == 0)
{
[self assertTrue:[dataView hasThemeState:CPThemeStateTableDataView] message:"CPThemeStateTableDataView should be enabled"];
[self assertTrue:[dataView hasThemeState:CPThemeStateSelectedDataView] message:"CPThemeStateSelectedDataView should be enabled"];
[self assertTrue:[dataView hasThemeState:CPThemeStateFirstResponder] message:"CPThemeStateFirstResponder should be enabled"];
}
if (row == 1)
{
[self assertTrue:[dataView hasThemeState:CPThemeStateTableDataView] message:"CPThemeStateTableDataView should be enabled"];
[self assertFalse:[dataView hasThemeState:CPThemeStateSelectedDataView] message:"CPThemeStateSelectedDataView should be disabled"];
[self assertTrue:[dataView hasThemeState:CPThemeStateFirstResponder] message:"CPThemeStateFirstResponder should be enabled"];
}
}];
[tableView selectRowIndexes:[CPIndexSet indexSetWithIndex:1] byExtendingSelection:NO];
[tableView enumerateAvailableViewsUsingBlock:function(dataView, row, column, stop)
{
if (row == 0)
{
[self assertTrue:[dataView hasThemeState:CPThemeStateTableDataView] message:"CPThemeStateTableDataView should be enabled"];
[self assertFalse:[dataView hasThemeState:CPThemeStateSelectedDataView] message:"CPThemeStateSelectedDataView should be disabled"];
[self assertTrue:[dataView hasThemeState:CPThemeStateFirstResponder] message:"CPThemeStateFirstResponder should be enabled"];
}
}];
[theWindow makeFirstResponder:textField];
[tableView enumerateAvailableViewsUsingBlock:function(dataView, row, column, stop)
{
if (row == 0)
{
[self assertTrue:[dataView hasThemeState:CPThemeStateTableDataView] message:"CPThemeStateTableDataView should be enabled"];
[self assertFalse:[dataView hasThemeState:CPThemeStateSelectedDataView] message:"CPThemeStateSelectedDataView should be disabled"];
[self assertFalse:[dataView hasThemeState:CPThemeStateFirstResponder] message:"CPThemeStateFirstResponder should be disabled"];
}
if (row == 1)
{
[self assertTrue:[dataView hasThemeState:CPThemeStateTableDataView] message:"CPThemeStateTableDataView should be enabled"];
[self assertTrue:[dataView hasThemeState:CPThemeStateSelectedDataView] message:"CPThemeStateSelectedDataView should be enabled"];
[self assertFalse:[dataView hasThemeState:CPThemeStateFirstResponder] message:"CPThemeStateFirstResponder should be disabled"];
}
}];
}
- (void)testMethodViewAtColumnWithMakeIfNecessarySetToNo
{
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, 100.0, 100.0)];
[scrollView setDocumentView:tableView];
var dataSource = [TestDataSource new];
[tableView setDelegate:[CustomeSizeTableDelegate new]];
[dataSource setTableEntries:["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]];
[tableView setDataSource:dataSource];
// Process all events immediately to make sure table data views are reloaded.
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
var view = [tableView viewAtColumn:0 row:0 makeIfNecessary:NO];
[self assert:[view objectValue] equals:@"A" message:@"View should be equal to A"];
[self assert:[view superview] equals:tableView message:@"Superview of view should be the tableview"];
view = [tableView viewAtColumn:0 row:25 makeIfNecessary:NO];
[self assert:view equals:nil message:@"View should be equal to nil"];
}
- (void)testMethodViewAtColumnWithMakeIfNecessarySetToYes
{
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, 100.0, 100.0)];
[scrollView setDocumentView:tableView];
var dataSource = [TestDataSource new];
[tableView setDelegate:[CustomeSizeTableDelegate new]];
[dataSource setTableEntries:["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]];
[tableView setDataSource:dataSource];
// Process all events immediately to make sure table data views are reloaded.
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
var view = [tableView viewAtColumn:0 row:0 makeIfNecessary:YES];
[self assert:[view objectValue] equals:@"A" message:@"View should be equal to A"];
[self assert:[view superview] equals:tableView message:@"Superview of view should be the tableview"];
view = [tableView viewAtColumn:0 row:25 makeIfNecessary:YES];
[self assert:[view objectValue] equals:@"Z" message:@"View should be equal to Z"];
[self assert:[view superview] equals:tableView message:@"Superview of view should be the tableview"];
}
- (void)testMethodViewAtColumnException
{
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, 100.0, 100.0)];
[scrollView setDocumentView:tableView];
var dataSource = [TestDataSource new];
[tableView setDelegate:[CustomeSizeTableDelegate new]];
[dataSource setTableEntries:["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]];
[tableView setDataSource:dataSource];
// Process all events immediately to make sure table data views are reloaded.
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
var expectedMessage = @"Row 26 out of row range [0-25] for rowViewAtRow:createIfNeeded:",
exceptionMessage = @"";
try
{
[tableView viewAtColumn:0 row:26 makeIfNecessary:YES];
}
catch (e)
{
exceptionMessage = e.message;
}
[self assert:expectedMessage equals:exceptionMessage];
expectedMessage = @"Column 2 out of row range [0-0] for rowViewAtRow:createIfNeeded:";
try
{
[tableView viewAtColumn:2 row:2 makeIfNecessary:YES];
}
catch (e)
{
exceptionMessage = e.message;
}
[self assert:expectedMessage equals:exceptionMessage];
}
@@ -371,6 +672,23 @@
@end
@implementation CustomeSizeTableDelegate : CPObject
{
}
- (float)tableView:(CPTableView)aTableView heightOfRow:(CPInteger)aRowIndex
{
return 200;
}
- (CPView)tableView:(CPTableView)aTableView viewForTableColumn:(CPTableColumn)aTableColumn row:(CPInteger)aRowIndex
{
return [[CPTextField alloc] initWithFrame:CGRectMake(0,0, 100, 100)];
}
@end
@implementation EditableTableDelegate : CPObject
{
}
+70
View File
@@ -643,8 +643,78 @@ var methodCalled;
[self assert:expectedRestult equals:methodCalled];
}
- (void)testLayoutSubviews
{
var layoutView = [[CPLayoutView alloc] initWithFrame:CGRectMakeZero()];
[layoutView setIdentifier:@"layoutView"];
[[window contentView] addSubview:layoutView];
[layoutView setNeedsLayout]
methodCalled = [];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
var expectedRestult = ["layoutSubivews_layoutView"];
[self assert:expectedRestult equals:methodCalled];
[layoutView setNeedsLayout]
[layoutView setNeedsLayout]
methodCalled = [];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
expectedRestult = ["layoutSubivews_layoutView"];
[self assert:expectedRestult equals:methodCalled];
[layoutView setNeedsLayout:YES]
methodCalled = [];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
expectedRestult = ["layoutSubivews_layoutView"];
[self assert:expectedRestult equals:methodCalled];
[layoutView setNeedsLayout:YES];
[layoutView setNeedsLayout:NO];
methodCalled = [];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
expectedRestult = [];
[self assert:expectedRestult equals:methodCalled];
[layoutView setNeedsLayout:YES];
[layoutView setNeedsLayout:NO];
[layoutView setNeedsLayout:YES];
methodCalled = [];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
expectedRestult = ["layoutSubivews_layoutView"];
[self assert:expectedRestult equals:methodCalled];
}
@end
@implementation CPLayoutView : CPView
{
}
- (void)layoutSubviews
{
[super layoutSubviews];
var string = @"layoutSubivews_" + [self identifier];
[methodCalled addObject:string];
}
@end
@implementation CPResponderView : CPView
+15 -23
View File
@@ -251,7 +251,13 @@ function descriptionWithoutEntity(aString)
{
var set1 = [CPIndexSet indexSetWithIndex:7],
set2 = [CPIndexSet indexSetWithIndex:7],
set3 = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(7, 2)];
set3 = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(7, 2)],
differentSet = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(10, 11)],
equalSet = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(10, 10)];
[self assertFalse:[_set isEqualToIndexSet:differentSet]];
[self assertTrue:[_set isEqualToIndexSet:equalSet]];
[self assertTrue:[_set isEqualToIndexSet:_set]];
[self assertFalse:[set1 isEqualToIndexSet:nil]];
[self assertTrue:[set1 isEqualToIndexSet:set2]];
@@ -263,7 +269,14 @@ function descriptionWithoutEntity(aString)
{
var set1 = [CPIndexSet indexSetWithIndex:7],
set2 = [CPIndexSet indexSetWithIndex:7],
set3 = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(7, 2)];
set3 = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(7, 2)],
differentSet = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(10, 11)],
equalSet = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(10, 10)];
[self assertFalse:[_set isEqual:nil]];
[self assertFalse:[_set isEqual:differentSet]];
[self assertTrue:[_set isEqual:equalSet]];
[self assertTrue:[_set isEqual:_set]];
[self assertFalse:[set1 isEqual:nil]];
[self assertFalse:[set1 isEqual:7]];
@@ -398,27 +411,6 @@ function descriptionWithoutEntity(aString)
[self assert:[_set count] equals:0];
}
- (void)testIsEqual
{
var differentSet = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(10, 11)],
equalSet = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(10, 10)];
[self assertFalse:[_set isEqual:nil]];
[self assertFalse:[_set isEqual:differentSet]];
[self assertTrue:[_set isEqual:equalSet]];
[self assertTrue:[_set isEqual:_set]];
}
- (void)testIsEqualToIndexSet
{
var differentSet = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(10, 11)],
equalSet = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(10, 10)];
[self assertFalse:[_set isEqualToIndexSet:differentSet]];
[self assertTrue:[_set isEqualToIndexSet:equalSet]];
[self assertTrue:[_set isEqualToIndexSet:_set]];
}
- (void)testEnumerateIndexesUsingBlock_
{
var set0 = [CPIndexSet indexSet],
+122 -6
View File
@@ -331,20 +331,27 @@ var COUNTER;
message:@"removeObjectFromValuesAtIndex: should have been called 10 times and insertObject:inValuesAtIndex: 2 times"];
}
- (void)testKVCArrayOperators
- (void)testKVCCountArrayOperators
{
var one = [1, 1, 1, 1, 1, 1, 1, 1],
two = [1, 2, 3, 4, 8, 0];
[self assert:[one valueForKey:"@count"] equals:8];
[self assert:[one valueForKeyPath:"@sum.intValue"] equals:8];
[self assert:[two valueForKeyPath:"@avg.intValue"] equals:3];
[self assert:[two valueForKeyPath:"@max.intValue"] equals:8];
[self assert:[two valueForKeyPath:"@min.intValue"] equals:0];
var a = [AA new];
[a setValue:one forKey:"b"];
[self assert:[a valueForKeyPath:"b.@count"] equals:8];
}
- (void)testKVCSumArrayOperators
{
var one = [1, 1, 1, 1, 1, 1, 1, 1],
two = [1, 2, 3, 4, 8, 0];
[self assert:[one valueForKeyPath:"@sum.intValue"] equals:8];
var a = [AA new];
[a setValue:one forKey:"b"];
[self assert:[a valueForKeyPath:"b.@sum.intValue"] equals:8];
var b = [];
@@ -352,13 +359,122 @@ var COUNTER;
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@sum.age"] equals:105];
}
- (void)testKVCAvgArrayOperators
{
var one = [1, 1, 1, 1, 1, 1, 1, 1],
two = [1, 2, 3, 4, 8, 0];
[self assert:[two valueForKeyPath:"@avg.intValue"] equals:3];
var b = [];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@avg.age"] equals:35];
}
- (void)testKVCMinArrayOperators
{
var one = [1, 1, 1, 1, 1, 1, 1, 1],
two = [1, 2, 3, 4, 8, 0];
[self assert:[two valueForKeyPath:"@min.intValue"] equals:0];
var b = [];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@min.age"] equals:27];
[self assert:[b valueForKeyPath:@"@max.age"] equals:47];
[self assert:[b valueForKeyPath:@"@min.name"] equals:@"Dick"];
}
- (void)testKVCMaxArrayOperators
{
var one = [1, 1, 1, 1, 1, 1, 1, 1],
two = [1, 2, 3, 4, 8, 0];
[self assert:[two valueForKeyPath:"@max.intValue"] equals:8];
var b = [];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@max.age"] equals:47];
[self assert:[b valueForKeyPath:@"@max.name"] equals:@"Tom"];
}
- (void)testKVCDistinctUnionOfObjectsArrayOperators
{
var b = [];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 67] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@distinctUnionOfObjects.name"] equals:[@"Tom", @"Dick", @"Harry"]];
[self assert:[b valueForKeyPath:@"@distinctUnionOfObjects.age"] equals:[27, 31, 47, 67]];
}
- (void)testKVCUnionOfObjectsArrayOperators
{
var b = [];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 67] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@unionOfObjects.name"] equals:[@"Tom", @"Dick", @"Harry", @"Dick"]];
[self assert:[b valueForKeyPath:@"@unionOfObjects.age"] equals:[27, 31, 47, 67]];
}
- (void)testKVCDistinctUnionOfArraysArrayOperators
{
var b = [];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 67] forKeys:[@"name", @"age"]]];
var c = [];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Jeff", 47] forKeys:[@"name", @"age"]]];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Alex", 27] forKeys:[@"name", @"age"]]];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 57] forKeys:[@"name", @"age"]]];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 67] forKeys:[@"name", @"age"]]];
var all = [b, c];
[self assert:[all valueForKeyPath:@"@distinctUnionOfArrays.name"] equals:[@"Tom", @"Dick", @"Harry", @"Jeff", @"Alex"]];
[self assert:[all valueForKeyPath:@"@distinctUnionOfArrays.age"] equals:[27, 31, 47, 67, 57]];
}
- (void)testKVCUnionOfArraysArrayOperators
{
var b = [];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 67] forKeys:[@"name", @"age"]]];
var c = [];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Jeff", 47] forKeys:[@"name", @"age"]]];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Alex", 27] forKeys:[@"name", @"age"]]];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 57] forKeys:[@"name", @"age"]]];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 67] forKeys:[@"name", @"age"]]];
var all = [b, c];
[self assert:[all valueForKeyPath:@"@unionOfArrays.name"] equals:[@"Tom", @"Dick", @"Harry", @"Dick", @"Jeff", @"Alex", @"Harry", @"Dick"]];
[self assert:[all valueForKeyPath:@"@unionOfArrays.age"] equals:[27, 31, 47, 67, 47, 27, 57, 67]];
}
@end
@implementation AA : CPObject
-22
View File
@@ -176,28 +176,6 @@
[self assert:array equals:[arrayClass array]];
}
- (void)test_removeAllObjects
{
var arrayClass = [[self class] arrayClass],
array = [arrayClass array];
[array removeAllObjects];
[self assert:0 same:[array count]];
[self assert:[arrayClass array] equals:array];
array = [arrayClass arrayWithObjects:0, 1, 2, 3, 4, 5, 6];
[array removeAllObjects];
[self assert:0 same:[array count]];
[self assert:[arrayClass array] equals:array];
array = [arrayClass arrayWithObjects:0, 1, 2, 3, 4, 5, 6, [arrayClass arrayWithObjects:0, 1, 2]];
[array removeAllObjects];
[self assert:0 same:[array count]];
[self assert:[arrayClass array] equals:array];
}
- (void)test_setArray_
{
var arrayClass = [[self class] arrayClass],
+92 -6
View File
@@ -246,17 +246,64 @@
[self assertSet:set onlyHasObjects:["horizon", "surfer", "7"]];
}
- (void)testKVCSetOperators
- (void)testKVCCountSetOperators
{
var one = [CPSet setWithArray:[@"one", @"two", @"three"]],
two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]];
[self assert:[one valueForKey:"@count"] equals:3];
[self assert:[two valueForKey:"@count"] equals:6];
}
- (void)testKVCSumSetOperators
{
var one = [CPSet setWithArray:[@"one", @"two", @"three"]],
two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]];
[self assert:[two valueForKeyPath:"@sum.intValue"] equals:18];
var b = [CPSet set];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@sum.age"] equals:105];
}
- (void)testKVCAvgSetOperators
{
var one = [CPSet setWithArray:[@"one", @"two", @"three"]],
two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]];
[self assert:[two valueForKeyPath:"@avg.doubleValue"] equals:3.0];
var b = [CPSet set];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@avg.age"] equals:35];
}
- (void)testKVCMaxSetOperators
{
var one = [CPSet setWithArray:[@"one", @"two", @"three"]],
two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]];
[self assert:[one valueForKeyPath:"@max.description"] equals:@"two"];
[self assert:[two valueForKeyPath:"@max.intValue"] equals:8];
var b = [CPSet set];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@max.age"] equals:47];
[self assert:[b valueForKeyPath:@"@max.name"] equals:@"Tom"];
}
- (void)testKVCMinSetOperators
{
var one = [CPSet setWithArray:[@"one", @"two", @"three"]],
two = [CPSet setWithArray:[1, 2, 3, 4, 8, 0]];
[self assert:[one valueForKeyPath:"@min.description"] equals:@"one"];
[self assert:[two valueForKeyPath:"@min.intValue"] equals:0];
@@ -264,12 +311,51 @@
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@sum.age"] equals:105];
[self assert:[b valueForKeyPath:@"@avg.age"] equals:35];
[self assert:[b valueForKeyPath:@"@min.age"] equals:27];
[self assert:[b valueForKeyPath:@"@max.age"] equals:47];
[self assert:[b valueForKeyPath:@"@min.name"] equals:@"Dick"];
[self assert:[b valueForKeyPath:@"@max.name"] equals:@"Tom"];
}
- (void)testKVCDistinctUnionOfObjectsSetOperators
{
var b = [CPSet set];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 67] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@distinctUnionOfObjects.name"] equals:[@"Tom", @"Dick", @"Harry"]];
[self assert:[b valueForKeyPath:@"@distinctUnionOfObjects.age"] equals:[27, 31, 47, 67]];
}
- (void)testKVCUnionOfObjectsSetOperators
{
var b = [CPSet set];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 67] forKeys:[@"name", @"age"]]];
[self assert:[b valueForKeyPath:@"@unionOfObjects.name"] equals:[@"Tom", @"Dick", @"Harry"]];
[self assert:[b valueForKeyPath:@"@unionOfObjects.age"] equals:[27, 31, 47, 67]];
}
- (void)testKVCDistinctUnionOfSetsSetOperators
{
var b = [CPSet set];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[b addObject:[CPDictionary dictionaryWithObjects:[@"Harry", 47] forKeys:[@"name", @"age"]]];
var c = [CPSet set];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Tom", 27] forKeys:[@"name", @"age"]]];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Dick", 31] forKeys:[@"name", @"age"]]];
[c addObject:[CPDictionary dictionaryWithObjects:[@"Alex", 52] forKeys:[@"name", @"age"]]];
var all = [CPSet set];
[all addObject:b];
[all addObject:c];
[self assert:[all valueForKeyPath:@"@distinctUnionOfSets.name"] equals:[[CPSet alloc] initWithObjects:@"Tom", @"Dick", @"Harry", @"Alex"]];
[self assert:[all valueForKeyPath:@"@distinctUnionOfSets.age"] equals:[[CPSet alloc] initWithObjects:27, 31, 47, 52]];
}
- (void)testMember
+1 -1
View File
@@ -83,7 +83,7 @@
[self assert:timeZone equals:nil];
}
- (void)testexceptionTimeZoneWithNilNameWithData
- (void)testexceptionTimeZoneWithNilName
{
try
{
+22 -2
View File
@@ -66,7 +66,7 @@ var objj_message = function(receiver, selector, args)
rdesc = receiver ? [receiver description] : "<null>";
while (c--)
sel.splice(c + 1, 0, ":" + [args[c] description] + " ");
sel.splice(c + 1, 0, ":" + Description(args[c], c) + " ");
var joined = sel.join("");
@@ -76,6 +76,26 @@ var objj_message = function(receiver, selector, args)
return ("[" + rdesc + " " + joined + "]");
};
function Description(object, argn)
{
if (object.isa)
return [object description];
var type = typeof(object);
if (type === "function")
return "Function";
else if (type !== "object")
return "Arg" + argn;
var desc = [];
for(var p in object)
desc.push(p + ":" + object[p]);
return ("{" + desc.join(",") + "}");
}
function CPTrace(aClassName, aSelector, displayFunction)
{
var aclass = CPClassFromString(aClassName);
@@ -220,7 +240,7 @@ var getMethodNoSuper = function(cls, sel)
/*
Utility for moving average
*/
var moving_averager = function(period)
function moving_averager(period)
{
var nums = [];
@@ -10,12 +10,14 @@
@import <AppKit/CPTableColumn.j>
@import <AppKit/CPTableView.j>
CPLogRegister(CPLogConsole);
@implementation AppController : CPObject
{
CPArray rowData;
CPArray rowEdits;
Int numberOfRows;
Int numberOfEditsKept;
CPInteger numberOfRows;
CPInteger numberOfEditsKept;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
@@ -26,7 +28,7 @@
// Initialize data structures.
numberOfRows = 10;
numberOfRows = 100;
numberOfEditsKept = 6;
var i = numberOfRows;
@@ -104,6 +106,7 @@
- (void)tableView:(CPTableView)tableView setObjectValue:(id)aValue forTableColumn:(CPTableColumn)tableColumn row:(CPInteger)aRow
{
CPLog.debug(_cmd + tableColumn + aRow + aValue);
var name = [tableColumn identifier];
switch (name)
@@ -113,6 +116,7 @@
rowEdits[aRow].unshift(rowData[aRow]);
rowEdits[aRow].pop;
rowData[aRow] = aValue;
[tableView reloadData];
break;
}
}
@@ -7,6 +7,7 @@
*/
@import <Foundation/CPObject.j>
@import "../../CPTrace.j"
CPLogRegister(CPLogConsole);
@@ -20,6 +21,16 @@ CPLogRegister(CPLogConsole);
{
// This is called when the application is done loading.
iconImage = [[CPImage alloc] initWithContentsOfFile:"http://cappuccino-project.org/img/favicon.ico" size:CGSizeMake(16,16)];
var averager = moving_averager(50);
CPTrace("CPTableView", "load", function(receiver, selector, args, duration)
{
if (duration)
console.log(receiver + " " + selector + " in " + averager(duration));
});
CPTrace("CPTableHeaderView", "_startDraggingTableColumn:at:");
}
- (void)awakeFromCib
@@ -0,0 +1,90 @@
/*
* AppController.j
* TestTableColumn
*
* Created by You on April 16, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
//@import "../../CPTrace.j"
CPLogRegister(CPLogConsole);
@implementation AppController : CPObject
{
@outlet CPWindow theWindow;
@outlet CPTableView tableView;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
//CPTrace("CPTableView", "_unloadDataViewsInRows:columns:");
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
[self _initializeSpreadSheetColumns];
}
- (void)_initializeSpreadSheetColumns
{
var itemIndex = 0,
items = [@"Colonne1", @"Colonne2", @"Colonne3", @"Colonne4"];
for (itemIndex ; itemIndex < [items count]; itemIndex++)
{
var item = [items objectAtIndex:itemIndex],
column = [[CPTableColumn alloc] initWithIdentifier:item];
[column setEditable:YES];
[column setMinWidth:50];
[[column headerView] setStringValue:item];
[tableView addTableColumn:column];
}
}
- (@action)click:(id)sender
{
console.log("Before NumberOfColumns : " + [[tableView tableColumns] count]);
var selectedColumn = [tableView selectedColumn];
if (selectedColumn !== CPNotFound)
[tableView removeTableColumn:[[tableView tableColumns] objectAtIndex:selectedColumn]];
console.log("After NumberOfColumns : " + [[tableView tableColumns] count]);
var tableColunms = [tableView tableColumns],
fails = NO;
[tableView enumerateAvailableViewsUsingBlock:function(view,row,column,stop)
{
if (([tableColunms[column] identifier] + " " + row ) != [view objectValue])
{
fails = YES;
stop(YES);
}
}];
CPLog.debug("Test that data views are in the right place : " + (fails ? "FAILS":"SUCCESS"));
}
- (int)numberOfRowsInTableView:(CPTableView)aTableView
{
return 15;
}
- (id)tableView:(CPTableView)aTableView objectValueForTableColumn:(CPTableColumn)aColumn row:(int)aRowIndex
{
return [aColumn identifier] + " " + aRowIndex;
}
@end
@@ -0,0 +1,14 @@
<?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>TestTableColumn</string>
<key>CPBundleVersion</key>
<string>1.0</string>
<key>CPHumanReadableCopyright</key>
<string>Copyright © 2013, Your Company All rights reserved.</string>
</dict>
</plist>
@@ -0,0 +1,93 @@
/*
* Jakefile
* TestTableColumn
*
* Created by You on April 16, 2013.
* Copyright 2013, 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 ("TestTableColumn", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "TestTableColumn.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("TestTableColumn");
task.setIdentifier("com.yourcompany.TestTableColumn");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("TestTableColumn");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["TestTableColumn"], 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", "TestTableColumn", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "TestTableColumn", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "TestTableColumn"));
OS.system(["press", "-f", FILE.join("Build", "Release", "TestTableColumn"), FILE.join("Build", "Deployment", "TestTableColumn")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "TestTableColumn"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "TestTableColumn"), FILE.join("Build", "Desktop", "TestTableColumn", "TestTableColumn.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "TestTableColumn", "TestTableColumn.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "TestTableColumn"));
print("----------------------------");
}
@@ -0,0 +1,4 @@
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;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;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;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;21E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;40E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;11E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;41E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;42E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;40E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;43E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;40E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;30E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;44E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;40E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;24E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;45E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;30E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;40E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;46E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;30E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;40E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;43E;E;D;K;10;$classnameS;21;CPCibControlConnectorK;8;$classesA;S;21;CPCibControlConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;39E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;40E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;47E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;41E;E;D;K;10;$classnameS;20;_CPCibWindowTemplateK;8;$classesA;S;20;_CPCibWindowTemplateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;23E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;2;48E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;2;49E;K;30;_CPCibWindowTemplateWTFlagsKeyD;K;6;CP$UIDd;2;50E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;2;51E;K;33;_CPCibWindowTemplateScreenRectKeyD;K;6;CP$UIDd;2;52E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;2;53E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;2;54E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;2;26E;E;D;K;10;$classnameS;6;CPViewK;8;$classesA;S;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;25E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;55E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;56E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;56E;K;17;CPViewSubviewsKeyD;K;6;CP$UIDd;2;57E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;58E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;2;59E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;2;59E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;2;60E;E;D;K;10;$classnameS;12;CPScrollViewK;8;$classesA;S;12;CPScrollViewS;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;27E;K;27;CPRespLine truncated
- Resize any column.
The column should be removed. You should not see any bold text
in the data views. The data views should not disappear when you resize a column.D;K;6;$classD;K;6;CP$UIDd;2;74E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;132E;E;S;23;{{360, 449}, {187, 25}}S;19;{{0, 0}, {187, 25}}S;6;buttonS;27;bordered+controlSizeRegularS;22;Remove Selected ColumnS;0;d;2;14S;13;AppControllerS;20;{{1, 1}, {525, 304}}D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;30E;E;E;d;2;18D;K;6;$classD;K;6;CP$UIDd;2;74E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;133E;E;S;6;_NS:11S;21;{{1, 305}, {525, 17}}S;19;{{0, 0}, {525, 17}}D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;34E;E;E;S;6;_NS:15S;16;{{0, 0}, {0, 0}}D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;134E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;134E;E;E;S;20;{{224, 0}, {14, 25}}S;18;{{0, 0}, {14, 25}}S;10;cornerviewS;6;_NS:19S;17;.Lucida Grande UId;2;13D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;134E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;134E;E;E;d;1;1f;3;0.8f;18;0.6862745098039216E;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E;
@@ -0,0 +1,515 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">13F34</string>
<string key="IBDocument.InterfaceBuilderVersion">6246</string>
<string key="IBDocument.AppKitVersion">1265.21</string>
<string key="IBDocument.HIToolboxVersion">698.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">6246</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSButton</string>
<string>NSButtonCell</string>
<string>NSCustomObject</string>
<string>NSScrollView</string>
<string>NSScroller</string>
<string>NSTableHeaderView</string>
<string>NSTableView</string>
<string>NSTextField</string>
<string>NSTextFieldCell</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<object class="NSCustomObject" id="1021">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSCustomObject" id="1014">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1050">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">7</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{335, 390}, {576, 490}}</string>
<int key="NSWTFlags">1946157056</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSScrollView" id="937357377">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSClipView" id="1049983858">
<reference key="NSNextResponder" ref="937357377"/>
<int key="NSvFlags">2322</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTableView" id="221694406">
<reference key="NSNextResponder" ref="1049983858"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{525, 304}</string>
<reference key="NSSuperview" ref="1049983858"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="809719892"/>
<string key="NSReuseIdentifierKey">_NS:13</string>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<bool key="NSControlAllowsExpansionToolTips">YES</bool>
<object class="NSTableHeaderView" key="NSHeaderView" id="353947893">
<reference key="NSNextResponder" ref="386377955"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{525, 17}</string>
<reference key="NSSuperview" ref="386377955"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1049983858"/>
<string key="NSReuseIdentifierKey">_NS:16</string>
<reference key="NSTableView" ref="221694406"/>
</object>
<object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{224, 0}, {16, 17}}</string>
<reference key="NSNextKeyView" ref="1049983858"/>
<string key="NSReuseIdentifierKey">_NS:19</string>
</object>
<array class="NSMutableArray" key="NSTableColumns"/>
<double key="NSIntercellSpacingWidth">3</double>
<double key="NSIntercellSpacingHeight">2</double>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="NSGridColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">gridColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
</object>
<double key="NSRowHeight">17</double>
<int key="NSTvFlags">-698351616</int>
<reference key="NSDelegate"/>
<reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">4</int>
<int key="NSDraggingSourceMaskForLocal">15</int>
<int key="NSDraggingSourceMaskForNonLocal">0</int>
<bool key="NSAllowsTypeSelect">YES</bool>
<int key="NSTableViewDraggingDestinationStyle">0</int>
<int key="NSTableViewGroupRowStyle">1</int>
</object>
</array>
<string key="NSFrame">{{1, 17}, {525, 304}}</string>
<reference key="NSSuperview" ref="937357377"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="221694406"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
<reference key="NSDocView" ref="221694406"/>
<object class="NSColor" key="NSBGColor" id="50405468">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlBackgroundColor</string>
<object class="NSColor" key="NSColor" id="866913092">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<int key="NScvFlags">4</int>
</object>
<object class="NSScroller" id="809719892">
<reference key="NSNextResponder" ref="937357377"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{224, 17}, {15, 102}}</string>
<reference key="NSSuperview" ref="937357377"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1007762720"/>
<string key="NSReuseIdentifierKey">_NS:58</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<reference key="NSTarget" ref="937357377"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.95065789473684215</double>
</object>
<object class="NSScroller" id="1007762720">
<reference key="NSNextResponder" ref="937357377"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, 305}, {433, 16}}</string>
<reference key="NSSuperview" ref="937357377"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="756226510"/>
<string key="NSReuseIdentifierKey">_NS:60</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="937357377"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.9622222222222222</double>
</object>
<object class="NSClipView" id="386377955">
<reference key="NSNextResponder" ref="937357377"/>
<int key="NSvFlags">2338</int>
<array class="NSMutableArray" key="NSSubviews">
<reference ref="353947893"/>
</array>
<string key="NSFrame">{{1, 0}, {525, 17}}</string>
<reference key="NSSuperview" ref="937357377"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="353947893"/>
<string key="NSReuseIdentifierKey">_NS:15</string>
<reference key="NSDocView" ref="353947893"/>
<reference key="NSBGColor" ref="50405468"/>
<int key="NScvFlags">4</int>
</object>
</array>
<string key="NSFrame">{{20, 55}, {527, 322}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="386377955"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">133682</int>
<reference key="NSVScroller" ref="809719892"/>
<reference key="NSHScroller" ref="1007762720"/>
<reference key="NSContentView" ref="1049983858"/>
<reference key="NSHeaderClipView" ref="386377955"/>
<bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
<double key="NSMinMagnification">0.25</double>
<double key="NSMaxMagnification">4</double>
<double key="NSMagnification">1</double>
</object>
<object class="NSButton" id="756226510">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{354, 13}, {199, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="323872087">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Remove Selected Column</string>
<object class="NSFont" key="NSSupport" id="1038338288">
<bool key="IBIsSystemFont">YES</bool>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="756226510"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSTextField" id="429678766">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{18, 409}, {531, 68}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="937357377"/>
<string key="NSReuseIdentifierKey">_NS:526</string>
<string key="NSHuggingPriority">{251, 750}</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="660287246">
<int key="NSCellFlags">68157504</int>
<int key="NSCellFlags2">272630784</int>
<string type="base64-UTF8" key="NSContents">LSBTZWxlY3QgYSB0YWJsZSBjb2x1bW4gYW5kIHJlbW92ZSBpdC4KLSBSZXNpemUgYW55IGNvbHVtbi4K
VGhlIGNvbHVtbiBzaG91bGQgYmUgcmVtb3ZlZC4gWW91IHNob3VsZCBub3Qgc2VlIGFueSBib2xkIHRl
eHQgCmluIHRoZSBkYXRhIHZpZXdzLiBUaGUgZGF0YSB2aWV3cyBzaG91bGQgbm90IGRpc2FwcGVhciB3
aGVuIHlvdSByZXNpemUgYSBjb2x1bW4uA</string>
<reference key="NSSupport" ref="1038338288"/>
<string key="NSCellIdentifier">_NS:526</string>
<reference key="NSControlView" ref="429678766"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<reference key="NSColor" ref="866913092"/>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSTextFieldAlignmentRectInsetsVersion">1</int>
</object>
</array>
<string key="NSFrameSize">{576, 490}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="429678766"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSCustomObject" id="635946545">
<string key="NSClassName">AppController</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1021"/>
<reference key="destination" ref="635946545"/>
</object>
<int key="connectionID">451</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">theWindow</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="972006081"/>
</object>
<int key="connectionID">459</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">tableView</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="221694406"/>
</object>
<int key="connectionID">469</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">click:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="756226510"/>
</object>
<int key="connectionID">472</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="221694406"/>
<reference key="destination" ref="635946545"/>
</object>
<int key="connectionID">483</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="221694406"/>
<reference key="destination" ref="635946545"/>
</object>
<int key="connectionID">484</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1021"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1014"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1050"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">371</int>
<reference key="object" ref="972006081"/>
<array class="NSMutableArray" key="children">
<reference ref="439893737"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">372</int>
<reference key="object" ref="439893737"/>
<array class="NSMutableArray" key="children">
<reference ref="937357377"/>
<reference ref="429678766"/>
<reference ref="756226510"/>
</array>
<reference key="parent" ref="972006081"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">450</int>
<reference key="object" ref="635946545"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">460</int>
<reference key="object" ref="937357377"/>
<array class="NSMutableArray" key="children">
<reference ref="221694406"/>
<reference ref="1007762720"/>
<reference ref="353947893"/>
<reference ref="809719892"/>
</array>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">461</int>
<reference key="object" ref="221694406"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="937357377"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">462</int>
<reference key="object" ref="1007762720"/>
<reference key="parent" ref="937357377"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">463</int>
<reference key="object" ref="353947893"/>
<reference key="parent" ref="937357377"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">464</int>
<reference key="object" ref="809719892"/>
<reference key="parent" ref="937357377"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">470</int>
<reference key="object" ref="756226510"/>
<array class="NSMutableArray" key="children">
<reference ref="323872087"/>
</array>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">471</int>
<reference key="object" ref="323872087"/>
<reference key="parent" ref="756226510"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">485</int>
<reference key="object" ref="429678766"/>
<array class="NSMutableArray" key="children">
<reference ref="660287246"/>
</array>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">486</int>
<reference key="object" ref="660287246"/>
<reference key="parent" ref="429678766"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="371.IBPersistedLastKnownCanvasPosition">{343, 405}</string>
<string key="371.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="371.IBWindowTemplateEditedContentRect">{{303, 221}, {480, 360}}</string>
<integer value="1" key="371.NSWindowTemplate.visibleAtLaunch"/>
<reference key="372.IBNSViewMetadataGestureRecognizers" ref="0"/>
<string key="372.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="450.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="460.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="461.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="462.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="463.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="464.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="470.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="471.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="485.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="486.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">486</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">AppController</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">click:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">click:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">click:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="tableView">NSTableView</string>
<string key="theWindow">NSWindow</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="tableView">
<string key="name">tableView</string>
<string key="candidateClassName">NSTableView</string>
</object>
<object class="IBToOneOutletInfo" key="theWindow">
<string key="name">theWindow</string>
<string key="candidateClassName">NSWindow</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../.XcodeSupport/AppController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">NO</bool>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="4600" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,96 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXFileReference section */
0A344A2F9A031BB2EC0B6F6B /* AppController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = .XcodeSupport/AppController.h; sourceTree = SOURCE_ROOT; };
0FEC49B3806EE9F6A56FFF38 /* xcc_general_include.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = xcc_general_include.h; path = .XcodeSupport/xcc_general_include.h; sourceTree = SOURCE_ROOT; };
3BDA43079FA11781DF405343 /* AppController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppController.m; path = .XcodeSupport/AppController.m; sourceTree = SOURCE_ROOT; };
5BC541719E8140DC69A0E287 /* AppController.j */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppController.j; path = AppController.j; sourceTree = SOURCE_ROOT; };
E164FE29172185F500263CE3 /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
275E4AA7BE4D47921975CAED /* Cocoa Classes */ = {
isa = PBXGroup;
children = (
0A344A2F9A031BB2EC0B6F6B /* AppController.h */,
3BDA43079FA11781DF405343 /* AppController.m */,
0FEC49B3806EE9F6A56FFF38 /* xcc_general_include.h */,
);
name = "Cocoa Classes";
sourceTree = "<group>";
};
BB9D478D9A6A373A957A2B6D /* Cappuccino Source */ = {
isa = PBXGroup;
children = (
5BC541719E8140DC69A0E287 /* AppController.j */,
);
name = "Cappuccino Source";
sourceTree = "<group>";
};
E164FE221721857400263CE3 /* */ = {
isa = PBXGroup;
children = (
E164FE29172185F500263CE3 /* Resources */,
275E4AA7BE4D47921975CAED /* Cocoa Classes */,
BB9D478D9A6A373A957A2B6D /* Cappuccino Source */,
);
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXProject section */
E164FE231721857400263CE3 /* Project Object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0460;
};
buildConfigurationList = E164FE261721857400263CE3 /* Build configuration list for PBXProject "Unity-iPhone" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = E164FE221721857400263CE3 /* */;
projectDirPath = "";
projectRoot = "";
targets = (
);
};
/* End PBXProject section */
/* Begin XCBuildConfiguration section */
E164FE271721857400263CE3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Debug;
};
E164FE281721857400263CE3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
E164FE261721857400263CE3 /* Build configuration list for PBXProject "Unity-iPhone" */ = {
isa = XCConfigurationList;
buildConfigurations = (
E164FE271721857400263CE3 /* Debug */,
E164FE281721857400263CE3 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = E164FE231721857400263CE3 /* Project Object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:TestTableColumn.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<!--
index-debug.html
TestTableColumn
Created by You on April 16, 2013.
Copyright 2013, Your Company All rights reserved.
-->
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
<![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->
<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>TestTableColumn</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
</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);
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
// the class name of the view that created them. Comment this or set to false to disable.
appkit_tag_dom_elements = true;
</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 TestTableColumn...</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-project.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,82 @@
<!DOCTYPE html>
<html lang="en">
<!--
index.html
TestTableColumn
Created by You on April 16, 2013.
Copyright 2013, Your Company All rights reserved.
-->
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
<![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->
<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>TestTableColumn</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 TestTableColumn...</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-project.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
* TestTableColumn
*
* Created by You on April 16, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -8,6 +8,7 @@
@import <Foundation/CPObject.j>
@import <AppKit/CPGraphicsContext.j>
@import "../../CPTrace.j"
var TABLE_DRAG_TYPE = @"TABLE_DRAG_TYPE";
@@ -35,6 +36,16 @@ CPLogRegister(CPLogConsole)
connection = [CPURLConnection connectionWithRequest:request delegate:self];
[tableView registerForDraggedTypes:[CPArray arrayWithObject:TABLE_DRAG_TYPE]];
var averager = moving_averager(50);
CPTrace("CPTableView", "load", function(receiver, selector, args, duration)
{
if (duration)
console.log(receiver + " " + selector + " in " + averager(duration));
});
CPTrace("CPTableHeaderView", "_startDraggingTableColumn:at:");
}
- (void)awakeFromCib
@@ -87,6 +98,20 @@ CPLogRegister(CPLogConsole)
return self;
}
- (void)awakeFromCib
{
// self is the owner parameter specified in -makeViewWithIdentifier:owner:
// This method is called each time a cib containing a CPTableCellView is instantiated.
// Outlets are now connected and available.
// If the view has its own xib, only the view will be instantiated and connected to the owner.
if (externalView)
{
CPLog.debug(_cmd + " loaded externalView : " + externalView);
[[externalView textField] setTextColor:[CPColor greenColor]];
[imageView bind:CPValueURLBinding toObject:externalView withKeyPath:"objectValue.image.path" options:nil];
}
}
- (CPView)makeOrangeView
{
var orangeView = [[CustomView alloc] initWithFrame:CGRectMakeZero()];
@@ -178,19 +203,6 @@ CPLogRegister(CPLogConsole)
return [height intValue];
}
- (void)awakeFromCib
{
// self is the owner parameter specified in -makeViewWithIdentifier:owner:
// This method is called each time a cib containing a CPTableCellView is instantiated.
// Outlets are now connected and available.
// If the view has its own xib, only the view will be instantiated and connected to the owner.
if (externalView)
{
CPLog.debug(_cmd + " loaded externalView : " + externalView);
[[externalView textField] setTextColor:[CPColor greenColor]];
}
}
// CELL VIEWS ACTIONS
- (IBAction)_sliderAction:(id)sender
{
@@ -200,13 +212,18 @@ CPLogRegister(CPLogConsole)
row = [table rowForView:sender];
[table noteHeightOfRowsWithIndexesChanged:[CPIndexSet indexSetWithIndex:row]];
[table reloadData];
}
// Action sent from a cellView subview to its target.
CPLog.debug(_cmd + " value=" + [sender intValue]);
}
- (void)setVariableRowHeight:(BOOL)flag
{
variableRowHeight = flag;
[[self tableView] reloadData];
}
- (IBAction)_textFieldNotBezeledAction:(id)sender
{
CPLog.debug(_cmd + " value=" + [sender stringValue]);
@@ -1 +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;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;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;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;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;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;1;0E;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;43E;D;K;6;CP$UIDd;2;45E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;37E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;46E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;47E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;31E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;48E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;35E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;49E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;33E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;50E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;31E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;51E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;31E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;35E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;49E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;31E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;33E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;50E;E;D;K;10;$classnameS;21;CPCibBindingConnectorK;8;$classesA;S;21;CPCibBindingConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;43E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;11E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;52E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;53E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;54E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;56E;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;37E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;43E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;57E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;58E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;59E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;60E;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;37E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;43E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;61E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;62E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;59E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;63E;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;37E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;43E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;64E;K;31;CPCibBindingConnectorBLine truncated
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;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;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;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;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;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;1;0E;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;42E;D;K;6;CP$UIDd;2;44E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;36E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;45E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;46E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;30E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;47E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;34E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;48E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;32E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;49E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;30E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;50E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;30E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;34E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;48E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;30E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;32E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;49E;E;D;K;10;$classnameS;21;CPCibBindingConnectorK;8;$classesA;S;21;CPCibBindingConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;42E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;11E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;51E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;52E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;53E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;55E;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;36E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;42E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;56E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;57E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;58E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;59E;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;36E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;42E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;60E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UIDd;2;61E;K;31;CPCibBindingConnectorKeyPathKeyD;K;6;CP$UIDd;2;58E;K;31;CPCibBindingConnectorOptionsKeyD;K;6;CP$UIDd;2;62E;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;36E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;42E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;2;63E;K;31;CPCibBindingConnectorBindingKeyD;K;6;CP$UILine truncated
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1070</int>
<string key="IBDocument.SystemVersion">11G63</string>
<string key="IBDocument.InterfaceBuilderVersion">2844</string>
<string key="IBDocument.AppKitVersion">1138.51</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<int key="IBDocument.SystemTarget">101000</int>
<string key="IBDocument.SystemVersion">13F34</string>
<string key="IBDocument.InterfaceBuilderVersion">6250</string>
<string key="IBDocument.AppKitVersion">1265.21</string>
<string key="IBDocument.HIToolboxVersion">698.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">2844</string>
<string key="NS.object.0">6250</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSArrayController</string>
@@ -74,6 +74,7 @@
<int key="NSStyle">0</int>
<bool key="NSAnimates">NO</bool>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<bool key="NSEditable">YES</bool>
</object>
<object class="NSTextField" id="230105450">
@@ -91,7 +92,7 @@
<int key="NSCellFlags2">272631808</int>
<string key="NSContents">Loaded From External Cib</string>
<object class="NSFont" key="NSSupport" id="783725094">
<string key="NSName">LucidaGrande</string>
<bool key="IBIsSystemFont">YES</bool>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
@@ -116,6 +117,8 @@
</object>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSTextFieldAlignmentRectInsetsVersion">1</int>
</object>
<object class="NSPopUpButton" id="474789846">
<reference key="NSNextResponder" ref="867617809"/>
@@ -127,7 +130,7 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="412537776">
<int key="NSCellFlags">-2076049856</int>
<int key="NSCellFlags">-2076180416</int>
<int key="NSCellFlags2">2048</int>
<reference key="NSSupport" ref="783725094"/>
<string key="NSCellIdentifier">_NS:9</string>
@@ -191,6 +194,7 @@
<bool key="NSAltersState">YES</bool>
<int key="NSArrowPosition">2</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
<string key="NSFrameSize">{375, 108}</string>
@@ -209,7 +213,7 @@
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<array key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">textField</string>
@@ -258,26 +262,6 @@
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">valueURL: objectValue.image.path</string>
<reference key="source" ref="624486786"/>
<reference key="destination" ref="867617809"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="624486786"/>
<reference key="NSDestination" ref="867617809"/>
<string key="NSLabel">valueURL: objectValue.image.path</string>
<string key="NSBinding">valueURL</string>
<string key="NSKeyPath">objectValue.image.path</string>
<object class="NSDictionary" key="NSOptions">
<string key="NS.key.0">NSValidatesImmediately</string>
<boolean value="YES" key="NS.object.0"/>
</object>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">163</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">hidden: objectValue.image</string>
@@ -528,15 +512,78 @@
<object class="IBPartialClassDescription">
<string key="className">TableViewDelegate</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="_sliderAction:">id</string>
<string key="_textFieldBezeledAction:">id</string>
<string key="_textFieldNotBezeledAction:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="_sliderAction:">
<string key="name">_sliderAction:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="_textFieldBezeledAction:">
<string key="name">_textFieldBezeledAction:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="_textFieldNotBezeledAction:">
<string key="name">_textFieldNotBezeledAction:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="contentController">NSArrayController</string>
<string key="externalView">NSView</string>
<string key="imageView">NSImageView</string>
<string key="personView">NSView</string>
<string key="placeView">NSView</string>
<string key="textField">NSTextField</string>
<string key="view">NSTableCellView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="contentController">
<string key="name">contentController</string>
<string key="candidateClassName">NSArrayController</string>
</object>
<object class="IBToOneOutletInfo" key="externalView">
<string key="name">externalView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo" key="imageView">
<string key="name">imageView</string>
<string key="candidateClassName">NSImageView</string>
</object>
<object class="IBToOneOutletInfo" key="personView">
<string key="name">personView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo" key="placeView">
<string key="name">placeView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo" key="textField">
<string key="name">textField</string>
<string key="candidateClassName">NSTextField</string>
</object>
<object class="IBToOneOutletInfo" key="view">
<string key="name">view</string>
<string key="candidateClassName">NSTableCellView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/TableViewDelegate.h</string>
<string key="minorKey">../.XcodeSupport/AppController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">NO</bool>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="4600" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+76 -1
View File
@@ -48,6 +48,11 @@ parser.option("-F", "--framework", "framework", "frameworks")
.push()
.help("Additional framework to copy/symlink (default: Objective-J, Foundation, AppKit)");
parser.option("-T", "--theme", "theme", "themes")
.def([])
.push()
.help("Additional Theme to copy/symlink into Resource (default: nothing)");
parser.option("--no-frameworks", "noFrameworks")
.set(true)
.help("Don't copy any default frameworks (can be overridden with -F)");
@@ -145,13 +150,17 @@ function gen(/*va_args*/)
var destinationProject = destination,
configuration = options.noconfig ? [Configuration defaultConfiguration] : [Configuration userConfiguration],
frameworks = options.frameworks;
frameworks = options.frameworks,
themes = options.themes;
if (!options.noFrameworks)
frameworks.push("Objective-J", "Foundation", "AppKit");
if (options.justFrameworks)
{
createFrameworksInFile(frameworks, destinationProject, options.symlink, options.useCappBuild, options.force);
createThemesInFile(themes, destinationProject, options.symlink, options.force);
}
else if (!FILE.exists(destinationProject))
{
@@ -204,6 +213,11 @@ function gen(/*va_args*/)
frameworkDestination = FILE.join(frameworkDestination, config.FrameworksPath);
createFrameworksInFile(frameworks, frameworkDestination, options.symlink, options.useCappBuild);
var themeDestination = destinationProject;
if (themes.length)
createThemesInFile(themes, themeDestination, options.symlink);
}
else
@@ -325,6 +339,67 @@ function installFramework(source, dest, force, symlink)
warn("Cannot find: " + logPath(source));
}
function createThemesInFile(/*Array*/ themes, /*String*/ aFile, /*Boolean*/ symlink, /*Boolean*/ force)
{
var destination = FILE.path(FILE.absolute(aFile));
if (!destination.isDirectory())
fail("Cannot create Themes. The directory does not exist: " + destination);
var destinationThemes = destination.join("Resources");
stream.print("Creating Themes in " + logPath(destinationThemes) + "...");
if (!(SYSTEM.env["CAPP_BUILD"]))
fail("$CAPP_BUILD must be defined to use the --theme or -T option.");
var themesBuild = FILE.join(SYSTEM.env["CAPP_BUILD"], "Release"),
sources = [];
themes.forEach(function(theme)
{
var themeFolder = theme + ".blend",
path = FILE.join(themesBuild, themeFolder);
if (!FILE.isDirectory(path))
fail("Cannot find theme " + themeFolder + " in " + themesBuild);
sources.push([FILE.path(path), themeFolder])
});
sources.forEach(function(source)
{
installTheme(source[0], FILE.path(destinationThemes).join(source[1]), force, symlink);
});
}
function installTheme(source, dest, force, symlink)
{
if (dest.exists())
{
if (force)
dest.rmtree();
else
{
warn(logPath(dest) + " already exists. Use --force to overwrite.");
return;
}
}
if (source.exists())
{
stream.print((symlink ? "Symlinking " : "Copying ") + logPath(source) + " ==> " + logPath(dest));
if (symlink)
FILE.symlink(source, dest);
else
FILE.copyTree(source, dest);
}
else
warn("Cannot find: " + logPath(source));
}
function toIdentifier(/*String*/ aString)
{
var identifier = "",
+1
View File
@@ -47,6 +47,7 @@ function printUsage()
print(" -t, --template NAME Specify the template name to use (see `capp gen --list-templates`)");
print(" -f, --frameworks Copy/symlink *only* the Frameworks directory to a new or existing project");
print(" -F, --framework NAME Additional framework to copy/symlink (default: Objective-J, Foundation, AppKit)")
print(" -T, --theme NAME Additional Theme to copy/symlink into Resource (default: nothing)")
print(" --force Overwrite Frameworks directory if it already exists");
print(" --symlink Symlink the source Frameworks directory to the project, don't copy");
print(" --build Copy/symlink the Frameworks directory files from your $CAPP_BUILD directory");
-2
View File
@@ -43,8 +43,6 @@
_bounds.size.height = height;
_frame.size.height = height;
}
_drawsColumnLines = YES;
}
return self;