test app: CPSelectionIndexesBinding test

This commit is contained in:
cacaodev
2012-12-07 16:51:11 +01:00
parent 4c1ebfbdd4
commit 9a1e75712d
4 changed files with 265 additions and 137 deletions
+19 -3
View File
@@ -26,9 +26,9 @@
@import <Foundation/CPKeyedArchiver.j>
@import <Foundation/CPKeyedUnarchiver.j>
@import "CPView.j"
@import "CPCollectionViewItem.j"
@import "CPCompatibility.j"
@import <AppKit/CPView.j>
@import <AppKit/CPCollectionViewItem.j>
@import <AppKit/CPCompatibility.j>
/*!
@ingroup appkit
@@ -743,6 +743,22 @@
return _backgroundColors;
}
- (void)bind:(CPString)binding toObject:(id)observableController withKeyPath:(CPString)keyPath options:(CPDictionary )options
{
if (binding == CPContentBinding)
[observableController addObserver:self forKeyPath:keyPath options:CPKeyValueObservingOptionOld|CPKeyValueObservingOptionNew context:"content"];
[super bind:binding toObject:observableController withKeyPath:keyPath options:options];
}
- (void)observeValueForKeyPath:(CPString)keyPath ofObject:(id)object change:(CPDictionary)change context:(id)context
{
var newObjects = [change objectForKey:CPKeyValueChangeNewKey];
var kind = [change objectForKey:CPKeyValueChangeKindKey];
CPLog.debug("kind " + kind + " " + [newObjects description]);
}
- (void)mouseUp:(CPEvent)anEvent
{
if ([_selectionIndexes count] && [anEvent clickCount] == 2 && [_delegate respondsToSelector:@selector(collectionView:didDoubleClickOnItemAtIndex:)])