Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b032cd5b7d | ||
|
|
bb589285e3 | ||
|
|
1d52c3e957 | ||
|
|
df5ce9e0f3 | ||
|
|
16b446ae08 | ||
|
|
d0a5b6e1c7 | ||
|
|
271a1ef3b4 | ||
|
|
b91042eb08 | ||
|
|
d40ebaf369 | ||
|
|
06f74e5ef0 | ||
|
|
5eaeb5f05e | ||
|
|
961cb2f6ed | ||
|
|
4dca2bbb85 | ||
|
|
892d3d7120 | ||
|
|
c0fe499937 | ||
|
|
01e8e9e597 | ||
|
|
08b740c36f | ||
|
|
31918bc0cd | ||
|
|
d45aeed224 | ||
|
|
7d2835c522 | ||
|
|
cff26bd4e6 | ||
|
|
936ae1d563 | ||
|
|
3d52935be0 | ||
|
|
777b167a2a | ||
|
|
c5d602bd6d | ||
|
|
8545195cd7 | ||
|
|
74fd73c18d | ||
|
|
2479f15b6b | ||
|
|
75875f4032 | ||
|
|
0752b63b03 | ||
|
|
bde2f20fa3 | ||
|
|
c12305f40a | ||
|
|
2be149c486 | ||
|
|
c7a16deb6f | ||
|
|
1fb8c95b5d | ||
|
|
ad630c840b | ||
|
|
16b52035c1 | ||
|
|
e98cd9e069 | ||
|
|
e99f7261f3 | ||
|
|
85b370e6cf | ||
|
|
c5ab90ae52 | ||
|
|
776cdf93fe | ||
|
|
2bbba19aba | ||
|
|
635a57b036 | ||
|
|
5b231867dc | ||
|
|
6eee5543f9 | ||
|
|
1918528710 | ||
|
|
b007f9899d | ||
|
|
8a460b65ed | ||
|
|
8fa12b874e | ||
|
|
a9edc868f1 | ||
|
|
7e465689e4 | ||
|
|
1cab9463ad | ||
|
|
3974a483d1 | ||
|
|
ecf8f7b143 | ||
|
|
f57755ce46 | ||
|
|
eaa51835ef | ||
|
|
9038b7cfa9 | ||
|
|
8dd174d1e3 | ||
|
|
b9b0eb79d8 | ||
|
|
a5832aa66b | ||
|
|
9472f76ad5 | ||
|
|
4da5669ecb | ||
|
|
c232680600 | ||
|
|
bd25b6fb48 | ||
|
|
834d878a4d | ||
|
|
4cb5ccbc3a | ||
|
|
929cd78bae | ||
|
|
f5961b9e06 | ||
|
|
7fb17e9f41 | ||
|
|
dd70bdc698 | ||
|
|
59d619d190 | ||
|
|
dd160d6bed | ||
|
|
ae5a2c4164 | ||
|
|
a939bed8e0 | ||
|
|
c686a4384b | ||
|
|
6bb2dd2a16 | ||
|
|
2ec574173a | ||
|
|
743feb5360 | ||
|
|
bc4dc041e5 | ||
|
|
8c8d1ae3d3 | ||
|
|
a9781016be | ||
|
|
4be0bb3a30 | ||
|
|
a74267e937 | ||
|
|
6dea853ef3 | ||
|
|
94df530580 | ||
|
|
d038c50531 | ||
|
|
83546d58db | ||
|
|
8de587d4fc | ||
|
|
bd9a6ea150 | ||
|
|
fe69142567 | ||
|
|
5f85f7bef1 | ||
|
|
397e314cc9 | ||
|
|
c87d96676c | ||
|
|
13d4e36d39 | ||
|
|
a5c06c8f27 | ||
|
|
76bdbb660e | ||
|
|
a7929e6c1e | ||
|
|
b3cbc7e362 | ||
|
|
d6b3efaae8 | ||
|
|
33345f65ce | ||
|
|
3fe5ec5d6d | ||
|
|
142b982577 | ||
|
|
147c65b962 | ||
|
|
89dbccd74e | ||
|
|
a4647f2b82 | ||
|
|
94336ebcbb | ||
|
|
5dfa43ce5f | ||
|
|
ff7774976e | ||
|
|
a435e54a67 | ||
|
|
852597f11d | ||
|
|
806fea9222 | ||
|
|
972bb4100f | ||
|
|
6a6b83635f | ||
|
|
d8f202fc1f | ||
|
|
2322743252 | ||
|
|
8b3f9c5557 | ||
|
|
b573daf59b | ||
|
|
4f8fa778d5 | ||
|
|
30d5a7f7a2 | ||
|
|
b01a4436b6 | ||
|
|
9ad8f75a08 | ||
|
|
2bf9afa97a | ||
|
|
9e892d4eea | ||
|
|
d2407d1c2a | ||
|
|
17dc96ad2f | ||
|
|
b3a427ba18 | ||
|
|
4cdefcc2c7 | ||
|
|
b7c0dcf050 | ||
|
|
fe9573e5b8 | ||
|
|
9fcf0258e0 | ||
|
|
e22faa0d79 | ||
|
|
175b204bb6 | ||
|
|
b126b2946d | ||
|
|
fec200c835 | ||
|
|
ea0a47a845 | ||
|
|
835d89774a | ||
|
|
f0a2a91837 | ||
|
|
8614bab724 | ||
|
|
9c181cc9c9 | ||
|
|
a0a7b126ab | ||
|
|
78ddc2db70 | ||
|
|
e80cbc89b2 | ||
|
|
c0f5ed1f87 | ||
|
|
51a8975f0a |
@@ -9,3 +9,4 @@ WebSite
|
|||||||
*.xcodeproj/*.perspectivev3
|
*.xcodeproj/*.perspectivev3
|
||||||
xcuserdata/
|
xcuserdata/
|
||||||
!*.xcodeproj/project.pbxproj
|
!*.xcodeproj/project.pbxproj
|
||||||
|
target
|
||||||
|
|||||||
@@ -37,12 +37,14 @@
|
|||||||
@import "CPCibControlConnector.j"
|
@import "CPCibControlConnector.j"
|
||||||
@import "CPCibLoading.j"
|
@import "CPCibLoading.j"
|
||||||
@import "CPCibOutletConnector.j"
|
@import "CPCibOutletConnector.j"
|
||||||
|
@import "CPCibRuntimeAttributesConnector.j"
|
||||||
@import "CPClipView.j"
|
@import "CPClipView.j"
|
||||||
@import "CPCollectionView.j"
|
@import "CPCollectionView.j"
|
||||||
@import "CPCollectionViewItem.j"
|
@import "CPCollectionViewItem.j"
|
||||||
@import "CPColor.j"
|
@import "CPColor.j"
|
||||||
@import "CPColorPanel.j"
|
@import "CPColorPanel.j"
|
||||||
@import "CPColorWell.j"
|
@import "CPColorWell.j"
|
||||||
|
@import "CPComboBox.j"
|
||||||
@import "CPCompatibility.j"
|
@import "CPCompatibility.j"
|
||||||
@import "CPControl.j"
|
@import "CPControl.j"
|
||||||
@import "CPCookie.j"
|
@import "CPCookie.j"
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ CPRunContinuesResponse = -1002;
|
|||||||
|
|
||||||
CPPanel _aboutPanel;
|
CPPanel _aboutPanel;
|
||||||
|
|
||||||
CPThemeBlend _themeBlend @accessors(property=themeBlend);
|
CPArray _themeBlends @accessors(property=themeBlends);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -141,6 +141,8 @@ CPRunContinuesResponse = -1002;
|
|||||||
_windows = [];
|
_windows = [];
|
||||||
|
|
||||||
[_windows addObject:nil];
|
[_windows addObject:nil];
|
||||||
|
|
||||||
|
_themeBlends = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@@ -338,7 +340,7 @@ CPRunContinuesResponse = -1002;
|
|||||||
Copyright - Human readable copyright information.
|
Copyright - Human readable copyright information.
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
If you choose not the include any of the above keys, they will default
|
If you choose not the include any of the above keys, they will default
|
||||||
to the following respective keys in your info.plist file.
|
to the following respective keys in your info.plist file.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
@@ -1003,7 +1005,7 @@ CPRunContinuesResponse = -1002;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the arguments of your application.
|
Sets the arguments of your application.
|
||||||
That is, set the slash seperated values of an array as the window location hash.
|
That is, set the slash seperated values of an array as the window location hash.
|
||||||
|
|
||||||
For example if you pass an array:
|
For example if you pass an array:
|
||||||
@@ -1156,6 +1158,16 @@ CPRunContinuesResponse = -1002;
|
|||||||
userInfo:nil];
|
userInfo:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (CPThemeBlend)themeBlend
|
||||||
|
{
|
||||||
|
return (_themeBlends.length > 0 ? _themeBlends[0] : nil);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setThemeBlend:(CPThemeBlend)aThemeBlend
|
||||||
|
{
|
||||||
|
_themeBlends[0] = aThemeBlend;
|
||||||
|
}
|
||||||
|
|
||||||
+ (CPString)defaultThemeName
|
+ (CPString)defaultThemeName
|
||||||
{
|
{
|
||||||
return ([[CPBundle mainBundle] objectForInfoDictionaryKey:"CPDefaultTheme"] || @"Aristo");
|
return ([[CPBundle mainBundle] objectForInfoDictionaryKey:"CPDefaultTheme"] || @"Aristo");
|
||||||
@@ -1218,15 +1230,14 @@ function CPApplicationMain(args, namedArgs)
|
|||||||
[_CPAppBootstrapper performActions];
|
[_CPAppBootstrapper performActions];
|
||||||
}
|
}
|
||||||
|
|
||||||
var _CPAppBootstrapperActions = nil;
|
var _CPAppBootstrapperActions = nil,
|
||||||
|
_CPAppThemeURLsToLoad = [];
|
||||||
|
|
||||||
@implementation _CPAppBootstrapper : CPObject
|
@implementation _CPAppBootstrapper : CPObject
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (CPArray)actions
|
+ (CPArray)actions
|
||||||
{
|
{
|
||||||
return [@selector(bootstrapPlatform), @selector(loadDefaultTheme), @selector(loadMainCibFile)];
|
return [@selector(bootstrapPlatform), @selector(loadThemes), @selector(loadMainCibFile)];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)performActions
|
+ (void)performActions
|
||||||
@@ -1250,17 +1261,30 @@ var _CPAppBootstrapperActions = nil;
|
|||||||
return [CPPlatform bootstrap];
|
return [CPPlatform bootstrap];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)loadDefaultTheme
|
+ (BOOL)loadThemes
|
||||||
{
|
{
|
||||||
var defaultThemeName = [CPApplication defaultThemeName],
|
_CPAppThemeURLsToLoad.push([CPApplication defaultThemeName]);
|
||||||
themeURL = nil;
|
|
||||||
|
|
||||||
if (defaultThemeName === @"Aristo")
|
var auxiliaryThemes = ([[CPBundle mainBundle] objectForInfoDictionaryKey:@"CPAuxiliaryThemes"] || []);
|
||||||
themeURL = [[CPBundle bundleForClass:[CPApplication class]] pathForResource:defaultThemeName + @".blend"];
|
|
||||||
|
_CPAppThemeURLsToLoad = _CPAppThemeURLsToLoad.concat(auxiliaryThemes);
|
||||||
|
|
||||||
|
[self loadNextTheme];
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (BOOL)loadNextTheme
|
||||||
|
{
|
||||||
|
var themeName = _CPAppThemeURLsToLoad.shift();
|
||||||
|
|
||||||
|
if (themeName === @"Aristo")
|
||||||
|
themeURL = [[CPBundle bundleForClass:[CPApplication class]] pathForResource:themeName + @".blend"];
|
||||||
else
|
else
|
||||||
themeURL = [[CPBundle mainBundle] pathForResource:defaultThemeName + @".blend"];
|
themeURL = [[CPBundle mainBundle] pathForResource:themeName + @".blend"];
|
||||||
|
|
||||||
var blend = [[CPThemeBlend alloc] initWithContentsOfURL:themeURL];
|
var blend = [[CPThemeBlend alloc] initWithContentsOfURL:themeURL];
|
||||||
|
|
||||||
[blend loadWithDelegate:self];
|
[blend loadWithDelegate:self];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
@@ -1268,10 +1292,17 @@ var _CPAppBootstrapperActions = nil;
|
|||||||
|
|
||||||
+ (void)blendDidFinishLoading:(CPThemeBlend)aThemeBlend
|
+ (void)blendDidFinishLoading:(CPThemeBlend)aThemeBlend
|
||||||
{
|
{
|
||||||
[[CPApplication sharedApplication] setThemeBlend:aThemeBlend];
|
var themeBlends = [CPApp themeBlends];
|
||||||
[CPTheme setDefaultTheme:[CPTheme themeNamed:[CPApplication defaultThemeName]]];
|
|
||||||
|
|
||||||
[self performActions];
|
[themeBlends addObject:aThemeBlend];
|
||||||
|
|
||||||
|
if ([themeBlends count] === 1)
|
||||||
|
[CPTheme setDefaultTheme:[CPTheme themeNamed:[CPApplication defaultThemeName]]];
|
||||||
|
|
||||||
|
if (_CPAppThemeURLsToLoad.length === 0)
|
||||||
|
[self performActions];
|
||||||
|
else
|
||||||
|
[self loadNextTheme];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)loadMainCibFile
|
+ (BOOL)loadMainCibFile
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
@import "CPObjectController.j"
|
@import "CPObjectController.j"
|
||||||
@import "CPKeyValueBinding.j"
|
@import "CPKeyValueBinding.j"
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
@class CPArrayController
|
@class CPArrayController
|
||||||
@@ -284,8 +285,7 @@
|
|||||||
|
|
||||||
if (value === nil)
|
if (value === nil)
|
||||||
value = [];
|
value = [];
|
||||||
|
else if (![value isKindOfClass:[CPArray class]])
|
||||||
if (![value isKindOfClass:[CPArray class]])
|
|
||||||
value = [value];
|
value = [value];
|
||||||
|
|
||||||
var oldSelectedObjects = nil,
|
var oldSelectedObjects = nil,
|
||||||
@@ -339,14 +339,6 @@
|
|||||||
[self setContent:anArray];
|
[self setContent:anArray];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
@ignore
|
|
||||||
*/
|
|
||||||
- (void)_setContentSet:(id)aSet
|
|
||||||
{
|
|
||||||
[self setContent:[aSet allObjects]];
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the content array of the controller.
|
Returns the content array of the controller.
|
||||||
@return id the content array of the receiver
|
@return id the content array of the receiver
|
||||||
@@ -356,6 +348,14 @@
|
|||||||
return [self content];
|
return [self content];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@ignore
|
||||||
|
*/
|
||||||
|
- (void)_setContentSet:(id)aSet
|
||||||
|
{
|
||||||
|
[self setContent:[aSet allObjects]];
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the content of the receiver as a CPSet.
|
Returns the content of the receiver as a CPSet.
|
||||||
|
|
||||||
@@ -564,8 +564,13 @@
|
|||||||
- (BOOL)setSelectionIndexes:(CPIndexSet)indexes
|
- (BOOL)setSelectionIndexes:(CPIndexSet)indexes
|
||||||
{
|
{
|
||||||
[self _selectionWillChange]
|
[self _selectionWillChange]
|
||||||
[self __setSelectionIndexes:indexes];
|
|
||||||
[self _selectionDidChange];
|
// When explicitly setting the selection, ignore avoidsEmptySelection
|
||||||
|
var changed = [self __setSelectionIndexes:indexes obeyAvoidsEmptySelection:NO];
|
||||||
|
|
||||||
|
[self _selectionDidChangeNotify:NO];
|
||||||
|
|
||||||
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -574,7 +579,7 @@
|
|||||||
*/
|
*/
|
||||||
- (BOOL)__setSelectionIndex:(int)theIndex
|
- (BOOL)__setSelectionIndex:(int)theIndex
|
||||||
{
|
{
|
||||||
[self __setSelectionIndexes:[CPIndexSet indexSetWithIndex:theIndex]];
|
return [self __setSelectionIndexes:[CPIndexSet indexSetWithIndex:theIndex] obeyAvoidsEmptySelection:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -582,13 +587,22 @@
|
|||||||
@ignore
|
@ignore
|
||||||
*/
|
*/
|
||||||
- (BOOL)__setSelectionIndexes:(CPIndexSet)indexes
|
- (BOOL)__setSelectionIndexes:(CPIndexSet)indexes
|
||||||
|
{
|
||||||
|
[self __setSelectionIndexes:indexes obeyAvoidsEmptySelection:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Like setSelectionIndexes but don't fire any change notifications.
|
||||||
|
@ignore
|
||||||
|
*/
|
||||||
|
- (BOOL)__setSelectionIndexes:(CPIndexSet)indexes obeyAvoidsEmptySelection:(BOOL)obeyAvoidsEmptySelection
|
||||||
{
|
{
|
||||||
if (!indexes)
|
if (!indexes)
|
||||||
indexes = [CPIndexSet indexSet];
|
indexes = [CPIndexSet indexSet];
|
||||||
|
|
||||||
if (![indexes count])
|
if (![indexes count])
|
||||||
{
|
{
|
||||||
if (_avoidsEmptySelection && [[self arrangedObjects] count])
|
if (obeyAvoidsEmptySelection && _avoidsEmptySelection && [[self arrangedObjects] count])
|
||||||
indexes = [CPIndexSet indexSetWithIndex:0];
|
indexes = [CPIndexSet indexSetWithIndex:0];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -636,10 +650,10 @@
|
|||||||
[self willChangeValueForKey:@"selectionIndexes"];
|
[self willChangeValueForKey:@"selectionIndexes"];
|
||||||
[self _selectionWillChange];
|
[self _selectionWillChange];
|
||||||
|
|
||||||
[self __setSelectedObjects:objects];
|
[self __setSelectedObjects:objects obeyAvoidsEmptySelection:NO];
|
||||||
|
|
||||||
[self didChangeValueForKey:@"selectionIndexes"];
|
[self didChangeValueForKey:@"selectionIndexes"];
|
||||||
[self _selectionDidChange];
|
[self _selectionDidChangeNotify:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -647,6 +661,15 @@
|
|||||||
@ignore
|
@ignore
|
||||||
*/
|
*/
|
||||||
- (BOOL)__setSelectedObjects:(CPArray)objects
|
- (BOOL)__setSelectedObjects:(CPArray)objects
|
||||||
|
{
|
||||||
|
[self __setSelectedObjects:objects obeyAvoidsEmptySelection:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Like setSelectedObjects but don't fire any change notifications.
|
||||||
|
@ignore
|
||||||
|
*/
|
||||||
|
- (BOOL)__setSelectedObjects:(CPArray)objects obeyAvoidsEmptySelection:(BOOL)obeyAvoidsEmptySelection
|
||||||
{
|
{
|
||||||
var set = [CPIndexSet indexSet],
|
var set = [CPIndexSet indexSet],
|
||||||
count = [objects count],
|
count = [objects count],
|
||||||
@@ -660,7 +683,7 @@
|
|||||||
[set addIndex:index];
|
[set addIndex:index];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self __setSelectionIndexes:set];
|
[self __setSelectionIndexes:set obeyAvoidsEmptySelection:obeyAvoidsEmptySelection];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -729,21 +752,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
[self willChangeValueForKey:@"content"];
|
[self willChangeValueForKey:@"content"];
|
||||||
|
[self _willModifyContent];
|
||||||
/*
|
|
||||||
If the content array is bound then our addObject: message below will cause the observed
|
|
||||||
array to change. The binding will call setContent:_contentObject on this array
|
|
||||||
controller to let it know about the change. We want to ignore that message since we
|
|
||||||
A) already have the right _contentObject and B) properly update _arrangedObjects
|
|
||||||
by hand below.
|
|
||||||
*/
|
|
||||||
_disableSetContent = YES;
|
|
||||||
[_contentObject addObject:object];
|
[_contentObject addObject:object];
|
||||||
|
|
||||||
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
||||||
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
||||||
|
|
||||||
_disableSetContent = NO;
|
[self _didModifyContent];
|
||||||
|
|
||||||
if (willClearPredicate)
|
if (willClearPredicate)
|
||||||
{
|
{
|
||||||
@@ -764,14 +779,15 @@
|
|||||||
[_selectionIndexes shiftIndexesStartingAtIndex:pos by:1];
|
[_selectionIndexes shiftIndexesStartingAtIndex:pos by:1];
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
else if (_filterPredicate !== nil)
|
else if (_filterPredicate !== nil)
|
||||||
...
|
...
|
||||||
// Implies _filterPredicate && ![_filterPredicate evaluateWithObject:object], so the new object does
|
Implies _filterPredicate && ![_filterPredicate evaluateWithObject:object], so the new object does
|
||||||
// not appear in arrangedObjects and we do not have to update at all.
|
not appear in arrangedObjects and we do not have to update at all.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This will also send notificaitons for arrangedObjects.
|
// This will also send notificaitons for arrangedObjects.
|
||||||
[self didChangeValueForKey:@"content"];
|
[self didChangeValueForKey:@"content"];
|
||||||
|
|
||||||
if (willClearPredicate)
|
if (willClearPredicate)
|
||||||
[self didChangeValueForKey:@"filterPredicate"];
|
[self didChangeValueForKey:@"filterPredicate"];
|
||||||
}
|
}
|
||||||
@@ -797,10 +813,7 @@
|
|||||||
|
|
||||||
[self willChangeValueForKey:@"content"];
|
[self willChangeValueForKey:@"content"];
|
||||||
|
|
||||||
/*
|
[self _willModifyContent];
|
||||||
See _disableSetContent explanation in addObject:.
|
|
||||||
*/
|
|
||||||
_disableSetContent = YES;
|
|
||||||
|
|
||||||
// The atArrangedObjectIndex: part of this method's name only refers to where the
|
// The atArrangedObjectIndex: part of this method's name only refers to where the
|
||||||
// object goes in arrangedObjects, not in the content array. So use addObject:,
|
// object goes in arrangedObjects, not in the content array. So use addObject:,
|
||||||
@@ -809,7 +822,7 @@
|
|||||||
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
||||||
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
||||||
|
|
||||||
_disableSetContent = NO;
|
[self _didModifyContent];
|
||||||
|
|
||||||
if (willClearPredicate)
|
if (willClearPredicate)
|
||||||
[self __setFilterPredicate:nil];
|
[self __setFilterPredicate:nil];
|
||||||
@@ -827,6 +840,7 @@
|
|||||||
[self __setSelectionIndexes:[CPIndexSet indexSetWithIndex:0]];
|
[self __setSelectionIndexes:[CPIndexSet indexSetWithIndex:0]];
|
||||||
|
|
||||||
[self didChangeValueForKey:@"content"];
|
[self didChangeValueForKey:@"content"];
|
||||||
|
|
||||||
if (willClearPredicate)
|
if (willClearPredicate)
|
||||||
[self didChangeValueForKey:@"filterPredicate"];
|
[self didChangeValueForKey:@"filterPredicate"];
|
||||||
}
|
}
|
||||||
@@ -839,15 +853,13 @@
|
|||||||
- (void)removeObject:(id)object
|
- (void)removeObject:(id)object
|
||||||
{
|
{
|
||||||
[self willChangeValueForKey:@"content"];
|
[self willChangeValueForKey:@"content"];
|
||||||
|
[self _willModifyContent];
|
||||||
// See _disableSetContent explanation in addObject:.
|
|
||||||
_disableSetContent = YES;
|
|
||||||
|
|
||||||
[_contentObject removeObject:object];
|
[_contentObject removeObject:object];
|
||||||
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
||||||
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
||||||
|
|
||||||
_disableSetContent = NO;
|
[self _didModifyContent];
|
||||||
|
|
||||||
if (_filterPredicate === nil || [_filterPredicate evaluateWithObject:object])
|
if (_filterPredicate === nil || [_filterPredicate evaluateWithObject:object])
|
||||||
{
|
{
|
||||||
@@ -898,6 +910,15 @@
|
|||||||
[self removeObjectsAtArrangedObjectIndexes:_selectionIndexes];
|
[self removeObjectsAtArrangedObjectIndexes:_selectionIndexes];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Removes the object at the specified index in the controller's arranged objects from the content array.
|
||||||
|
@param int index - index of the object to remove.
|
||||||
|
*/
|
||||||
|
- (void)removeObjectAtArrangedObjectIndex:(int)index
|
||||||
|
{
|
||||||
|
[self removeObjectsAtArrangedObjectIndexes:[CPIndexSet indexSetWithIndex:index]];
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Removes the objects at the specified indexes in the controller's arranged objects from the content array.
|
Removes the objects at the specified indexes in the controller's arranged objects from the content array.
|
||||||
@param CPIndexSet indexes - indexes of the objects to remove.
|
@param CPIndexSet indexes - indexes of the objects to remove.
|
||||||
@@ -906,20 +927,21 @@
|
|||||||
{
|
{
|
||||||
[self willChangeValueForKey:@"content"];
|
[self willChangeValueForKey:@"content"];
|
||||||
|
|
||||||
/*
|
|
||||||
See _disableSetContent explanation in addObject:.
|
|
||||||
*/
|
|
||||||
_disableSetContent = YES;
|
_disableSetContent = YES;
|
||||||
|
|
||||||
var arrangedObjects = [self arrangedObjects],
|
var arrangedObjects = [self arrangedObjects],
|
||||||
index = [anIndexSet lastIndex],
|
index = [anIndexSet lastIndex],
|
||||||
position = CPNotFound,
|
position = CPNotFound,
|
||||||
newSelectionIndexes = [_selectionIndexes copy];
|
newSelectionIndexes = [_selectionIndexes copy],
|
||||||
|
proxy = [_CPKVOProxy proxyForObject:self];
|
||||||
|
|
||||||
while (index !== CPNotFound)
|
while (index !== CPNotFound)
|
||||||
{
|
{
|
||||||
var object = [arrangedObjects objectAtIndex:index];
|
var object = [arrangedObjects objectAtIndex:index];
|
||||||
|
|
||||||
|
// Make sure arrangedObjects does not notify because of content change
|
||||||
|
[proxy suppressNotificationsForKeyPath:@"arrangedObjects"];
|
||||||
|
|
||||||
// First try the simple case which should work if there are no sort descriptors.
|
// First try the simple case which should work if there are no sort descriptors.
|
||||||
if ([_contentObject objectAtIndex:index] === object)
|
if ([_contentObject objectAtIndex:index] === object)
|
||||||
[_contentObject removeObjectAtIndex:index];
|
[_contentObject removeObjectAtIndex:index];
|
||||||
@@ -933,6 +955,9 @@
|
|||||||
contentIndex = [_contentObject indexOfObjectIdenticalTo:object];
|
contentIndex = [_contentObject indexOfObjectIdenticalTo:object];
|
||||||
[_contentObject removeObjectAtIndex:contentIndex];
|
[_contentObject removeObjectAtIndex:contentIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now arrangedObjects can notify
|
||||||
|
[proxy unsuppressNotificationsForKeyPath:@"arrangedObjects"];
|
||||||
[arrangedObjects removeObjectAtIndex:index];
|
[arrangedObjects removeObjectAtIndex:index];
|
||||||
|
|
||||||
// Deselect this row if it was selected, and either way shift all selection indexes
|
// Deselect this row if it was selected, and either way shift all selection indexes
|
||||||
@@ -942,6 +967,7 @@
|
|||||||
|
|
||||||
index = [anIndexSet indexLessThanIndex:index];
|
index = [anIndexSet indexLessThanIndex:index];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
||||||
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
||||||
_disableSetContent = NO;
|
_disableSetContent = NO;
|
||||||
@@ -988,15 +1014,13 @@
|
|||||||
- (void)_removeObjects:(CPArray)objects
|
- (void)_removeObjects:(CPArray)objects
|
||||||
{
|
{
|
||||||
[self willChangeValueForKey:@"content"];
|
[self willChangeValueForKey:@"content"];
|
||||||
|
[self _willModifyContent];
|
||||||
// See _disableSetContent explanation in addObject:.
|
|
||||||
_disableSetContent = YES;
|
|
||||||
|
|
||||||
[_contentObject removeObjectsInArray:objects];
|
[_contentObject removeObjectsInArray:objects];
|
||||||
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
// Allow handlesContentAsCompoundValue reverse sets to trigger.
|
||||||
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
[[CPBinder getBinding:@"contentArray" forObject:self] _contentArrayDidChange];
|
||||||
|
|
||||||
_disableSetContent = NO;
|
[self _didModifyContent];
|
||||||
|
|
||||||
var arrangedObjects = [self arrangedObjects],
|
var arrangedObjects = [self arrangedObjects],
|
||||||
position = [arrangedObjects indexOfObject:[objects objectAtIndex:0]];
|
position = [arrangedObjects indexOfObject:[objects objectAtIndex:0]];
|
||||||
@@ -1033,13 +1057,39 @@
|
|||||||
return [self isEditable];
|
return [self isEditable];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Internal
|
||||||
|
- (void)_willModifyContent
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
If the content array is bound then our addObject: message below will cause the observed
|
||||||
|
array to change. The binding will call setContent:_contentObject on this array
|
||||||
|
controller to let it know about the change. We want to ignore that message since we
|
||||||
|
A) already have the right _contentObject and B) properly update _arrangedObjects
|
||||||
|
by hand below.
|
||||||
|
*/
|
||||||
|
_disableSetContent = YES;
|
||||||
|
|
||||||
|
/*
|
||||||
|
When mutating arrangedObjects, we mutate the content first. But mutating the content
|
||||||
|
will trigger a notification that the arrangedObjects have changed, which we want to
|
||||||
|
suppress, since the arrangedObjects mutation will do the correct notification.
|
||||||
|
*/
|
||||||
|
[[_CPKVOProxy proxyForObject:self] suppressNotificationsForKeyPath:@"arrangedObjects"];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)_didModifyContent
|
||||||
|
{
|
||||||
|
_disableSetContent = NO;
|
||||||
|
[[_CPKVOProxy proxyForObject:self] unsuppressNotificationsForKeyPath:@"arrangedObjects"];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation CPArrayController (CPBinder)
|
@implementation CPArrayController (CPBinder)
|
||||||
|
|
||||||
+ (Class)_binderClassForBinding:(CPString)theBinding
|
+ (Class)_binderClassForBinding:(CPString)theBinding
|
||||||
{
|
{
|
||||||
if (theBinding == @"contentArray")
|
if (theBinding === @"content" || theBinding === @"contentArray")
|
||||||
return [_CPArrayControllerContentBinder class];
|
return [_CPArrayControllerContentBinder class];
|
||||||
|
|
||||||
return [super _binderClassForBinding:theBinding];
|
return [super _binderClassForBinding:theBinding];
|
||||||
@@ -1054,7 +1104,7 @@
|
|||||||
var destination = [_info objectForKey:CPObservedObjectKey],
|
var destination = [_info objectForKey:CPObservedObjectKey],
|
||||||
keyPath = [_info objectForKey:CPObservedKeyPathKey],
|
keyPath = [_info objectForKey:CPObservedKeyPathKey],
|
||||||
options = [_info objectForKey:CPOptionsKey],
|
options = [_info objectForKey:CPOptionsKey],
|
||||||
isCompound = [self handlesContentAsCompoundValue];
|
isCompound = [self handlesContentAsCompoundValue] || keyPath.indexOf("@") !== -1;
|
||||||
|
|
||||||
if (!isCompound)
|
if (!isCompound)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
@import "CPCompatibility.j"
|
@import "CPCompatibility.j"
|
||||||
@import "CPImage.j"
|
@import "CPImage.j"
|
||||||
|
|
||||||
|
/// @cond IGNORE
|
||||||
|
|
||||||
var _redComponent = 0,
|
var _redComponent = 0,
|
||||||
_greenComponent = 1,
|
_greenComponent = 1,
|
||||||
@@ -54,6 +55,66 @@ var cachedBlackColor,
|
|||||||
cachedShadowColor,
|
cachedShadowColor,
|
||||||
cachedClearColor;
|
cachedClearColor;
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Orientation to use with \c CPColorPattern for vertical patterns.
|
||||||
|
*/
|
||||||
|
CPColorPatternIsVertical = YES,
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Orientation to use with \c CPColorPattern for horizontal patterns.
|
||||||
|
*/
|
||||||
|
CPColorPatternIsHorizontal = NO;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
To create a simple color with a pattern image:
|
||||||
|
|
||||||
|
<code>CPColorWithImages(name, width, height{, bundle})</code>
|
||||||
|
|
||||||
|
To create a color with a three part pattern image:
|
||||||
|
|
||||||
|
<code>CPColorWithImages(slices{, orientation})</code>
|
||||||
|
|
||||||
|
where slices is an array of three [name, width, height{, bundle}] arrays,
|
||||||
|
and orientation is \c CPColorPatternIsVertical or \ref CPColorPatternIsHorizontal.
|
||||||
|
If orientatation is not passed, it defaults to \ref CPColorPatternIsHorizontal.
|
||||||
|
|
||||||
|
To create a color with a nine part pattern image:
|
||||||
|
|
||||||
|
<code>CPColorWithImages(slices);</code>
|
||||||
|
|
||||||
|
where slices is an array of nine [name, width, height{, bundle}] arrays.
|
||||||
|
*/
|
||||||
|
function CPColorWithImages()
|
||||||
|
{
|
||||||
|
if (arguments.length < 3)
|
||||||
|
{
|
||||||
|
var slices = arguments[0],
|
||||||
|
imageSlices = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < slices.length; ++i)
|
||||||
|
{
|
||||||
|
var slice = slices[i];
|
||||||
|
|
||||||
|
imageSlices.push(slice ? CPImageInBundle(slice[0], CGSizeMake(slice[1], slice[2]), slice[3]) : nil);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imageSlices.length === 3)
|
||||||
|
return [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:imageSlices isVertical:arguments[1] || CPColorPatternIsHorizontal]];
|
||||||
|
else
|
||||||
|
return [CPColor colorWithPatternImage:[[CPNinePartImage alloc] initWithImageSlices:imageSlices]];
|
||||||
|
}
|
||||||
|
else if (arguments.length === 3 || arguments.length === 4)
|
||||||
|
{
|
||||||
|
return [CPColor colorWithPatternImage:CPImageInBundle(arguments[0], CGSizeMake(arguments[1], arguments[2]), arguments[3])];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ingroup appkit
|
@ingroup appkit
|
||||||
|
|
||||||
@@ -633,7 +694,36 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
|
|||||||
|
|
||||||
- (CPString)description
|
- (CPString)description
|
||||||
{
|
{
|
||||||
return [super description]+" "+[self cssString];
|
var description = [super description],
|
||||||
|
patternImage = [self patternImage];
|
||||||
|
|
||||||
|
if (!patternImage)
|
||||||
|
return description + " " + [self cssString];
|
||||||
|
|
||||||
|
description += " {\n";
|
||||||
|
|
||||||
|
if ([patternImage isThreePartImage] || [patternImage isNinePartImage])
|
||||||
|
{
|
||||||
|
var slices = [patternImage imageSlices];
|
||||||
|
|
||||||
|
if ([patternImage isThreePartImage])
|
||||||
|
description += " orientation: " + ([patternImage isVertical] ? "vertical" : "horizontal") + ",\n";
|
||||||
|
|
||||||
|
description += " patternImage (" + slices.length + " part): [\n";
|
||||||
|
|
||||||
|
for (var i = 0; i < slices.length; ++i)
|
||||||
|
{
|
||||||
|
var imgDescription = [slices[i] description];
|
||||||
|
|
||||||
|
description += imgDescription.replace(/^/mg, " ") + ",\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
description = description.substr(0, description.length - 2) + "\n ]\n}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
description += [patternImage description].replace(/^/mg, " ") + "\n}";
|
||||||
|
|
||||||
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -678,8 +768,10 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/// @cond IGNORE
|
||||||
var CPColorComponentsKey = @"CPColorComponentsKey",
|
var CPColorComponentsKey = @"CPColorComponentsKey",
|
||||||
CPColorPatternImageKey = @"CPColorPatternImageKey";
|
CPColorPatternImageKey = @"CPColorPatternImageKey";
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
@implementation CPColor (CPCoding)
|
@implementation CPColor (CPCoding)
|
||||||
|
|
||||||
@@ -710,13 +802,12 @@ var CPColorComponentsKey = @"CPColorComponentsKey",
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
/// @cond IGNORE
|
||||||
var hexCharacters = "0123456789ABCDEF";
|
var hexCharacters = "0123456789ABCDEF";
|
||||||
|
|
||||||
/*!
|
/*
|
||||||
Used for the CPColor \c +colorWithHexString: implementation
|
Used for the CPColor +colorWithHexString: implementation.
|
||||||
@ignore
|
Returns an array of rgb components.
|
||||||
@class CPColor
|
|
||||||
@return an array of rgb components
|
|
||||||
*/
|
*/
|
||||||
var hexToRGB = function(hex)
|
var hexToRGB = function(hex)
|
||||||
{
|
{
|
||||||
@@ -754,3 +845,5 @@ var byteToHex = function(n)
|
|||||||
return hexCharacters.charAt((n - n % 16) / 16) +
|
return hexCharacters.charAt((n - n % 16) / 16) +
|
||||||
hexCharacters.charAt(n % 16);
|
hexCharacters.charAt(n % 16);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// @endcond
|
||||||
|
|||||||
@@ -526,7 +526,7 @@ var CPControlBlackColor = [CPColor blackColor];
|
|||||||
// Cocoa raises an invalid parameter assertion and returns if you pass nil.
|
// Cocoa raises an invalid parameter assertion and returns if you pass nil.
|
||||||
if (aString === nil || aString === undefined)
|
if (aString === nil || aString === undefined)
|
||||||
{
|
{
|
||||||
CPLog.warn("nil sent to CPControl -setStringValue");
|
CPLog.warn("nil or undefined sent to CPControl -setStringValue");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -536,10 +536,10 @@ var CPControlBlackColor = [CPColor blackColor];
|
|||||||
{
|
{
|
||||||
value = nil;
|
value = nil;
|
||||||
|
|
||||||
if ([_formatter getObjectValue:AT_REF(value) forString:aString errorDescription:nil] === NO)
|
if (![_formatter getObjectValue:AT_REF(value) forString:aString errorDescription:nil])
|
||||||
{
|
{
|
||||||
// If the given string is non-empty and doesn't work, Cocoa tries an empty string.
|
// If the given string is non-empty and doesn't work, Cocoa tries an empty string.
|
||||||
if (!aString || [_formatter getObjectValue:AT_REF(value) forString:@"" errorDescription:nil] === NO)
|
if (!aString || ![_formatter getObjectValue:AT_REF(value) forString:@"" errorDescription:nil])
|
||||||
value = undefined; // Means the value is invalid
|
value = undefined; // Means the value is invalid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ CPImageNameColorPanel = @"CPImageNameColorPanel";
|
|||||||
CPImageNameColorPanelHighlighted = @"CPImageNameColorPanelHighlighted";
|
CPImageNameColorPanelHighlighted = @"CPImageNameColorPanelHighlighted";
|
||||||
|
|
||||||
var imagesForNames = { },
|
var imagesForNames = { },
|
||||||
AppKitImageForNames = { };
|
AppKitImageForNames = { },
|
||||||
|
ImageDescriptionFormat = "%s {\n filename: \"%s\",\n size: { width:%f, height:%f }\n}";
|
||||||
|
|
||||||
AppKitImageForNames[CPImageNameColorPanel] = CGSizeMake(26.0, 29.0);
|
AppKitImageForNames[CPImageNameColorPanel] = CGSizeMake(26.0, 29.0);
|
||||||
AppKitImageForNames[CPImageNameColorPanelHighlighted] = CGSizeMake(26.0, 29.0);
|
AppKitImageForNames[CPImageNameColorPanelHighlighted] = CGSizeMake(26.0, 29.0);
|
||||||
@@ -324,6 +325,24 @@ function CPAppKitImage(aFilename, aSize)
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (CPString)description
|
||||||
|
{
|
||||||
|
var filename = [self filename],
|
||||||
|
size = [self size];
|
||||||
|
|
||||||
|
if (filename.indexOf("data:") === 0)
|
||||||
|
{
|
||||||
|
var index = filename.indexOf(",");
|
||||||
|
|
||||||
|
if (index > 0)
|
||||||
|
filename = [CPString stringWithFormat:@"%s,%s...%s", filename.substr(0, index), filename.substr(index + 1, 10), filename.substr(filename.length - 10)];
|
||||||
|
else
|
||||||
|
filename = "data:<unknown type>";
|
||||||
|
}
|
||||||
|
|
||||||
|
return [CPString stringWithFormat:ImageDescriptionFormat, [super description], filename, size.width, size.height];
|
||||||
|
}
|
||||||
|
|
||||||
/* @ignore */
|
/* @ignore */
|
||||||
- (void)_derefFromImage
|
- (void)_derefFromImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -204,7 +204,6 @@ var CPBindingOperationAnd = 0,
|
|||||||
if (valueTransformer)
|
if (valueTransformer)
|
||||||
aValue = [valueTransformer transformedValue:aValue];
|
aValue = [valueTransformer transformedValue:aValue];
|
||||||
|
|
||||||
|
|
||||||
if (aValue === undefined || aValue === nil || aValue === [CPNull null])
|
if (aValue === undefined || aValue === nil || aValue === [CPNull null])
|
||||||
aValue = [options objectForKey:CPNullPlaceholderBindingOption] || nil;
|
aValue = [options objectForKey:CPNullPlaceholderBindingOption] || nil;
|
||||||
|
|
||||||
@@ -311,7 +310,7 @@ var CPBindingOperationAnd = 0,
|
|||||||
- (void)bind:(CPString)aBinding toObject:(id)anObject withKeyPath:(CPString)aKeyPath options:(CPDictionary)options
|
- (void)bind:(CPString)aBinding toObject:(id)anObject withKeyPath:(CPString)aKeyPath options:(CPDictionary)options
|
||||||
{
|
{
|
||||||
if (!anObject || !aKeyPath)
|
if (!anObject || !aKeyPath)
|
||||||
return CPLog.error("Invalid object or path on "+self+" for "+aBinding);
|
return CPLog.error("Invalid object or path on " + self + " for " + aBinding);
|
||||||
|
|
||||||
//if (![[self exposedBindings] containsObject:aBinding])
|
//if (![[self exposedBindings] containsObject:aBinding])
|
||||||
// CPLog.warn("No binding exposed on "+self+" for "+aBinding);
|
// CPLog.warn("No binding exposed on "+self+" for "+aBinding);
|
||||||
@@ -488,6 +487,8 @@ CPSelectedIndexBinding = @"selectedIndex";
|
|||||||
CPTextColorBinding = @"textColor";
|
CPTextColorBinding = @"textColor";
|
||||||
CPToolTipBinding = @"toolTip";
|
CPToolTipBinding = @"toolTip";
|
||||||
CPValueBinding = @"value";
|
CPValueBinding = @"value";
|
||||||
|
CPContentBinding = @"content";
|
||||||
|
CPContentValuesBinding = @"contentValues";
|
||||||
|
|
||||||
//Binding options constants
|
//Binding options constants
|
||||||
CPAllowsEditingMultipleValuesSelectionBindingOption = @"CPAllowsEditingMultipleValuesSelection";
|
CPAllowsEditingMultipleValuesSelectionBindingOption = @"CPAllowsEditingMultipleValuesSelection";
|
||||||
@@ -518,4 +519,4 @@ CPValueTransformerBindingOption = @"CPValueTransformer";
|
|||||||
CPIsControllerMarker = function(/*id*/anObject)
|
CPIsControllerMarker = function(/*id*/anObject)
|
||||||
{
|
{
|
||||||
return anObject === CPMultipleValuesMarker || anObject === CPNoSelectionMarker || anObject === CPNotApplicableMarker || anObject === CPNullMarker;
|
return anObject === CPMultipleValuesMarker || anObject === CPNoSelectionMarker || anObject === CPNotApplicableMarker || anObject === CPNullMarker;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,12 +323,22 @@
|
|||||||
@ignore
|
@ignore
|
||||||
*/
|
*/
|
||||||
- (void)_selectionDidChange
|
- (void)_selectionDidChange
|
||||||
|
{
|
||||||
|
[self _selectionDidChangeNotify:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@ignore
|
||||||
|
*/
|
||||||
|
- (void)_selectionDidChangeNotify:(BOOL)notify
|
||||||
{
|
{
|
||||||
if (_selection === undefined || _selection === nil)
|
if (_selection === undefined || _selection === nil)
|
||||||
_selection = [[CPControllerSelectionProxy alloc] initWithController:self];
|
_selection = [[CPControllerSelectionProxy alloc] initWithController:self];
|
||||||
|
|
||||||
[_selection controllerDidChange];
|
[_selection controllerDidChange];
|
||||||
[self didChangeValueForKey:@"selection"];
|
|
||||||
|
if (notify)
|
||||||
|
[self didChangeValueForKey:@"selection"];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -666,21 +676,21 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
|
|||||||
var count = [theValues count];
|
var count = [theValues count];
|
||||||
|
|
||||||
if (!count)
|
if (!count)
|
||||||
value = CPNoSelectionMarker;
|
return CPNoSelectionMarker;
|
||||||
else if (count === 1)
|
else if (count === 1)
|
||||||
value = [theValues objectAtIndex:0];
|
value = [theValues objectAtIndex:0];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ([_controller alwaysUsesMultipleValuesMarker])
|
if ([_controller alwaysUsesMultipleValuesMarker])
|
||||||
value = CPMultipleValuesMarker;
|
return CPMultipleValuesMarker;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
value = [theValues objectAtIndex:0];
|
value = [theValues objectAtIndex:0];
|
||||||
|
|
||||||
for (var i = 0, count= [theValues count]; i < count && value != CPMultipleValuesMarker; i++)
|
for (var i = 0, count = [theValues count]; i < count; i++)
|
||||||
{
|
{
|
||||||
if (![value isEqual:[theValues objectAtIndex:i]])
|
if (![value isEqual:[theValues objectAtIndex:i]])
|
||||||
value = CPMultipleValuesMarker;
|
return CPMultipleValuesMarker;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -693,8 +703,21 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
|
|||||||
|
|
||||||
- (id)valueForKeyPath:(CPString)theKeyPath
|
- (id)valueForKeyPath:(CPString)theKeyPath
|
||||||
{
|
{
|
||||||
var values = [[_controller selectedObjects] valueForKeyPath:theKeyPath];
|
// If valueForKeyPath fails because of an undefined key, return CPNotApplicableMarker
|
||||||
value = [self _controllerMarkerForValues:values];
|
var value;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var values = [[_controller selectedObjects] valueForKeyPath:theKeyPath];
|
||||||
|
value = [self _controllerMarkerForValues:values];
|
||||||
|
}
|
||||||
|
catch (ex)
|
||||||
|
{
|
||||||
|
if ([ex name] === CPUndefinedKeyException)
|
||||||
|
value = CPNotApplicableMarker;
|
||||||
|
else
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
[_cachedValues setObject:value forKey:theKeyPath];
|
[_cachedValues setObject:value forKey:theKeyPath];
|
||||||
|
|
||||||
|
|||||||
@@ -332,18 +332,18 @@ CPTableColumnUserResizingMask = 1 << 1;
|
|||||||
individual cell that is shown. As a result, changes made after calling this method won't be reflected.
|
individual cell that is shown. As a result, changes made after calling this method won't be reflected.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@code
|
@code
|
||||||
[tableColumn setDataView:someView]; // snapshot taken
|
[tableColumn setDataView:someView]; // snapshot taken
|
||||||
[[tableColumn dataView] setSomething:x]; //won't work
|
[[tableColumn dataView] setSomething:x]; //won't work
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
This doesn't work because the snapshot is taken before the new property is applied. Instead, do:
|
This doesn't work because the snapshot is taken before the new property is applied. Instead, do:
|
||||||
@code
|
@code
|
||||||
[someView setSomething:x];
|
[someView setSomething:x];
|
||||||
[tableColumn setDataView:someView];
|
[tableColumn setDataView:someView];
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
@note you should implement CPKeyedArchiving otherwise you might see unexpected results.
|
@note You should implement CPKeyedArchiving otherwise you might see unexpected results.
|
||||||
This is done by adding the following methods to your class:
|
This is done by adding the following methods to your class:
|
||||||
@endnote
|
@endnote
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ CPTableColumnUserResizingMask = 1 << 1;
|
|||||||
}
|
}
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
@section Themeing
|
@section Theming
|
||||||
|
|
||||||
When you set a dataview and it is added to the tableview the theme state will be set to \c CPThemeStateTableDataView
|
When you set a dataview and it is added to the tableview the theme state will be set to \c CPThemeStateTableDataView
|
||||||
When the dataview becomes selected the theme state will be set to \c CPThemeStateSelectedDataView.
|
When the dataview becomes selected the theme state will be set to \c CPThemeStateSelectedDataView.
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
|||||||
{
|
{
|
||||||
_tableViewFlags = 0;
|
_tableViewFlags = 0;
|
||||||
_lastSelectedRow = -1;
|
_lastSelectedRow = -1;
|
||||||
|
_clickedRow = -1;
|
||||||
|
|
||||||
_selectedColumnIndexes = [CPIndexSet indexSet];
|
_selectedColumnIndexes = [CPIndexSet indexSet];
|
||||||
_selectedRowIndexes = [CPIndexSet indexSet];
|
_selectedRowIndexes = [CPIndexSet indexSet];
|
||||||
|
|||||||
@@ -169,8 +169,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
|||||||
|
|
||||||
+ (id)themeAttributes
|
+ (id)themeAttributes
|
||||||
{
|
{
|
||||||
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMake(2.0, 2.0, 2.0, 2.0), [CPNull null]]
|
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMake(2.0, 2.0, 2.0, 2.0), _CGInsetMake(3.0, 3.0, 3.0, 3.0), [CPNull null]]
|
||||||
forKeys:[@"bezel-inset", @"content-inset", @"bezel-color"]];
|
forKeys:[@"bezel-inset", @"content-inset", @"border-inset", @"bezel-color"]];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @ignore */
|
/* @ignore */
|
||||||
@@ -507,31 +507,32 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
|||||||
}
|
}
|
||||||
|
|
||||||
var contentRect = [self contentRectForBounds:[self bounds]],
|
var contentRect = [self contentRectForBounds:[self bounds]],
|
||||||
verticalAlign = [self currentValueForThemeAttribute:"vertical-alignment"];
|
verticalAlign = [self currentValueForThemeAttribute:"vertical-alignment"],
|
||||||
|
lineHeight = [font defaultLineHeightForFont];
|
||||||
|
|
||||||
switch (verticalAlign)
|
switch (verticalAlign)
|
||||||
{
|
{
|
||||||
case CPTopVerticalTextAlignment:
|
case CPTopVerticalTextAlignment:
|
||||||
var topPoint = (_CGRectGetMinY(contentRect) + 1) + "px"; // for the same reason we have a -1 for the left, we also have a + 1 here
|
var topPoint = _CGRectGetMinY(contentRect) + "px"; // for the same reason we have a -1 for the left, we also have a + 1 here
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CPCenterVerticalTextAlignment:
|
case CPCenterVerticalTextAlignment:
|
||||||
var topPoint = (_CGRectGetMidY(contentRect) - (font._lineHeight / 2) + 1) + "px";
|
var topPoint = (_CGRectGetMidY(contentRect) - (lineHeight / 2)) + "px";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CPBottomVerticalTextAlignment:
|
case CPBottomVerticalTextAlignment:
|
||||||
var topPoint = (_CGRectGetMaxY(contentRect) - font._lineHeight) + "px";
|
var topPoint = (_CGRectGetMaxY(contentRect) - lineHeight) + "px";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
var topPoint = (_CGRectGetMinY(contentRect) + 1) + "px";
|
var topPoint = _CGRectGetMinY(contentRect) + "px";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
element.style.top = topPoint;
|
element.style.top = topPoint;
|
||||||
element.style.left = (_CGRectGetMinX(contentRect) - 1) + "px"; // why -1?
|
element.style.left = (_CGRectGetMinX(contentRect) - 1) + "px"; // why -1?
|
||||||
element.style.width = _CGRectGetWidth(contentRect) + "px";
|
element.style.width = _CGRectGetWidth(contentRect) + "px";
|
||||||
element.style.height = font._lineHeight + "px"; // private ivar for the line height of the DOM text at this particular size
|
element.style.height = lineHeight + "px";
|
||||||
|
|
||||||
_DOMElement.appendChild(element);
|
_DOMElement.appendChild(element);
|
||||||
|
|
||||||
@@ -625,15 +626,11 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// post CPControlTextDidEndEditingNotification
|
_isEditing = NO;
|
||||||
if (_isEditing)
|
[self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:nil]];
|
||||||
{
|
|
||||||
_isEditing = NO;
|
|
||||||
[self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:nil]];
|
|
||||||
|
|
||||||
if ([self sendsActionOnEndEditing])
|
if ([self sendsActionOnEndEditing])
|
||||||
[self sendAction:[self action] to:[self target]];
|
[self sendAction:[self action] to:[self target]];
|
||||||
}
|
|
||||||
|
|
||||||
[self textDidBlur:[CPNotification notificationWithName:CPTextFieldDidBlurNotification object:self userInfo:nil]];
|
[self textDidBlur:[CPNotification notificationWithName:CPTextFieldDidBlurNotification object:self userInfo:nil]];
|
||||||
|
|
||||||
@@ -1024,7 +1021,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
|||||||
maxSize = [self currentValueForThemeAttribute:@"max-size"],
|
maxSize = [self currentValueForThemeAttribute:@"max-size"],
|
||||||
lineBreakMode = [self lineBreakMode],
|
lineBreakMode = [self lineBreakMode],
|
||||||
text = (_stringValue || @" "),
|
text = (_stringValue || @" "),
|
||||||
textSize = _CGSizeMakeCopy(frameSize),
|
textSize = CGSizeMakeCopy(frameSize),
|
||||||
font = [self currentValueForThemeAttribute:@"font"];
|
font = [self currentValueForThemeAttribute:@"font"];
|
||||||
|
|
||||||
textSize.width -= contentInset.left + contentInset.right;
|
textSize.width -= contentInset.left + contentInset.right;
|
||||||
@@ -1294,10 +1291,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
|||||||
|
|
||||||
- (CGRect)contentRectForBounds:(CGRect)bounds
|
- (CGRect)contentRectForBounds:(CGRect)bounds
|
||||||
{
|
{
|
||||||
var contentInset = [self currentValueForThemeAttribute:@"content-inset"];
|
var bezelInset = [self currentValueForThemeAttribute:@"bezel-inset"],
|
||||||
|
contentInset = [self currentValueForThemeAttribute:@"content-inset"];
|
||||||
if (!contentInset)
|
|
||||||
return bounds;
|
|
||||||
|
|
||||||
bounds.origin.x += contentInset.left;
|
bounds.origin.x += contentInset.left;
|
||||||
bounds.origin.y += contentInset.top;
|
bounds.origin.y += contentInset.top;
|
||||||
@@ -1322,6 +1317,14 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
|||||||
return bounds;
|
return bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (CGInset)borderInset
|
||||||
|
{
|
||||||
|
var bezelInset = [self currentValueForThemeAttribute:@"bezel-inset"],
|
||||||
|
borderInset = [self currentValueForThemeAttribute:@"border-inset"];
|
||||||
|
|
||||||
|
return CGInsetUnion(bezelInset, borderInset);
|
||||||
|
}
|
||||||
|
|
||||||
- (CGRect)rectForEphemeralSubviewNamed:(CPString)aName
|
- (CGRect)rectForEphemeralSubviewNamed:(CPString)aName
|
||||||
{
|
{
|
||||||
if (aName === "bezel-view")
|
if (aName === "bezel-view")
|
||||||
|
|||||||
@@ -25,9 +25,10 @@
|
|||||||
@import <Foundation/CPKeyedUnarchiver.j>
|
@import <Foundation/CPKeyedUnarchiver.j>
|
||||||
|
|
||||||
|
|
||||||
var CPThemesByName = { },
|
var CPThemesByName = { },
|
||||||
CPThemeDefaultTheme = nil,
|
CPThemeNamesByInheritance = [],
|
||||||
CPThemeDefaultHudTheme = nil;
|
CPThemeDefaultTheme = nil,
|
||||||
|
CPThemeDefaultHudTheme = nil;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -76,6 +77,52 @@ var CPThemesByName = { },
|
|||||||
return CPThemesByName[aName];
|
return CPThemesByName[aName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns an array of names of all loaded themes, in the order they were loaded.
|
||||||
|
*/
|
||||||
|
+ (CPArray)allThemeNames
|
||||||
|
{
|
||||||
|
return [CPThemeNamesByInheritance copy];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the closest matching theme for a given view or view class.
|
||||||
|
The matching proceeds as follows:
|
||||||
|
|
||||||
|
- The default theme class name for the class is retrieved.
|
||||||
|
- Starting with the last loaded theme and proceeding towards the default theme,
|
||||||
|
each theme is checked to see if it defines that theme class.
|
||||||
|
- If the theme defines the class name, that theme is returned.
|
||||||
|
- If no themes match, the default theme is returned.
|
||||||
|
|
||||||
|
@param aViewOrClass The view or view class to match with a theme
|
||||||
|
@return The first matching theme
|
||||||
|
*/
|
||||||
|
+ (CPTheme)themeForView:(id)aViewOrClass
|
||||||
|
{
|
||||||
|
var themeClass = nil;
|
||||||
|
|
||||||
|
if (class_isMetaClass(aViewOrClass.isa))
|
||||||
|
themeClass = [aViewOrClass defaultThemeClass];
|
||||||
|
else
|
||||||
|
themeClass = [aViewOrClass themeClass];
|
||||||
|
|
||||||
|
if (themeClass)
|
||||||
|
{
|
||||||
|
var count = CPThemeNamesByInheritance.length;
|
||||||
|
|
||||||
|
while (count--)
|
||||||
|
{
|
||||||
|
var theme = CPThemesByName[CPThemeNamesByInheritance[count]];
|
||||||
|
|
||||||
|
if ([theme._attributes containsKey:themeClass])
|
||||||
|
return theme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return CPThemeDefaultTheme;
|
||||||
|
}
|
||||||
|
|
||||||
- (id)initWithName:(CPString)aName
|
- (id)initWithName:(CPString)aName
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
@@ -86,6 +133,9 @@ var CPThemesByName = { },
|
|||||||
_attributes = [CPDictionary dictionary];
|
_attributes = [CPDictionary dictionary];
|
||||||
|
|
||||||
CPThemesByName[_name] = self;
|
CPThemesByName[_name] = self;
|
||||||
|
|
||||||
|
if (![CPThemeNamesByInheritance containsObject:_name])
|
||||||
|
CPThemeNamesByInheritance.push(_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@@ -299,6 +349,9 @@ var CPThemeNameKey = @"CPThemeNameKey",
|
|||||||
_attributes = [aCoder decodeObjectForKey:CPThemeAttributesKey];
|
_attributes = [aCoder decodeObjectForKey:CPThemeAttributesKey];
|
||||||
|
|
||||||
CPThemesByName[_name] = self;
|
CPThemesByName[_name] = self;
|
||||||
|
|
||||||
|
if (![CPThemeNamesByInheritance containsObject:_name])
|
||||||
|
CPThemeNamesByInheritance.push(_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
return "tokenfield";
|
return "tokenfield";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithFrame:(CPRect)frame
|
- (id)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
||||||
if (self = [super initWithFrame:frame])
|
if (self = [super initWithFrame:frame])
|
||||||
{
|
{
|
||||||
@@ -116,12 +116,12 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
{
|
{
|
||||||
var frame = [self frame];
|
var frame = [self frame];
|
||||||
|
|
||||||
_tokenScrollView = [[CPScrollView alloc] initWithFrame:CGRectMakeZero()];
|
_tokenScrollView = [[CPScrollView alloc] initWithFrame:_CGRectMakeZero()];
|
||||||
[_tokenScrollView setHasHorizontalScroller:NO];
|
[_tokenScrollView setHasHorizontalScroller:NO];
|
||||||
[_tokenScrollView setHasVerticalScroller:NO];
|
[_tokenScrollView setHasVerticalScroller:NO];
|
||||||
[_tokenScrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
[_tokenScrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
||||||
|
|
||||||
var contentView = [[CPView alloc] initWithFrame:CGRectMakeZero()];
|
var contentView = [[CPView alloc] initWithFrame:_CGRectMakeZero()];
|
||||||
[contentView setAutoresizingMask:CPViewWidthSizable];
|
[contentView setAutoresizingMask:CPViewWidthSizable];
|
||||||
[_tokenScrollView setDocumentView:contentView];
|
[_tokenScrollView setDocumentView:contentView];
|
||||||
|
|
||||||
@@ -129,15 +129,15 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
|
|
||||||
_cachedCompletions = [];
|
_cachedCompletions = [];
|
||||||
|
|
||||||
_autocompleteContainer = [[CPView alloc] initWithFrame:CPRectMake(0.0, 0.0, frame.size.width, 92.0)];
|
_autocompleteContainer = [[CPView alloc] initWithFrame:_CGRectMake(0.0, 0.0, frame.size.width, 92.0)];
|
||||||
[_autocompleteContainer setBackgroundColor:[_CPMenuWindow backgroundColorForBackgroundStyle:_CPMenuWindowPopUpBackgroundStyle]];
|
[_autocompleteContainer setBackgroundColor:[_CPMenuWindow backgroundColorForBackgroundStyle:_CPMenuWindowPopUpBackgroundStyle]];
|
||||||
|
|
||||||
_autocompleteScrollView = [[CPScrollView alloc] initWithFrame:CPRectMake(1.0, 1.0, frame.size.width - 2.0, 90.0)];
|
_autocompleteScrollView = [[CPScrollView alloc] initWithFrame:_CGRectMake(1.0, 1.0, frame.size.width - 2.0, 90.0)];
|
||||||
[_autocompleteScrollView setAutohidesScrollers:YES];
|
[_autocompleteScrollView setAutohidesScrollers:YES];
|
||||||
[_autocompleteScrollView setHasHorizontalScroller:NO];
|
[_autocompleteScrollView setHasHorizontalScroller:NO];
|
||||||
[_autocompleteContainer addSubview:_autocompleteScrollView];
|
[_autocompleteContainer addSubview:_autocompleteScrollView];
|
||||||
|
|
||||||
_autocompleteView = [[CPTableView alloc] initWithFrame:CPRectMakeZero()];
|
_autocompleteView = [[CPTableView alloc] initWithFrame:_CGRectMakeZero()];
|
||||||
|
|
||||||
var tableColumn = [[CPTableColumn alloc] initWithIdentifier:CPTokenFieldTableColumnIdentifier];
|
var tableColumn = [[CPTableColumn alloc] initWithIdentifier:CPTokenFieldTableColumnIdentifier];
|
||||||
[tableColumn setResizingMask:CPTableColumnAutoresizingMask];
|
[tableColumn setResizingMask:CPTableColumnAutoresizingMask];
|
||||||
@@ -163,12 +163,16 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
{
|
{
|
||||||
var indexOfSelectedItem = 0;
|
var indexOfSelectedItem = 0;
|
||||||
|
|
||||||
|
#if PLATFORM(DOM)
|
||||||
_cachedCompletions = [self tokenField:self completionsForSubstring:[self _inputElement].value indexOfToken:0 indexOfSelectedItem:indexOfSelectedItem];
|
_cachedCompletions = [self tokenField:self completionsForSubstring:[self _inputElement].value indexOfToken:0 indexOfSelectedItem:indexOfSelectedItem];
|
||||||
|
#endif
|
||||||
|
|
||||||
[_autocompleteView selectRowIndexes:[CPIndexSet indexSetWithIndex:indexOfSelectedItem] byExtendingSelection:NO];
|
[_autocompleteView selectRowIndexes:[CPIndexSet indexSetWithIndex:indexOfSelectedItem] byExtendingSelection:NO];
|
||||||
[_autocompleteView reloadData];
|
[_autocompleteView reloadData];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PLATFORM(DOM)
|
||||||
|
|
||||||
- (void)_autocompleteWithDOMEvent:(JSObject)DOMEvent
|
- (void)_autocompleteWithDOMEvent:(JSObject)DOMEvent
|
||||||
{
|
{
|
||||||
if (!_cachedCompletions || ![self hasThemeState:CPThemeStateAutoCompleting])
|
if (!_cachedCompletions || ![self hasThemeState:CPThemeStateAutoCompleting])
|
||||||
@@ -222,6 +226,8 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
[self _autocompleteWithDOMEvent:nil];
|
[self _autocompleteWithDOMEvent:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
- (void)_selectToken:(_CPTokenFieldToken)token byExtendingSelection:(BOOL)extend
|
- (void)_selectToken:(_CPTokenFieldToken)token byExtendingSelection:(BOOL)extend
|
||||||
{
|
{
|
||||||
var indexOfToken = [[self _tokens] indexOfObject:token];
|
var indexOfToken = [[self _tokens] indexOfObject:token];
|
||||||
@@ -372,10 +378,10 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
|
|
||||||
[self unsetThemeState:CPThemeStateEditing];
|
[self unsetThemeState:CPThemeStateEditing];
|
||||||
|
|
||||||
[self _autocomplete];
|
|
||||||
|
|
||||||
#if PLATFORM(DOM)
|
#if PLATFORM(DOM)
|
||||||
|
|
||||||
|
[self _autocomplete];
|
||||||
|
|
||||||
var element = [self _inputElement];
|
var element = [self _inputElement];
|
||||||
|
|
||||||
CPTokenFieldInputResigning = YES;
|
CPTokenFieldInputResigning = YES;
|
||||||
@@ -658,7 +664,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
rowRect = [autocompleteView rectOfRow:index],
|
rowRect = [autocompleteView rectOfRow:index],
|
||||||
owner = CPTokenFieldInputOwner;
|
owner = CPTokenFieldInputOwner;
|
||||||
|
|
||||||
if (rowRect && !CPRectContainsRect([clipView bounds], rowRect))
|
if (rowRect && !CGRectContainsRect([clipView bounds], rowRect))
|
||||||
[clipView scrollToPoint:[autocompleteView rectOfRow:index].origin];
|
[clipView scrollToPoint:[autocompleteView rectOfRow:index].origin];
|
||||||
|
|
||||||
if (aDOMEvent.keyCode === CPReturnKeyCode || aDOMEvent.keyCode === CPTabKeyCode)
|
if (aDOMEvent.keyCode === CPReturnKeyCode || aDOMEvent.keyCode === CPTabKeyCode)
|
||||||
@@ -748,7 +754,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
else if (aDOMEvent.keyCode === CPDeleteKeyCode)
|
else if (aDOMEvent.keyCode === CPDeleteKeyCode)
|
||||||
{
|
{
|
||||||
// Highlight the previous token if backspace was pressed in an empty input element or re-show the completions view
|
// Highlight the previous token if backspace was pressed in an empty input element or re-show the completions view
|
||||||
if (CPTokenFieldDOMInputElement.value == @"")
|
if (CPTokenFieldDOMInputElement.value.length === 0)
|
||||||
{
|
{
|
||||||
[self _hideCompletions];
|
[self _hideCompletions];
|
||||||
|
|
||||||
@@ -868,6 +874,15 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// In the context of a token field, it is empty when there are no tokens
|
||||||
|
- (void)_updatePlaceholderState
|
||||||
|
{
|
||||||
|
if (([[self _tokens] count] === 0) && ![self hasThemeState:CPThemeStateEditing])
|
||||||
|
[self setThemeState:CPTextFieldStatePlaceholder];
|
||||||
|
else
|
||||||
|
[self unsetThemeState:CPTextFieldStatePlaceholder];
|
||||||
|
}
|
||||||
|
|
||||||
// - (void)setTokenStyle: (NSTokenStyle) style;
|
// - (void)setTokenStyle: (NSTokenStyle) style;
|
||||||
// - (NSTokenStyle)tokenStyle;
|
// - (NSTokenStyle)tokenStyle;
|
||||||
//
|
//
|
||||||
@@ -950,9 +965,9 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
// Manually sizeToFit because CPTableView's sizeToFit doesn't work properly
|
// Manually sizeToFit because CPTableView's sizeToFit doesn't work properly
|
||||||
[_autocompleteContainer setHidden:NO];
|
[_autocompleteContainer setHidden:NO];
|
||||||
var frameOrigin = [self convertPoint:[self bounds].origin toView:[_autocompleteContainer superview]];
|
var frameOrigin = [self convertPoint:[self bounds].origin toView:[_autocompleteContainer superview]];
|
||||||
[_autocompleteContainer setFrameOrigin:CPPointMake(frameOrigin.x, frameOrigin.y + frame.size.height)];
|
[_autocompleteContainer setFrameOrigin:_CGPointMake(frameOrigin.x, frameOrigin.y + frame.size.height)];
|
||||||
[_autocompleteContainer setFrameSize:CPSizeMake(CPRectGetWidth([self bounds]), 92.0)];
|
[_autocompleteContainer setFrameSize:_CGSizeMake(_CGRectGetWidth([self bounds]), 92.0)];
|
||||||
[_autocompleteScrollView setFrameSize:CPSizeMake([_autocompleteContainer frame].size.width - 2.0, 90.0)];
|
[_autocompleteScrollView setFrameSize:_CGSizeMake([_autocompleteContainer frame].size.width - 2.0, 90.0)];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
[_autocompleteContainer setHidden:YES];
|
[_autocompleteContainer setHidden:YES];
|
||||||
@@ -962,11 +977,11 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Move each token into the right position.
|
// Move each token into the right position.
|
||||||
var contentRect = CGRectMakeCopy([contentView bounds]),
|
var contentRect = _CGRectMakeCopy([contentView bounds]),
|
||||||
contentOrigin = contentRect.origin,
|
contentOrigin = contentRect.origin,
|
||||||
contentSize = contentRect.size,
|
contentSize = contentRect.size,
|
||||||
offset = CPPointMake(contentOrigin.x, contentOrigin.y),
|
offset = _CGPointMake(contentOrigin.x, contentOrigin.y),
|
||||||
spaceBetweenTokens = CPSizeMake(2.0, 2.0),
|
spaceBetweenTokens = _CGSizeMake(2.0, 2.0),
|
||||||
isEditing = [[self window] firstResponder] == self,
|
isEditing = [[self window] firstResponder] == self,
|
||||||
tokenToken = [_CPTokenFieldToken new];
|
tokenToken = [_CPTokenFieldToken new];
|
||||||
|
|
||||||
@@ -977,7 +992,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
|
|
||||||
var fitAndFrame = function(width, height)
|
var fitAndFrame = function(width, height)
|
||||||
{
|
{
|
||||||
var r = CGRectMake(0, 0, width, height);
|
var r = _CGRectMake(0, 0, width, height);
|
||||||
|
|
||||||
if (offset.x + width >= contentSize.width && offset.x > contentOrigin.x)
|
if (offset.x + width >= contentSize.width && offset.x > contentOrigin.x)
|
||||||
{
|
{
|
||||||
@@ -990,7 +1005,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
|
|
||||||
// Make sure the frame fits.
|
// Make sure the frame fits.
|
||||||
if (CGRectGetHeight([contentView bounds]) < offset.y + height)
|
if (CGRectGetHeight([contentView bounds]) < offset.y + height)
|
||||||
[contentView setFrame:CGRectMake(0, 0, CGRectGetWidth([_tokenScrollView bounds]), offset.y + height)];
|
[contentView setFrame:_CGRectMake(0, 0, CGRectGetWidth([_tokenScrollView bounds]), offset.y + height)];
|
||||||
|
|
||||||
offset.x += width + spaceBetweenTokens.width;
|
offset.x += width + spaceBetweenTokens.width;
|
||||||
|
|
||||||
@@ -999,6 +1014,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
|
|
||||||
var placeEditor = function(useRemainingWidth)
|
var placeEditor = function(useRemainingWidth)
|
||||||
{
|
{
|
||||||
|
#if PLATFORM(DOM)
|
||||||
var element = [self _inputElement],
|
var element = [self _inputElement],
|
||||||
textWidth = 1;
|
textWidth = 1;
|
||||||
|
|
||||||
@@ -1008,6 +1024,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
// without clipping. Since different fonts might have different sizes of "X" this
|
// without clipping. Since different fonts might have different sizes of "X" this
|
||||||
// solution is not ideal, but it works.
|
// solution is not ideal, but it works.
|
||||||
textWidth = [(element.value || @"") + "X" sizeWithFont:[self font]].width;
|
textWidth = [(element.value || @"") + "X" sizeWithFont:[self font]].width;
|
||||||
|
|
||||||
if (useRemainingWidth)
|
if (useRemainingWidth)
|
||||||
textWidth = MAX(contentSize.width - offset.x - 1, textWidth);
|
textWidth = MAX(contentSize.width - offset.x - 1, textWidth);
|
||||||
}
|
}
|
||||||
@@ -1022,6 +1039,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
// When editing, always scroll to the cursor.
|
// When editing, always scroll to the cursor.
|
||||||
if (_selectedRange.length == 0)
|
if (_selectedRange.length == 0)
|
||||||
[[_tokenScrollView documentView] scrollRectToVisible:inputFrame];
|
[[_tokenScrollView documentView] scrollRectToVisible:inputFrame];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0, count = [tokens count]; i < count; i++)
|
for (var i = 0, count = [tokens count]; i < count; i++)
|
||||||
@@ -1048,6 +1066,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
if (isEditing && CPMaxRange(_selectedRange) >= [tokens count])
|
if (isEditing && CPMaxRange(_selectedRange) >= [tokens count])
|
||||||
placeEditor(true);
|
placeEditor(true);
|
||||||
|
|
||||||
|
#if PLATFORM(DOM)
|
||||||
// Hide the editor if there are selected tokens, but still keep it active
|
// Hide the editor if there are selected tokens, but still keep it active
|
||||||
// so we can continue using our standard keyboard handling events.
|
// so we can continue using our standard keyboard handling events.
|
||||||
if (isEditing && _selectedRange.length)
|
if (isEditing && _selectedRange.length)
|
||||||
@@ -1055,24 +1074,27 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
[self _inputElement].style.left = "-10000px";
|
[self _inputElement].style.left = "-10000px";
|
||||||
[self _inputElement].focus();
|
[self _inputElement].focus();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Trim off any excess height downwards.
|
// Trim off any excess height downwards.
|
||||||
if (CGRectGetHeight([contentView bounds]) > offset.y + tokenHeight)
|
if (CGRectGetHeight([contentView bounds]) > offset.y + tokenHeight)
|
||||||
[contentView setFrame:CGRectMake(0, 0, CGRectGetWidth([_tokenScrollView bounds]), offset.y + tokenHeight)];
|
[contentView setFrame:_CGRectMake(0, 0, CGRectGetWidth([_tokenScrollView bounds]), offset.y + tokenHeight)];
|
||||||
|
|
||||||
if (_shouldScrollTo !== CPScrollDestinationNone)
|
if (_shouldScrollTo !== CPScrollDestinationNone)
|
||||||
{
|
{
|
||||||
// Only carry out the scroll if the cursor isn't visible.
|
// Only carry out the scroll if the cursor isn't visible.
|
||||||
if (!(isEditing && _selectedRange.length == 0))
|
if (!(isEditing && _selectedRange.length == 0))
|
||||||
{
|
{
|
||||||
|
|
||||||
var scrollToToken = _shouldScrollTo;
|
var scrollToToken = _shouldScrollTo;
|
||||||
|
|
||||||
if (scrollToToken === CPScrollDestinationLeft)
|
if (scrollToToken === CPScrollDestinationLeft)
|
||||||
scrollToToken = tokens[_selectedRange.location]
|
scrollToToken = tokens[_selectedRange.location]
|
||||||
else if (scrollToToken === CPScrollDestinationRight)
|
else if (scrollToToken === CPScrollDestinationRight)
|
||||||
scrollToToken = tokens[MAX(0, CPMaxRange(_selectedRange) - 1)];
|
scrollToToken = tokens[MAX(0, CPMaxRange(_selectedRange) - 1)];
|
||||||
|
|
||||||
[self _scrollTokenViewToVisible:scrollToToken];
|
[self _scrollTokenViewToVisible:scrollToToken];
|
||||||
}
|
}
|
||||||
|
|
||||||
_shouldScrollTo = CPScrollDestinationNone;
|
_shouldScrollTo = CPScrollDestinationNone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1188,11 +1210,11 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
return "tokenfield-token";
|
return "tokenfield-token";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithFrame:(CPRect)frame
|
- (id)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
||||||
if (self = [super initWithFrame:frame])
|
if (self = [super initWithFrame:frame])
|
||||||
{
|
{
|
||||||
_deleteButton = [[_CPTokenFieldTokenCloseButton alloc] initWithFrame:CPRectMakeZero()];
|
_deleteButton = [[_CPTokenFieldTokenCloseButton alloc] initWithFrame:_CGRectMakeZero()];
|
||||||
[self addSubview:_deleteButton];
|
[self addSubview:_deleteButton];
|
||||||
|
|
||||||
[self setEditable:NO];
|
[self setEditable:NO];
|
||||||
@@ -1253,7 +1275,7 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
|||||||
buttonOffset = [_deleteButton currentValueForThemeAttribute:@"offset"],
|
buttonOffset = [_deleteButton currentValueForThemeAttribute:@"offset"],
|
||||||
buttonSize = [_deleteButton currentValueForThemeAttribute:@"min-size"];
|
buttonSize = [_deleteButton currentValueForThemeAttribute:@"min-size"];
|
||||||
|
|
||||||
[_deleteButton setFrame:CPRectMake(CPRectGetMaxX(frame) - buttonOffset.x, CPRectGetMinY(frame) + buttonOffset.y, buttonSize.width, buttonSize.height)];
|
[_deleteButton setFrame:_CGRectMake(_CGRectGetMaxX(frame) - buttonOffset.x, _CGRectGetMinY(frame) + buttonOffset.y, buttonSize.width, buttonSize.height)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1329,4 +1351,4 @@ var CPTokenFieldTokenizingCharacterSetKey = "CPTokenFieldTokenizingCharacterSe
|
|||||||
[aCoder encodeDouble:_completionDelay forKey:CPTokenFieldCompletionDelayKey];
|
[aCoder encodeDouble:_completionDelay forKey:CPTokenFieldCompletionDelayKey];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ var CPViewFlags = { },
|
|||||||
_DOMImageSizes = [];
|
_DOMImageSizes = [];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_theme = [CPTheme defaultTheme];
|
_theme = [CPTheme themeForView:self];
|
||||||
_themeState = CPThemeStateNormal;
|
_themeState = CPThemeStateNormal;
|
||||||
|
|
||||||
[self setupViewFlags];
|
[self setupViewFlags];
|
||||||
@@ -2543,6 +2543,32 @@ setBoundsOrigin:
|
|||||||
return (_themeAttributes && _themeAttributes[aName] !== undefined);
|
return (_themeAttributes && _themeAttributes[aName] !== undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)registerThemeValues:(CPArray)themeValues
|
||||||
|
{
|
||||||
|
for (var i = 0; i < themeValues.length; ++i)
|
||||||
|
{
|
||||||
|
var attributeValueState = themeValues[i],
|
||||||
|
attribute = attributeValueState[0],
|
||||||
|
value = attributeValueState[1],
|
||||||
|
state = attributeValueState[2];
|
||||||
|
|
||||||
|
if (state)
|
||||||
|
[self setValue:value forThemeAttribute:attribute inState:state];
|
||||||
|
else
|
||||||
|
[self setValue:value forThemeAttribute:attribute];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)registerThemeValues:(CPArray)themeValues inherit:(CPArray)inheritedValues
|
||||||
|
{
|
||||||
|
// Register inherited values first, then override those with the subtheme values.
|
||||||
|
if (inheritedValues)
|
||||||
|
[self registerThemeValues:inheritedValues];
|
||||||
|
|
||||||
|
if (themeValues)
|
||||||
|
[self registerThemeValues:themeValues];
|
||||||
|
}
|
||||||
|
|
||||||
- (CPView)createEphemeralSubviewNamed:(CPString)aViewName
|
- (CPView)createEphemeralSubviewNamed:(CPString)aViewName
|
||||||
{
|
{
|
||||||
return nil;
|
return nil;
|
||||||
@@ -2695,7 +2721,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
|||||||
|
|
||||||
[self setupViewFlags];
|
[self setupViewFlags];
|
||||||
|
|
||||||
_theme = [CPTheme defaultTheme];
|
_theme = [CPTheme themeForView:self];
|
||||||
_themeClass = [aCoder decodeObjectForKey:CPViewThemeClassKey];
|
_themeClass = [aCoder decodeObjectForKey:CPViewThemeClassKey];
|
||||||
_themeState = CPThemeState([aCoder decodeIntForKey:CPViewThemeStateKey]);
|
_themeState = CPThemeState([aCoder decodeIntForKey:CPViewThemeStateKey]);
|
||||||
_themeAttributes = {};
|
_themeAttributes = {};
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* CPCibRuntimeAttributesConnector.j
|
||||||
|
* AppKit
|
||||||
|
*
|
||||||
|
* Created by Aparajita Fishman.
|
||||||
|
* Copyright 2011, 280 North, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import "CPCibConnector.j"
|
||||||
|
|
||||||
|
var CPCibRuntimeAttributesConnectorObjectKey = @"CPCibRuntimeAttributesConnectorObjectKey",
|
||||||
|
CPCibRuntimeAttributesConnectorKeyPathsKey = @"CPCibRuntimeAttributesConnectorKeyPathsKey",
|
||||||
|
CPCibRuntimeAttributesConnectorValuesKey = @"CPCibRuntimeAttributesConnectorValuesKey";
|
||||||
|
|
||||||
|
@implementation CPCibRuntimeAttributesConnector : CPCibConnector
|
||||||
|
{
|
||||||
|
id _keyPaths;
|
||||||
|
id _values;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithCoder:(CPCoder)aCoder
|
||||||
|
{
|
||||||
|
if (self = [super initWithCoder:aCoder])
|
||||||
|
{
|
||||||
|
_source = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorObjectKey];
|
||||||
|
_keyPaths = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorKeyPathsKey];
|
||||||
|
_values = [aCoder decodeObjectForKey:CPCibRuntimeAttributesConnectorValuesKey];
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||||
|
{
|
||||||
|
[super encodeWithCoder:aCoder];
|
||||||
|
|
||||||
|
[aCoder encodeObject:_source forKey:CPCibRuntimeAttributesConnectorObjectKey];
|
||||||
|
[aCoder encodeObject:_keyPaths forKey:CPCibRuntimeAttributesConnectorKeyPathsKey];
|
||||||
|
[aCoder encodeObject:_values forKey:CPCibRuntimeAttributesConnectorValuesKey];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)establishConnection
|
||||||
|
{
|
||||||
|
var count = [_keyPaths count];
|
||||||
|
|
||||||
|
while (count--)
|
||||||
|
[_source setValue:_values[count] forKeyPath:_keyPaths[count]];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -61,14 +61,14 @@ var _CPCibClassSwapperClassNameKey = @"_CPCibClassSwapperClassNameKey",
|
|||||||
|
|
||||||
if (!object)
|
if (!object)
|
||||||
{
|
{
|
||||||
CPLog.error("Unable to find class " + theClassName + " in cib file.");
|
CPLog.error("Unable to find class " + theClassName + " referenced in cib file.");
|
||||||
|
|
||||||
object = [self allocObjectWithCoder:aCoder className:[aCoder decodeObjectForKey:_CPCibClassSwapperOriginalClassNameKey]];
|
object = [self allocObjectWithCoder:aCoder className:[aCoder decodeObjectForKey:_CPCibClassSwapperOriginalClassNameKey]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!object)
|
if (!object)
|
||||||
[CPException raise:CPInvalidArgumentException reason:@"Unable to find class " + theClassName + " in cib file."];
|
[CPException raise:CPInvalidArgumentException reason:@"Unable to find class " + theClassName + " referenced in cib file."];
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ var _CPCibCustomResourceClassNameKey = @"_CPCibCustomResourceClassNameKey",
|
|||||||
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObject:aSize forKey:@"size"]];
|
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObject:aSize forKey:@"size"]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (id)imageResourceWithName:(CPString)aResourceName size:(CGSize)aSize bundleClass:(CPString)aBundleClass
|
||||||
|
{
|
||||||
|
return [[self alloc] initWithClassName:@"CPImage" resourceName:aResourceName properties:[CPDictionary dictionaryWithObjects:[aSize, aBundleClass] forKeys:[@"size", @"bundleClass"]]];
|
||||||
|
}
|
||||||
|
|
||||||
- (id)initWithClassName:(CPString)aClassName resourceName:(CPString)aResourceName properties:(CPDictionary)properties
|
- (id)initWithClassName:(CPString)aClassName resourceName:(CPString)aResourceName properties:(CPDictionary)properties
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
@@ -89,7 +94,18 @@ var _CPCibCustomResourceClassNameKey = @"_CPCibCustomResourceClassNameKey",
|
|||||||
else if (_resourceName == "CPRemoveTemplate")
|
else if (_resourceName == "CPRemoveTemplate")
|
||||||
return [[CPImage alloc] initWithContentsOfFile:[[CPBundle bundleForClass:[CPButtonBar class]] pathForResource:@"minus_button.png"] size:CGSizeMake(11, 4)];
|
return [[CPImage alloc] initWithContentsOfFile:[[CPBundle bundleForClass:[CPButtonBar class]] pathForResource:@"minus_button.png"] size:CGSizeMake(11, 4)];
|
||||||
|
|
||||||
return [[CPImage alloc] initWithContentsOfFile:[[aCoder bundle] pathForResource:_resourceName] size:_properties.valueForKey(@"size")];
|
var bundleClass = _properties.valueForKey(@"bundleClass"),
|
||||||
|
bundle = nil;
|
||||||
|
|
||||||
|
if (bundleClass)
|
||||||
|
{
|
||||||
|
bundleClass = CPClassFromString(bundleClass);
|
||||||
|
|
||||||
|
if (bundleClass)
|
||||||
|
bundle = [CPBundle bundleForClass:bundleClass];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [[CPImage alloc] initWithContentsOfFile:[(bundle || [aCoder bundle]) pathForResource:_resourceName] size:_properties.valueForKey(@"size")];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
@import "CPCibControlConnector.j"
|
@import "CPCibControlConnector.j"
|
||||||
@import "CPCibOutletConnector.j"
|
@import "CPCibOutletConnector.j"
|
||||||
@import "CPCibBindingConnector.j"
|
@import "CPCibBindingConnector.j"
|
||||||
|
@import "CPCibRuntimeAttributesConnector.j"
|
||||||
|
|
||||||
|
|
||||||
@implementation _CPCibObjectData : CPObject
|
@implementation _CPCibObjectData : CPObject
|
||||||
@@ -257,11 +258,29 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
|
|||||||
_replacementObjects[[_fileOwner UID]] = anOwner;
|
_replacementObjects[[_fileOwner UID]] = anOwner;
|
||||||
|
|
||||||
var index = 0,
|
var index = 0,
|
||||||
count = _connections.length;
|
count = _connections.length,
|
||||||
|
runtimeAttributeConnectors = [],
|
||||||
|
connection = nil;
|
||||||
|
|
||||||
for (; index < count; ++index)
|
for (; index < count; ++index)
|
||||||
{
|
{
|
||||||
var connection = _connections[index];
|
connection = _connections[index];
|
||||||
|
|
||||||
|
if ([connection isKindOfClass:[CPCibRuntimeAttributesConnector class]])
|
||||||
|
// Defer runtime attribute connections until after all other connections are made
|
||||||
|
runtimeAttributeConnectors.push(connection);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[connection replaceObjects:_replacementObjects];
|
||||||
|
[connection establishConnection];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
count = runtimeAttributeConnectors.length;
|
||||||
|
|
||||||
|
for (index = 0; index < count; ++index)
|
||||||
|
{
|
||||||
|
connection = runtimeAttributeConnectors[index];
|
||||||
|
|
||||||
[connection replaceObjects:_replacementObjects];
|
[connection replaceObjects:_replacementObjects];
|
||||||
[connection establishConnection];
|
[connection establishConnection];
|
||||||
|
|||||||
@@ -267,6 +267,32 @@ function CGPointFromEvent(anEvent)
|
|||||||
return _CGPointMake(anEvent.clientX, anEvent.clientY);
|
return _CGPointMake(anEvent.clientX, anEvent.clientY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Combines two insets by adding their individual elements and returns the result.
|
||||||
|
|
||||||
|
@group CGInset
|
||||||
|
*/
|
||||||
|
function CGInsetUnion(lhsInset, rhsInset)
|
||||||
|
{
|
||||||
|
return _CGInsetMake(lhsInset.top + rhsInset.top,
|
||||||
|
lhsInset.right + rhsInset.right,
|
||||||
|
lhsInset.bottom + rhsInset.bottom,
|
||||||
|
lhsInset.left + rhsInset.left);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Subtract one inset from another by subtracting their individual elements and returns the result.
|
||||||
|
|
||||||
|
@group CGInset
|
||||||
|
*/
|
||||||
|
function CGInsetDifference(lhsInset, rhsInset)
|
||||||
|
{
|
||||||
|
return _CGInsetMake(lhsInset.top - rhsInset.top,
|
||||||
|
lhsInset.right - rhsInset.right,
|
||||||
|
lhsInset.bottom - rhsInset.bottom,
|
||||||
|
lhsInset.left - rhsInset.left);
|
||||||
|
}
|
||||||
|
|
||||||
function CGInsetFromString(aString)
|
function CGInsetFromString(aString)
|
||||||
{
|
{
|
||||||
var numbers = aString.substr(1, aString.length - 2).split(',');
|
var numbers = aString.substr(1, aString.length - 2).split(',');
|
||||||
|
|||||||
|
After Width: | Height: | Size: 146 B |
|
After Width: | Height: | Size: 141 B |
|
After Width: | Height: | Size: 219 B |
|
After Width: | Height: | Size: 490 B |
|
After Width: | Height: | Size: 160 B |
|
After Width: | Height: | Size: 361 B |
|
After Width: | Height: | Size: 694 B |
|
After Width: | Height: | Size: 221 B |
|
After Width: | Height: | Size: 146 B |
|
After Width: | Height: | Size: 141 B |
|
After Width: | Height: | Size: 219 B |
|
After Width: | Height: | Size: 407 B |
|
After Width: | Height: | Size: 160 B |
|
After Width: | Height: | Size: 348 B |
|
After Width: | Height: | Size: 622 B |
|
After Width: | Height: | Size: 217 B |
|
After Width: | Height: | Size: 422 B |
|
After Width: | Height: | Size: 527 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 142 B |
|
After Width: | Height: | Size: 142 B |
|
After Width: | Height: | Size: 447 B |
|
After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 757 B After Width: | Height: | Size: 844 B |
|
Before Width: | Height: | Size: 735 B After Width: | Height: | Size: 908 B |
|
Before Width: | Height: | Size: 559 B After Width: | Height: | Size: 472 B |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 515 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 1004 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 160 B |
|
Before Width: | Height: | Size: 994 B After Width: | Height: | Size: 117 B |
|
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 109 B |
|
Before Width: | Height: | Size: 994 B After Width: | Height: | Size: 115 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 997 B After Width: | Height: | Size: 124 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 159 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 160 B |
|
Before Width: | Height: | Size: 1004 B After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 994 B After Width: | Height: | Size: 117 B |
|
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 109 B |
|
Before Width: | Height: | Size: 994 B After Width: | Height: | Size: 115 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 997 B After Width: | Height: | Size: 124 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 159 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 214 B |
|
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 133 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 109 B |
|
Before Width: | Height: | Size: 1009 B After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 225 B |
|
Before Width: | Height: | Size: 1007 B After Width: | Height: | Size: 134 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 212 B |
@@ -762,46 +762,47 @@ var themedButtonValues = nil,
|
|||||||
|
|
||||||
bezelColor = PatternColor(
|
bezelColor = PatternColor(
|
||||||
[
|
[
|
||||||
["textfield-bezel-square-0.png", 3.0, 4.0],
|
["textfield-bezel-square-0.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-1.png", 1.0, 4.0],
|
["textfield-bezel-square-1.png", 1.0, 6.0],
|
||||||
["textfield-bezel-square-2.png", 3.0, 4.0],
|
["textfield-bezel-square-2.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-3.png", 3.0, 1.0],
|
["textfield-bezel-square-3.png", 6.0, 1.0],
|
||||||
["textfield-bezel-square-4.png", 1.0, 1.0],
|
["textfield-bezel-square-4.png", 1.0, 1.0],
|
||||||
["textfield-bezel-square-5.png", 3.0, 1.0],
|
["textfield-bezel-square-5.png", 6.0, 1.0],
|
||||||
["textfield-bezel-square-6.png", 3.0, 4.0],
|
["textfield-bezel-square-6.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-7.png", 1.0, 4.0],
|
["textfield-bezel-square-7.png", 1.0, 6.0],
|
||||||
["textfield-bezel-square-8.png", 3.0, 4.0]
|
["textfield-bezel-square-8.png", 6.0, 6.0]
|
||||||
]),
|
]),
|
||||||
|
|
||||||
bezelFocusedColor = PatternColor(
|
bezelFocusedColor = PatternColor(
|
||||||
[
|
[
|
||||||
["textfield-bezel-square-focused-0.png", 7.0, 7.0],
|
["textfield-bezel-square-focused-0.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-focused-1.png", 1.0, 7.0],
|
["textfield-bezel-square-focused-1.png", 1.0, 6.0],
|
||||||
["textfield-bezel-square-focused-2.png", 7.0, 7.0],
|
["textfield-bezel-square-focused-2.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-focused-3.png", 7.0, 1.0],
|
["textfield-bezel-square-focused-3.png", 6.0, 1.0],
|
||||||
["textfield-bezel-square-focused-4.png", 1.0, 1.0],
|
["textfield-bezel-square-focused-4.png", 1.0, 1.0],
|
||||||
["textfield-bezel-square-focused-5.png", 7.0, 1.0],
|
["textfield-bezel-square-focused-5.png", 6.0, 1.0],
|
||||||
["textfield-bezel-square-focused-6.png", 7.0, 7.0],
|
["textfield-bezel-square-focused-6.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-focused-7.png", 1.0, 7.0],
|
["textfield-bezel-square-focused-7.png", 1.0, 6.0],
|
||||||
["textfield-bezel-square-focused-8.png", 7.0, 7.0]
|
["textfield-bezel-square-focused-8.png", 6.0, 6.0]
|
||||||
]),
|
]),
|
||||||
|
|
||||||
bezelDisabledColor = PatternColor(
|
bezelDisabledColor = PatternColor(
|
||||||
[
|
[
|
||||||
["textfield-bezel-square-disabled-0.png", 3.0, 4.0],
|
["textfield-bezel-square-disabled-0.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-disabled-1.png", 1.0, 4.0],
|
["textfield-bezel-square-disabled-1.png", 1.0, 6.0],
|
||||||
["textfield-bezel-square-disabled-2.png", 3.0, 4.0],
|
["textfield-bezel-square-disabled-2.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-disabled-3.png", 3.0, 1.0],
|
["textfield-bezel-square-disabled-3.png", 6.0, 1.0],
|
||||||
["textfield-bezel-square-disabled-4.png", 1.0, 1.0],
|
["textfield-bezel-square-disabled-4.png", 1.0, 1.0],
|
||||||
["textfield-bezel-square-disabled-5.png", 3.0, 1.0],
|
["textfield-bezel-square-disabled-5.png", 6.0, 1.0],
|
||||||
["textfield-bezel-square-disabled-6.png", 3.0, 4.0],
|
["textfield-bezel-square-disabled-6.png", 6.0, 6.0],
|
||||||
["textfield-bezel-square-disabled-7.png", 1.0, 4.0],
|
["textfield-bezel-square-disabled-7.png", 1.0, 6.0],
|
||||||
["textfield-bezel-square-disabled-8.png", 3.0, 4.0]
|
["textfield-bezel-square-disabled-8.png", 6.0, 6.0]
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
textDisabledColor = [CPColor colorWithCalibratedWhite:0.60 alpha:1.0],
|
||||||
placeholderColor = [CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0];
|
placeholderColor = [CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0];
|
||||||
|
|
||||||
// Global for reuse by CPTokenField.
|
// Global for reuse by subclasses
|
||||||
themedTextFieldValues =
|
themedTextFieldValues =
|
||||||
[
|
[
|
||||||
[@"vertical-alignment", CPTopVerticalTextAlignment, CPThemeStateBezeled],
|
[@"vertical-alignment", CPTopVerticalTextAlignment, CPThemeStateBezeled],
|
||||||
@@ -810,30 +811,37 @@ var themedButtonValues = nil,
|
|||||||
[@"bezel-color", bezelDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
|
[@"bezel-color", bezelDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
|
||||||
[@"font", [CPFont systemFontOfSize:12.0], CPThemeStateBezeled],
|
[@"font", [CPFont systemFontOfSize:12.0], CPThemeStateBezeled],
|
||||||
|
|
||||||
[@"content-inset", CGInsetMake(8.0, 7.0, 5.0, 8.0), CPThemeStateBezeled],
|
// no border
|
||||||
[@"content-inset", CGInsetMake(7.0, 7.0, 5.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
|
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0)],
|
||||||
[@"bezel-inset", CGInsetMake(3.0, 4.0, 3.0, 4.0), CPThemeStateBezeled],
|
[@"content-inset", CGInsetMake(2.0, 2.0, 2.0, 2.0)], // as defined in [CPTextField +themeAttributes]
|
||||||
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled | CPThemeStateEditing],
|
|
||||||
|
|
||||||
|
// with border
|
||||||
|
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled],
|
||||||
|
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled | CPThemeStateEditing],
|
||||||
|
[@"border-inset", CGInsetMake(3.0, 3.0, 3.0, 3.0), CPThemeStateBezeled],
|
||||||
|
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 8.0), CPThemeStateBezeled],
|
||||||
|
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
|
||||||
|
|
||||||
|
[@"text-color", textDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
|
||||||
[@"text-color", placeholderColor, CPTextFieldStatePlaceholder],
|
[@"text-color", placeholderColor, CPTextFieldStatePlaceholder],
|
||||||
|
|
||||||
[@"line-break-mode", CPLineBreakByTruncatingTail, CPThemeStateTableDataView],
|
[@"line-break-mode", CPLineBreakByTruncatingTail, CPThemeStateTableDataView],
|
||||||
[@"vertical-alignment", CPCenterVerticalTextAlignment, CPThemeStateTableDataView],
|
[@"vertical-alignment", CPCenterVerticalTextAlignment, CPThemeStateTableDataView],
|
||||||
[@"content-inset", CGInsetMake(0.0, 0.0, 0.0, 5.0), CPThemeStateTableDataView],
|
[@"content-inset", CGInsetMake(0.0, 0.0, 0.0, 4.0), CPThemeStateTableDataView],
|
||||||
|
|
||||||
[@"text-color", [CPColor colorWithCalibratedWhite:51.0 / 255.0 alpha:1.0], CPThemeStateTableDataView],
|
[@"text-color", [CPColor colorWithCalibratedWhite:51.0 / 255.0 alpha:1.0], CPThemeStateTableDataView],
|
||||||
[@"text-color", [CPColor whiteColor], CPThemeStateTableDataView | CPThemeStateSelectedTableDataView],
|
[@"text-color", [CPColor whiteColor], CPThemeStateTableDataView | CPThemeStateSelectedTableDataView],
|
||||||
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateSelectedTableDataView],
|
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateSelectedTableDataView],
|
||||||
[@"text-color", [CPColor blackColor], CPThemeStateTableDataView | CPThemeStateEditing],
|
[@"text-color", [CPColor blackColor], CPThemeStateTableDataView | CPThemeStateEditing],
|
||||||
[@"content-inset", CGInsetMake(7.0, 7.0, 5.0, 8.0), CPThemeStateTableDataView | CPThemeStateEditing],
|
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 4.0), CPThemeStateTableDataView | CPThemeStateEditing],
|
||||||
[@"font", [CPFont systemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateEditing],
|
[@"font", [CPFont systemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateEditing],
|
||||||
[@"bezel-inset", CGInsetMake(-2.0, -2.0, -2.0, -2.0), CPThemeStateTableDataView | CPThemeStateEditing],
|
[@"bezel-inset", CGInsetMake(-1.0, -1.0, -1.0, -1.0), CPThemeStateTableDataView | CPThemeStateEditing],
|
||||||
|
|
||||||
[@"text-color", [CPColor colorWithCalibratedWhite:125.0 / 255.0 alpha:1.0], CPThemeStateTableDataView | CPThemeStateGroupRow],
|
[@"text-color", [CPColor colorWithCalibratedWhite:125.0 / 255.0 alpha:1.0], CPThemeStateTableDataView | CPThemeStateGroupRow],
|
||||||
[@"text-color", [CPColor colorWithCalibratedWhite:1.0 alpha:1.0], CPThemeStateTableDataView | CPThemeStateGroupRow | CPThemeStateSelectedTableDataView],
|
[@"text-color", [CPColor colorWithCalibratedWhite:1.0 alpha:1.0], CPThemeStateTableDataView | CPThemeStateGroupRow | CPThemeStateSelectedTableDataView],
|
||||||
[@"text-shadow-color", [CPColor whiteColor], CPThemeStateTableDataView | CPThemeStateGroupRow],
|
[@"text-shadow-color", [CPColor whiteColor], CPThemeStateTableDataView | CPThemeStateGroupRow],
|
||||||
[@"text-shadow-offset", CGSizeMake(0,1), CPThemeStateTableDataView | CPThemeStateGroupRow],
|
[@"text-shadow-offset", CGSizeMake(0,1), CPThemeStateTableDataView | CPThemeStateGroupRow],
|
||||||
[@"text-shadow-color", [CPColor colorWithCalibratedWhite:0.0 alpha:0.6], CPThemeStateTableDataView | CPThemeStateGroupRow | CPThemeStateSelectedTableDataView],
|
[@"text-shadow-color", [CPColor colorWithCalibratedWhite:0.0 alpha:0.6], CPThemeStateTableDataView | CPThemeStateGroupRow | CPThemeStateSelectedTableDataView],
|
||||||
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateGroupRow]
|
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateGroupRow]
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -853,35 +861,45 @@ var themedButtonValues = nil,
|
|||||||
var textfield = [[CPTextField alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 30.0)],
|
var textfield = [[CPTextField alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 30.0)],
|
||||||
bezelColor = PatternColor(
|
bezelColor = PatternColor(
|
||||||
[
|
[
|
||||||
["textfield-bezel-rounded-left.png", 13.0, 22.0],
|
["textfield-bezel-rounded-left.png", 15.0, 30.0],
|
||||||
["textfield-bezel-rounded-center.png", 1.0, 22.0],
|
["textfield-bezel-rounded-center.png", 1.0, 30.0],
|
||||||
["textfield-bezel-rounded-right.png", 13.0, 22.0]
|
["textfield-bezel-rounded-right.png", 15.0, 30.0]
|
||||||
],
|
],
|
||||||
PatternIsHorizontal),
|
PatternIsHorizontal),
|
||||||
|
|
||||||
bezelFocusedColor = PatternColor(
|
bezelFocusedColor = PatternColor(
|
||||||
[
|
[
|
||||||
["textfield-bezel-rounded-focused-left.png", 17.0, 30.0],
|
["textfield-bezel-rounded-focused-left.png", 15.0, 30.0],
|
||||||
["textfield-bezel-rounded-focused-center.png", 1.0, 30.0],
|
["textfield-bezel-rounded-focused-center.png", 1.0, 30.0],
|
||||||
["textfield-bezel-rounded-focused-right.png", 17.0, 30.0]
|
["textfield-bezel-rounded-focused-right.png", 15.0, 30.0]
|
||||||
|
],
|
||||||
|
PatternIsHorizontal),
|
||||||
|
|
||||||
|
bezelDisabledColor = PatternColor(
|
||||||
|
[
|
||||||
|
["textfield-bezel-rounded-disabled-left.png", 15.0, 30.0],
|
||||||
|
["textfield-bezel-rounded-disabled-center.png", 1.0, 30.0],
|
||||||
|
["textfield-bezel-rounded-disabled-right.png", 15.0, 30.0]
|
||||||
],
|
],
|
||||||
PatternIsHorizontal),
|
PatternIsHorizontal),
|
||||||
|
|
||||||
placeholderColor = [CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0];
|
placeholderColor = [CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0];
|
||||||
|
|
||||||
// Global for reuse by CPSearchField
|
// Global for reuse by subclasses
|
||||||
themedRoundedTextFieldValues =
|
themedRoundedTextFieldValues =
|
||||||
[
|
[
|
||||||
[@"bezel-color", bezelColor, CPTextFieldStateRounded | CPThemeStateBezeled],
|
[@"bezel-color", bezelColor, CPTextFieldStateRounded | CPThemeStateBezeled],
|
||||||
[@"bezel-color", bezelFocusedColor, CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
|
[@"bezel-color", bezelFocusedColor, CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
|
||||||
|
[@"bezel-color", bezelDisabledColor, CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateDisabled],
|
||||||
[@"font", [CPFont systemFontOfSize:12.0]],
|
[@"font", [CPFont systemFontOfSize:12.0]],
|
||||||
|
|
||||||
[@"content-inset", CGInsetMake(8.0, 14.0, 6.0, 14.0), CPTextFieldStateRounded | CPThemeStateBezeled],
|
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPTextFieldStateRounded | CPThemeStateBezeled],
|
||||||
[@"content-inset", CGInsetMake(7.0, 14.0, 6.0, 14.0), CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
|
|
||||||
|
|
||||||
[@"bezel-inset", CGInsetMake(4.0, 4.0, 4.0, 4.0), CPTextFieldStateRounded | CPThemeStateBezeled],
|
|
||||||
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
|
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
|
||||||
|
|
||||||
|
// There is one extra empty pixel at the bottom for size compatibility with an earlier version.
|
||||||
|
[@"content-inset", CGInsetMake(8.0, 15.0, 8.0, 15.0), CPTextFieldStateRounded | CPThemeStateBezeled],
|
||||||
|
[@"content-inset", CGInsetMake(8.0, 15.0, 8.0, 15.0), CPTextFieldStateRounded | CPThemeStateBezeled | CPThemeStateEditing],
|
||||||
|
|
||||||
[@"text-color", placeholderColor, CPTextFieldStateRounded | CPTextFieldStatePlaceholder],
|
[@"text-color", placeholderColor, CPTextFieldStateRounded | CPTextFieldStatePlaceholder],
|
||||||
|
|
||||||
[@"min-size", CGSizeMake(0.0, 30.0), CPTextFieldStateRounded | CPThemeStateBezeled],
|
[@"min-size", CGSizeMake(0.0, 30.0), CPTextFieldStateRounded | CPThemeStateBezeled],
|
||||||
@@ -914,11 +932,17 @@ var themedButtonValues = nil,
|
|||||||
|
|
||||||
overrides =
|
overrides =
|
||||||
[
|
[
|
||||||
[@"content-inset", CGInsetMake(8.0, 0.0, 4.0, 0.0)],
|
// Non-bezeled token field with tokens
|
||||||
// Placeholder is displayed as regular text, not tokens; requires a different inset.
|
[@"content-inset", CGInsetMake(5.0, 8.0, 4.0, 8.0)],
|
||||||
[@"content-inset", CGInsetMake(9.0, 0.0, 5.0, 2.0), CPTextFieldStatePlaceholder],
|
|
||||||
[@"content-inset", CGInsetMake(6.0, 5.0, 5.0, 6.0), CPThemeStateBezeled],
|
// Non-bezeled token field with no tokens
|
||||||
[@"content-inset", CGInsetMake(9.0, 7.0, 6.0, 8.0), CPThemeStateBezeled | CPTextFieldStatePlaceholder],
|
[@"content-inset", CGInsetMake(7.0, 8.0, 6.0, 8.0), CPTextFieldStatePlaceholder],
|
||||||
|
|
||||||
|
// Bezeled token field with tokens
|
||||||
|
[@"content-inset", CGInsetMake(6.0, 8.0, 5.0, 8.0), CPThemeStateBezeled],
|
||||||
|
|
||||||
|
// Bezeled token field with no tokens
|
||||||
|
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 8.0), CPThemeStateBezeled | CPTextFieldStatePlaceholder],
|
||||||
];
|
];
|
||||||
|
|
||||||
[self registerThemeValues:overrides forView:tokenfield inherit:themedTextFieldValues];
|
[self registerThemeValues:overrides forView:tokenfield inherit:themedTextFieldValues];
|
||||||
@@ -958,13 +982,13 @@ var themedButtonValues = nil,
|
|||||||
[@"text-color", textHighlightedColor, CPThemeStateHighlighted],
|
[@"text-color", textHighlightedColor, CPThemeStateHighlighted],
|
||||||
|
|
||||||
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled],
|
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled],
|
||||||
[@"content-inset", CGInsetMake(1.0, 24.0, 2.0, 16.0), CPThemeStateBezeled],
|
[@"content-inset", CGInsetMake(1.0, 23.0, 3.0, 15.0), CPThemeStateBezeled],
|
||||||
|
|
||||||
// Minimum height == maximum height since tokens are fixed height.
|
// Minimum height == maximum height since tokens are fixed height.
|
||||||
[@"min-size", CGSizeMake(0.0, 19.0)],
|
[@"min-size", CGSizeMake(0.0, 19.0)],
|
||||||
[@"max-size", CGSizeMake(-1.0, 19.0)],
|
[@"max-size", CGSizeMake(-1.0, 19.0)],
|
||||||
|
|
||||||
[@"vertical-alignment", CPCenterTextAlignment],
|
[@"vertical-alignment", CPCenterTextAlignment]
|
||||||
];
|
];
|
||||||
|
|
||||||
[self registerThemeValues:themeValues forView:token];
|
[self registerThemeValues:themeValues forView:token];
|
||||||
@@ -990,7 +1014,7 @@ var themedButtonValues = nil,
|
|||||||
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBordered],
|
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBordered],
|
||||||
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBordered | CPThemeStateHighlighted],
|
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBordered | CPThemeStateHighlighted],
|
||||||
|
|
||||||
[@"offset", CGPointMake(18, 6), CPThemeStateBordered]
|
[@"offset", CGPointMake(17, 6), CPThemeStateBordered]
|
||||||
];
|
];
|
||||||
|
|
||||||
[self registerThemeValues:themeValues forView:button];
|
[self registerThemeValues:themeValues forView:button];
|
||||||
@@ -998,6 +1022,86 @@ var themedButtonValues = nil,
|
|||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (CPComboBox)themedComboBox
|
||||||
|
{
|
||||||
|
var combo = [[CPComboBox alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 29.0)],
|
||||||
|
|
||||||
|
bezelColor = PatternColor(
|
||||||
|
[
|
||||||
|
["combobox-bezel-left.png", 6.0, 29.0],
|
||||||
|
["combobox-bezel-center.png", 1.0, 29.0],
|
||||||
|
["combobox-bezel-right.png", 24.0, 29.0]
|
||||||
|
],
|
||||||
|
PatternIsHorizontal),
|
||||||
|
|
||||||
|
bezelFocusedColor = PatternColor(
|
||||||
|
[
|
||||||
|
["combobox-bezel-focused-left.png", 6.0, 29.0],
|
||||||
|
["combobox-bezel-focused-center.png", 1.0, 29.0],
|
||||||
|
["combobox-bezel-focused-right.png", 24.0, 29.0]
|
||||||
|
],
|
||||||
|
PatternIsHorizontal),
|
||||||
|
|
||||||
|
bezelDisabledColor = PatternColor(
|
||||||
|
[
|
||||||
|
["combobox-bezel-disabled-left.png", 6.0, 29.0],
|
||||||
|
["combobox-bezel-disabled-center.png", 1.0, 29.0],
|
||||||
|
["combobox-bezel-disabled-right.png", 24.0, 29.0]
|
||||||
|
],
|
||||||
|
PatternIsHorizontal),
|
||||||
|
|
||||||
|
bezelNoBorderColor = PatternColor(
|
||||||
|
[
|
||||||
|
["combobox-bezel-no-border-left.png", 6.0, 29.0],
|
||||||
|
["combobox-bezel-no-border-center.png", 1.0, 29.0],
|
||||||
|
["combobox-bezel-no-border-right.png", 24.0, 29.0]
|
||||||
|
],
|
||||||
|
PatternIsHorizontal),
|
||||||
|
|
||||||
|
bezelNoBorderFocusedColor = PatternColor(
|
||||||
|
[
|
||||||
|
["combobox-bezel-no-border-focused-left.png", 6.0, 29.0],
|
||||||
|
["combobox-bezel-no-border-focused-center.png", 1.0, 29.0],
|
||||||
|
["combobox-bezel-no-border-focused-right.png", 24.0, 29.0]
|
||||||
|
],
|
||||||
|
PatternIsHorizontal),
|
||||||
|
|
||||||
|
bezelNoBorderDisabledColor = PatternColor(
|
||||||
|
[
|
||||||
|
["combobox-bezel-no-border-disabled-left.png", 6.0, 29.0],
|
||||||
|
["combobox-bezel-no-border-disabled-center.png", 1.0, 29.0],
|
||||||
|
["combobox-bezel-no-border-disabled-right.png", 24.0, 29.0]
|
||||||
|
],
|
||||||
|
PatternIsHorizontal),
|
||||||
|
|
||||||
|
overrides =
|
||||||
|
[
|
||||||
|
[@"bezel-color", bezelColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered],
|
||||||
|
[@"bezel-color", bezelFocusedColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered | CPThemeStateEditing],
|
||||||
|
[@"bezel-color", bezelDisabledColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered | CPThemeStateDisabled],
|
||||||
|
|
||||||
|
[@"bezel-color", bezelNoBorderColor, CPThemeStateBezeled],
|
||||||
|
[@"bezel-color", bezelNoBorderFocusedColor, CPThemeStateBezeled | CPThemeStateEditing],
|
||||||
|
[@"bezel-color", bezelNoBorderDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
|
||||||
|
|
||||||
|
// The right border inset has to make room for the focus ring and popup button
|
||||||
|
[@"content-inset", CGInsetMake(8.0, 27.0, 7.0, 8.0), CPThemeStateBezeled | CPComboBoxStateButtonBordered],
|
||||||
|
[@"content-inset", CGInsetMake(8.0, 24.0, 7.0, 8.0), CPThemeStateBezeled],
|
||||||
|
[@"content-inset", CGInsetMake(8.0, 24.0, 7.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
|
||||||
|
|
||||||
|
[@"popup-button-size", CGSizeMake(21.0, 23.0), CPThemeStateBezeled | CPComboBoxStateButtonBordered],
|
||||||
|
[@"popup-button-size", CGSizeMake(17.0, 23.0), CPThemeStateBezeled],
|
||||||
|
|
||||||
|
// Because combo box uses a three-part bezel, the height is fixed
|
||||||
|
[@"min-size", CGSizeMake(0, 29.0)],
|
||||||
|
[@"max-size", CGSizeMake(-1, 29.0)]
|
||||||
|
];
|
||||||
|
|
||||||
|
[self registerThemeValues:overrides forView:combo inherit:themedTextFieldValues];
|
||||||
|
|
||||||
|
return combo;
|
||||||
|
}
|
||||||
|
|
||||||
+ (CPRadioButton)themedRadioButton
|
+ (CPRadioButton)themedRadioButton
|
||||||
{
|
{
|
||||||
var button = [CPRadio radioWithTitle:@"Hello Friend!"],
|
var button = [CPRadio radioWithTitle:@"Hello Friend!"],
|
||||||
|
|||||||
@@ -288,6 +288,30 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
|
|||||||
return _textShadowOffset;
|
return _textShadowOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (CGRect)textFrame
|
||||||
|
{
|
||||||
|
[self layoutIfNeeded];
|
||||||
|
|
||||||
|
var textFrame = CGRectMakeZero();
|
||||||
|
|
||||||
|
#if PLATFORM(DOM)
|
||||||
|
if (_DOMTextElement)
|
||||||
|
{
|
||||||
|
var textStyle = _DOMTextElement.style;
|
||||||
|
|
||||||
|
textFrame.origin.y = parseInt(textStyle.top.substr(0, textStyle.top.length - 2), 10),
|
||||||
|
textFrame.origin.x = parseInt(textStyle.left.substr(0, textStyle.left.length - 2), 10),
|
||||||
|
textFrame.size.width = parseInt(textStyle.width.substr(0, textStyle.width.length - 2), 10),
|
||||||
|
textFrame.size.height = parseInt(textStyle.height.substr(0, textStyle.height.length - 2), 10);
|
||||||
|
|
||||||
|
textFrame.size.width += _textShadowOffset.width;
|
||||||
|
textFrame.size.height += _textShadowOffset.height;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return textFrame;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setImage:(CPImage)anImage
|
- (void)setImage:(CPImage)anImage
|
||||||
{
|
{
|
||||||
if (_image == anImage)
|
if (_image == anImage)
|
||||||
|
|||||||
@@ -0,0 +1,838 @@
|
|||||||
|
/*
|
||||||
|
* _CPPopUpList.j
|
||||||
|
* AppKit
|
||||||
|
*
|
||||||
|
* Created by Aparajita Fishman.
|
||||||
|
* Copyright (c) 2011, Intalio, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import "CPTableView.j"
|
||||||
|
@import "_CPPopUpListDataSource.j"
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Notification sent when the list is about to pop up. \c object is the _CPPopUpList.
|
||||||
|
*/
|
||||||
|
_CPPopUpListWillPopUpNotification = @"_CPPopUpListWillPopUpNotification";
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Notification sent when the list is about to be dismissed. \c object is the _CPPopUpList.
|
||||||
|
*/
|
||||||
|
_CPPopUpListWillDismissNotification = @"_CPPopUpListWillDismissNotification";
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Notification sent when the list is dismissed. \c object is the _CPPopUpList.
|
||||||
|
*/
|
||||||
|
_CPPopUpListDidDismissNotification = @"_CPPopUpListDidDismissNotification";
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Notification sent when the selection of the list changes. \c object is the _CPPopUpList.
|
||||||
|
*/
|
||||||
|
_CPPopUpListDidDismissNotification = @"_CPPopUpListDidDismissNotification";
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Notification sent when the list is dismissed. \c object is the _CPPopUpList.
|
||||||
|
*/
|
||||||
|
_CPPopUpListDidDismissNotification = @"_CPPopUpListDidDismissNotification";
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Notification sent by when an item is selected. \c object is the _CPPopUpList.
|
||||||
|
When this is received the list has already been dismissed and the dismiss notification has been sent.
|
||||||
|
*/
|
||||||
|
_CPPopUpListItemWasClickedNotification = @"_CPPopUpListItemWasClickedNotification";
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@ignore
|
||||||
|
|
||||||
|
The minimum number of items that must be visible below the related field.
|
||||||
|
If less than this number would be completely visible, and there is room for this many complete items
|
||||||
|
above the field, the list is displayed above.
|
||||||
|
*/
|
||||||
|
var ListMinimumItems = 3;
|
||||||
|
|
||||||
|
/*! @ignore */
|
||||||
|
var ListColumnIdentifier = @"1";
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
This class is a controller for a panel that can pop up and display a scrollable list of items in a CPTableView.
|
||||||
|
It is used by CPComboBox to display the list of choices.
|
||||||
|
|
||||||
|
This class requires a data source which must conform to the interface of _CPPopUpListDataSource.
|
||||||
|
|
||||||
|
Objects of this class send the following notifications:
|
||||||
|
|
||||||
|
_CPPopUpListWillPopUpNotification
|
||||||
|
_CPPopUpListWillDismissNotification
|
||||||
|
_CPPopUpListDidDismissNotification
|
||||||
|
_CPPopUpListItemWasClickedNotification
|
||||||
|
*/
|
||||||
|
@implementation _CPPopUpList : CPObject
|
||||||
|
{
|
||||||
|
_CPPopUpListDataSource _dataSource;
|
||||||
|
BOOL _itemWasClicked;
|
||||||
|
BOOL _listWasClicked;
|
||||||
|
int _listWidth;
|
||||||
|
_CPPopUpPanel _panel;
|
||||||
|
CPScrollView _scrollView;
|
||||||
|
_CPPopUpTableView _tableView;
|
||||||
|
CPTableColumn _tableColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark Creating and Displaying a List
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Creates a pop up list of choices that will display in a scrollable CPTableView.
|
||||||
|
|
||||||
|
@param aDataSource A subclass of _CPPopUpListDataSource
|
||||||
|
*/
|
||||||
|
- (id)initWithDataSource:(_CPPopUpListDataSource)aDataSource
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
|
||||||
|
if (self)
|
||||||
|
{
|
||||||
|
[self setDataSource:aDataSource];
|
||||||
|
_itemWasClicked = NO;
|
||||||
|
_listWasClicked = NO;
|
||||||
|
_listWidth = 0;
|
||||||
|
|
||||||
|
_tableView = [self makeTableView];
|
||||||
|
|
||||||
|
// Start with a default size, we will resize it later
|
||||||
|
frame = CGRectMake(0, 0, 200, 200);
|
||||||
|
|
||||||
|
_tableColumn = [[CPTableColumn alloc] initWithIdentifier:ListColumnIdentifier];
|
||||||
|
[_tableColumn setWidth:CGRectGetWidth(frame) - [CPScroller scrollerWidth]];
|
||||||
|
[_tableColumn setResizingMask:CPTableColumnAutoresizingMask];
|
||||||
|
[_tableView addTableColumn:_tableColumn];
|
||||||
|
|
||||||
|
_scrollView = [self makeScrollViewWithFrame:CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame))];
|
||||||
|
[_scrollView setDocumentView:_tableView];
|
||||||
|
|
||||||
|
// This has to be done after setDocumentView so that the table knows which scroll view to update
|
||||||
|
[_tableView setHeaderView:nil];
|
||||||
|
|
||||||
|
_panel = [self makeListPanelWithFrame:frame];
|
||||||
|
[[_panel contentView] addSubview:_scrollView];
|
||||||
|
[_panel setInitialFirstResponder:_tableView];
|
||||||
|
|
||||||
|
if ([_dataSource numberOfItemsInList:self] > 0)
|
||||||
|
[_tableView selectRowIndexes:[CPIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
|
||||||
|
else
|
||||||
|
[_tableView setEnabled:NO];
|
||||||
|
|
||||||
|
[_scrollView scrollToBeginningOfDocument:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! @ignore */
|
||||||
|
- (CPPanel)makeListPanelWithFrame:(CGRect)aFrame
|
||||||
|
{
|
||||||
|
var panel = [[_CPPopUpPanel alloc] initWithContentRect:aFrame styleMask:CPBorderlessWindowMask];
|
||||||
|
|
||||||
|
[panel setTitle:@""];
|
||||||
|
[panel setFloatingPanel:YES];
|
||||||
|
[panel setBecomesKeyOnlyIfNeeded:YES];
|
||||||
|
[panel setHasShadow:YES];
|
||||||
|
[panel setShadowStyle:CPMenuWindowShadowStyle];
|
||||||
|
[panel setDelegate:self];
|
||||||
|
|
||||||
|
return panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! @ignore */
|
||||||
|
- (_CPPopUpTableView)makeTableView
|
||||||
|
{
|
||||||
|
[self removeTableViewObservers];
|
||||||
|
|
||||||
|
var table = [[_CPPopUpTableView alloc] initWithFrame:CGRectMakeZero()];
|
||||||
|
|
||||||
|
[table setDelegate:self];
|
||||||
|
[table setDataSource:self];
|
||||||
|
[table setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
|
||||||
|
[table setUsesAlternatingRowBackgroundColors:NO];
|
||||||
|
[table setAllowsMultipleSelection:NO];
|
||||||
|
[table setIntercellSpacing:CGSizeMake(3, 2)];
|
||||||
|
[table setTarget:self];
|
||||||
|
[table setDoubleAction:@selector(tableViewClickAction:)];
|
||||||
|
[table setAction:@selector(tableViewClickAction:)];
|
||||||
|
[table setRowHeight:[self rowHeightForTableView:table]];
|
||||||
|
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! @ignore */
|
||||||
|
- (void)removeTableViewObservers
|
||||||
|
{
|
||||||
|
if (_tableView)
|
||||||
|
{
|
||||||
|
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||||
|
|
||||||
|
[defaultCenter removeObserver:self name:CPTableViewSelectionIsChangingNotification object:_tableView];
|
||||||
|
[defaultCenter removeObserver:self name:CPTableViewSelectionDidChangeNotification object:_tableView];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! @ignore */
|
||||||
|
- (CPScrollView)makeScrollViewWithFrame:(CGRect)aFrame
|
||||||
|
{
|
||||||
|
var scroll = [[CPScrollView alloc] initWithFrame:aFrame];
|
||||||
|
|
||||||
|
[scroll setBorderType:CPLineBorder];
|
||||||
|
[scroll setAutohidesScrollers:NO];
|
||||||
|
[scroll setHasVerticalScroller:YES];
|
||||||
|
[scroll setHasHorizontalScroller:NO];
|
||||||
|
[scroll setLineScroll:[_tableView rowHeight]];
|
||||||
|
[scroll setVerticalPageScroll:0.0];
|
||||||
|
|
||||||
|
return scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Pop up the list if it is not already visible.
|
||||||
|
If it is not visible, a _CPPopUpListWillPopUpNotification will be sent.
|
||||||
|
|
||||||
|
@param aRect A rect (in \c aView coordinates) to display relative to
|
||||||
|
@param aView The view whose coordinate system \c aRect is in
|
||||||
|
@param offset How far to offset the list from \c aRect
|
||||||
|
*/
|
||||||
|
- (void)popUpRelativeToRect:(CGRect)aRect view:(CPView)aView offset:(int)offset
|
||||||
|
{
|
||||||
|
if ([_panel isVisible])
|
||||||
|
return;
|
||||||
|
|
||||||
|
var rowRect = [_tableView rectOfRow:[self numberOfRowsInTableView:_tableView] - 1],
|
||||||
|
frame = CGRectMake(0, 0, MAX(_listWidth, CGRectGetWidth(aRect)), CGRectGetMaxY(rowRect));
|
||||||
|
|
||||||
|
// Place the frame relative to aRect and constrain it to the screen bounds
|
||||||
|
frame = [self constrain:frame relativeToRect:aRect view:aView offset:offset];
|
||||||
|
|
||||||
|
[_panel setFrame:frame];
|
||||||
|
[_scrollView setFrameSize:CGSizeMakeCopy(frame.size)];
|
||||||
|
[_tableView setEnabled:[_dataSource numberOfItemsInList:self] > 0];
|
||||||
|
[self scrollItemAtIndexToTop:[_tableView selectedRow]];
|
||||||
|
|
||||||
|
[self listWillPopUp];
|
||||||
|
|
||||||
|
[_panel orderFront:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark Setting Display Attributes
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the desired width of the list.
|
||||||
|
*/
|
||||||
|
- (int)listWidth
|
||||||
|
{
|
||||||
|
return _listWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Sets the desired width of the list for the next call to \ref showListForfield:relativeTo:.
|
||||||
|
Note that the actual display width may be larger if the given width is less than the width of the associated
|
||||||
|
field.
|
||||||
|
*/
|
||||||
|
- (void)setListWidth:(int)width
|
||||||
|
{
|
||||||
|
_listWidth = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setFont:(CPFont)aFont
|
||||||
|
{
|
||||||
|
var oldDataView = [_tableColumn dataView],
|
||||||
|
newDataView = [CPTextField new];
|
||||||
|
|
||||||
|
[newDataView setFont:aFont];
|
||||||
|
[newDataView setAlignment:[oldDataView alignment]];
|
||||||
|
[_tableColumn setDataView:newDataView];
|
||||||
|
|
||||||
|
// Force the data view cache to flush
|
||||||
|
[_tableView reloadData];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setAlignment:(CPTextAlignment)alignment
|
||||||
|
{
|
||||||
|
var oldDataView = [_tableColumn dataView],
|
||||||
|
newDataView = [CPTextField new];
|
||||||
|
|
||||||
|
[newDataView setAlignment:alignment];
|
||||||
|
[newDataView setFont:[oldDataView font]];
|
||||||
|
[_tableColumn setDataView:newDataView];
|
||||||
|
|
||||||
|
// Force the data view cache to flush
|
||||||
|
[_tableView reloadData];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether the list is currently visible.
|
||||||
|
*/
|
||||||
|
- (BOOL)isVisible
|
||||||
|
{
|
||||||
|
return [_panel isVisible];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the desired row height for the table view.
|
||||||
|
Subclasses should override this if they want something other than the default.
|
||||||
|
*/
|
||||||
|
- (int)rowHeightForTableView:(CPTableView)aTableView
|
||||||
|
{
|
||||||
|
return [aTableView rowHeight];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the table view used by the list.
|
||||||
|
*/
|
||||||
|
- (CPTableView)tableView
|
||||||
|
{
|
||||||
|
return _tableView;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the single table column used by the list.
|
||||||
|
*/
|
||||||
|
- (CPTableColumn)tableColumn
|
||||||
|
{
|
||||||
|
return _tableColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the scroll view used by the list.
|
||||||
|
*/
|
||||||
|
- (CPScrollView)scrollView
|
||||||
|
{
|
||||||
|
return _scrollView;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the panel in which the list appears.
|
||||||
|
*/
|
||||||
|
- (CPPanel)panel
|
||||||
|
{
|
||||||
|
return _panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark Setting a Data Source
|
||||||
|
|
||||||
|
- (void)setDataSource:(_CPPopUpListDataSource)aDataSource
|
||||||
|
{
|
||||||
|
if (_dataSource === aDataSource)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (![_CPPopUpListDataSource protocolIsImplementedByObject:aDataSource])
|
||||||
|
{
|
||||||
|
CPLog.warn("Illegal %s data source (%s). Must implement the methods in _CPPopUpListDataSource.", [self className], [aDataSource description]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_dataSource = aDataSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (_CPPopUpListDataSource)dataSource
|
||||||
|
{
|
||||||
|
return _dataSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark Manipulating the Selection
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Select the next item in the list if there one. If there is currently no selected item,
|
||||||
|
the first item is selected. Returns YES if the selection changed.
|
||||||
|
*/
|
||||||
|
- (BOOL)selectNextItem
|
||||||
|
{
|
||||||
|
if (![_tableView isEnabled])
|
||||||
|
return NO;
|
||||||
|
|
||||||
|
var row = [_tableView selectedRow];
|
||||||
|
|
||||||
|
if (row < ([_dataSource numberOfItemsInList:self] - 1))
|
||||||
|
return [self selectRow:++row];
|
||||||
|
else
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Select the previous item in the list. If there is currently no selected item,
|
||||||
|
nothing happens. Returns YES if the selection changed.
|
||||||
|
*/
|
||||||
|
- (BOOL)selectPreviousItem
|
||||||
|
{
|
||||||
|
if (![_tableView isEnabled])
|
||||||
|
return NO;
|
||||||
|
|
||||||
|
var row = [_tableView selectedRow];
|
||||||
|
|
||||||
|
if (row > 0)
|
||||||
|
return [self selectRow:--row];
|
||||||
|
else
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the selected object value. If no value is selected,
|
||||||
|
returns nil.
|
||||||
|
*/
|
||||||
|
- (id)selectedObjectValue
|
||||||
|
{
|
||||||
|
var row = [_tableView selectedRow];
|
||||||
|
|
||||||
|
return (row >= 0) ? [_dataSource list:self objectValueForItemAtIndex:row] : nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the selected value as a single-line string. If no value is selected,
|
||||||
|
returns nil.
|
||||||
|
*/
|
||||||
|
- (CPString)selectedStringValue
|
||||||
|
{
|
||||||
|
var value = [self selectedObjectValue];
|
||||||
|
|
||||||
|
return value !== nil ? [_dataSource list:self stringValueForObjectValue:value] : nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the last selected row in the list. If no row has been selected, returns -1.
|
||||||
|
*/
|
||||||
|
- (int)selectedRow
|
||||||
|
{
|
||||||
|
return [_tableView selectedRow];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Selects a row and scrolls it to be visible. Returns YES if the selection actually changed.
|
||||||
|
*/
|
||||||
|
- (BOOL)selectRow:(int)row
|
||||||
|
{
|
||||||
|
if (row === [_tableView selectedRow])
|
||||||
|
return NO;
|
||||||
|
|
||||||
|
var validRow = (row >= 0 && row < [self numberOfRowsInTableView:_tableView]),
|
||||||
|
indexes = validRow ? [CPIndexSet indexSetWithIndex:row] : [CPIndexSet indexSet];
|
||||||
|
|
||||||
|
[_tableView selectRowIndexes:indexes byExtendingSelection:NO];
|
||||||
|
|
||||||
|
if (validRow)
|
||||||
|
{
|
||||||
|
[_tableView scrollRowToVisible:row];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark Manipulating the Displayed List
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Scroll the list down one page.
|
||||||
|
*/
|
||||||
|
- (void)scrollPageDown
|
||||||
|
{
|
||||||
|
[_scrollView scrollPageDown:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Scroll the list up one page.
|
||||||
|
*/
|
||||||
|
- (void)scrollPageUp
|
||||||
|
{
|
||||||
|
[_scrollView scrollPageUp:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Scroll to the top of the list.
|
||||||
|
*/
|
||||||
|
- (void)scrollToTop
|
||||||
|
{
|
||||||
|
[_scrollView scrollToBeginningOfDocument:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Scroll to the bottom of the list.
|
||||||
|
*/
|
||||||
|
- (void)scrollToBottom
|
||||||
|
{
|
||||||
|
[_scrollView scrollToEndOfDocument:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)scrollItemAtIndexToTop:(int)row
|
||||||
|
{
|
||||||
|
var rect = [_tableView rectOfRow:row];
|
||||||
|
|
||||||
|
[[_tableView superview] scrollToPoint:rect.origin];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Close the list if it is currently visible. If it is visible,
|
||||||
|
a CPComboBoxWillDismissNotification will be sent. If the
|
||||||
|
list is being closed after an item was clicked, the close
|
||||||
|
is delayed slightly so the user can briefly see the clicked row
|
||||||
|
get highlighted.
|
||||||
|
*/
|
||||||
|
- (void)close
|
||||||
|
{
|
||||||
|
if (![_panel isVisible])
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ([self listWasClicked])
|
||||||
|
{
|
||||||
|
[self setListWasClicked:NO];
|
||||||
|
|
||||||
|
// Wait until we get through the run loop and delay a little
|
||||||
|
// so the user can briefly see the clicked row get highlighted.
|
||||||
|
if ([self itemWasClicked])
|
||||||
|
{
|
||||||
|
[self setItemWasClicked:NO];
|
||||||
|
[CPTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(closeListAfterItemClick) userInfo:nil repeats:NO];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[[CPNotificationCenter defaultCenter] postNotificationName:_CPPopUpListWillDismissNotification object:self];
|
||||||
|
[_panel close];
|
||||||
|
[[CPNotificationCenter defaultCenter] postNotificationName:_CPPopUpListDidDismissNotification object:self];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Close the list after an item was clicked.
|
||||||
|
*/
|
||||||
|
- (void)closeListAfterItemClick
|
||||||
|
{
|
||||||
|
[self close];
|
||||||
|
[[CPNotificationCenter defaultCenter] postNotificationName:_CPPopUpListItemWasClickedNotification object:self];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark Handling Events
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Handles standard key equivalents for moving the selection
|
||||||
|
and selecting an item. This method should be called by
|
||||||
|
the -performKeyEquivalent method of the field that is
|
||||||
|
controlling the list.
|
||||||
|
*/
|
||||||
|
- (BOOL)performKeyEquivalent:(CPEvent)anEvent
|
||||||
|
{
|
||||||
|
var key = [anEvent charactersIgnoringModifiers];
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case CPDownArrowFunctionKey:
|
||||||
|
if ([self isVisible])
|
||||||
|
{
|
||||||
|
[self selectNextItem];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CPUpArrowFunctionKey:
|
||||||
|
if ([self isVisible])
|
||||||
|
{
|
||||||
|
[self selectPreviousItem];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CPEscapeFunctionKey:
|
||||||
|
if ([self isVisible])
|
||||||
|
{
|
||||||
|
[self close];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CPPageUpFunctionKey:
|
||||||
|
if ([self isVisible])
|
||||||
|
{
|
||||||
|
[self scrollPageUp];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CPPageDownFunctionKey:
|
||||||
|
if ([self isVisible])
|
||||||
|
{
|
||||||
|
[self scrollPageDown];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CPHomeFunctionKey:
|
||||||
|
if ([self isVisible])
|
||||||
|
{
|
||||||
|
[self scrollToTop];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CPEndFunctionKey:
|
||||||
|
if ([self isVisible])
|
||||||
|
{
|
||||||
|
[self scrollToBottom];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether an item in the list was clicked since it was opened.
|
||||||
|
If there are no items, \ref itemWasClicked will always return NO.
|
||||||
|
*/
|
||||||
|
- (BOOL)itemWasClicked
|
||||||
|
{
|
||||||
|
return _itemWasClicked && ([_dataSource numberOfItemsInList:self] > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Sets whether an item in the list was clicked since it was opened.
|
||||||
|
If there are no items, \ref itemWasClicked will always return NO.
|
||||||
|
|
||||||
|
Subclasses will usually want to set this in the mouseDown:
|
||||||
|
of the control.
|
||||||
|
*/
|
||||||
|
- (void)setItemWasClicked:(BOOL)flag
|
||||||
|
{
|
||||||
|
_itemWasClicked = ([_dataSource numberOfItemsInList:self] > 0) && flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether any view in the list was clicked since it was opened.
|
||||||
|
If there are no items, \ref listWasClicked will always return NO.
|
||||||
|
*/
|
||||||
|
- (BOOL)listWasClicked
|
||||||
|
{
|
||||||
|
return _listWasClicked && ([_dataSource numberOfItemsInList:self] > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Sets whether any view in the list was clicked since it was opened.
|
||||||
|
If there are no items, \ref listWasClicked will always return NO.
|
||||||
|
|
||||||
|
Subclasses will usually want to use a subclass of CPPanel and override
|
||||||
|
sendEvent: to set this flag when the event type is CPLeftMouseDown
|
||||||
|
or CPRightMouseDown. This is distinct from \ref itemWasClicked because,
|
||||||
|
for example, a scroller in the list may be clicked without clicking an
|
||||||
|
item in the list.
|
||||||
|
*/
|
||||||
|
- (void)setListWasClicked:(BOOL)flag
|
||||||
|
{
|
||||||
|
_listWasClicked = ([_dataSource numberOfItemsInList:self] > 0) && flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether a controlling view should resign. This should be called
|
||||||
|
from the controlling view's resignFirstResponder method.
|
||||||
|
*/
|
||||||
|
- (BOOL)controllingViewShouldResign
|
||||||
|
{
|
||||||
|
if ([self listWasClicked])
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
If an item was not clicked (probably the scrollbar), clear the click flag so that future
|
||||||
|
clicks outside the list will allow it to close.
|
||||||
|
*/
|
||||||
|
if ([self listWasClicked] && ![self itemWasClicked])
|
||||||
|
[self setListWasClicked:NO];
|
||||||
|
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
#pragma mark Internal Helpers
|
||||||
|
|
||||||
|
/*! @ignore */
|
||||||
|
- (void)listWillPopUp
|
||||||
|
{
|
||||||
|
[[CPNotificationCenter defaultCenter] postNotificationName:_CPPopUpListWillPopUpNotification object:self];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Return a frame in platform window base coordinates such that the list, when displayed, will show at least ListMinimumItems
|
||||||
|
items completely on screen. Normally the list should be displayed below \c aRect, but if there is not room
|
||||||
|
for at least ListMinimumItems items, an attempt should be made to display that many
|
||||||
|
items above \c aRect. If the minimum cannot be displayed on top, whichever direction can display more items
|
||||||
|
is chosen.
|
||||||
|
@ignore
|
||||||
|
*/
|
||||||
|
- (CGRect)constrain:(CGRect)aFrame relativeToRect:(CGRect)aRect view:(CPView)aView offset:(int)offset
|
||||||
|
{
|
||||||
|
// Convert from the view's coordinate system to the coordinate system of the primary platform window
|
||||||
|
var baseOrigin = [aView convertPointToBase:aRect.origin],
|
||||||
|
windowOrigin = [[aView window] convertBaseToPlatformWindow:baseOrigin],
|
||||||
|
rowHeight = [self rowHeightForTableView:_tableView] + [_tableView intercellSpacing].height,
|
||||||
|
|
||||||
|
// Be sure to clip the number of displayed rows to what the field wants
|
||||||
|
numberOfRows = MIN([self numberOfRowsInTableView:_tableView], [_dataSource numberOfVisibleItemsInList:self]),
|
||||||
|
|
||||||
|
// Add 2 to height for border
|
||||||
|
frame = CGRectMake(windowOrigin.x, windowOrigin.y + CGRectGetHeight(aRect) + offset, MAX(_listWidth, CGRectGetWidth(aFrame)), (rowHeight * numberOfRows) + 2),
|
||||||
|
|
||||||
|
// Get the bottom coordinate of the frame and the platform window
|
||||||
|
bottomFrame = CGRectMakeCopy(frame),
|
||||||
|
bottom = CGRectGetMaxY(bottomFrame),
|
||||||
|
viewRect = [[CPPlatformWindow primaryPlatformWindow] visibleFrame],
|
||||||
|
visibleBottom = CGRectGetMaxY(viewRect),
|
||||||
|
bottomVisibleRows = numberOfRows;
|
||||||
|
|
||||||
|
// Make sure it will fit in the screen. If not, reduce the number of items till we reach the minimum.
|
||||||
|
while (bottom > visibleBottom && bottomVisibleRows >= ListMinimumItems)
|
||||||
|
{
|
||||||
|
bottom -= rowHeight;
|
||||||
|
bottomFrame.size.height -= rowHeight;
|
||||||
|
--bottomVisibleRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bottom >= visibleBottom || bottomVisibleRows < ListMinimumItems)
|
||||||
|
{
|
||||||
|
// The minimum number of items will not fit, try above
|
||||||
|
var topFrame = CGRectMakeCopy(frame);
|
||||||
|
|
||||||
|
topFrame.origin.y = windowOrigin.y - offset - CGRectGetHeight(topFrame);
|
||||||
|
|
||||||
|
var visibleTop = CGRectGetMinY(viewRect),
|
||||||
|
topVisibleRows = numberOfRows;
|
||||||
|
|
||||||
|
while (topFrame.origin.y <= visibleTop && topVisibleRows >= ListMinimumItems)
|
||||||
|
{
|
||||||
|
topFrame.origin.y += rowHeight;
|
||||||
|
topFrame.size.height -= rowHeight;
|
||||||
|
--topVisibleRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is room on the top or it can display more than at the bottom, show it there
|
||||||
|
if ((topFrame.origin.y > visibleTop && topVisibleRows >= ListMinimumItems) || topVisibleRows > bottomVisibleRows)
|
||||||
|
frame = topFrame;
|
||||||
|
else
|
||||||
|
frame = bottomFrame;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
frame = bottomFrame;
|
||||||
|
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)tableViewClickAction:(id)sender
|
||||||
|
{
|
||||||
|
[self close];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
var _CPPopUpListDataSourceKey = @"_CPPopUpListDataSourceKey",
|
||||||
|
_CPPopUpListListWidthKey = @"_CPPopUpListListWidthKey",
|
||||||
|
_CPPopUpListListPanelKey = @"_CPPopUpListListPanelKey",
|
||||||
|
_CPPopUpListScrollViewKey = @"_CPPopUpListScrollViewKey",
|
||||||
|
_CPPopUpListTableViewKey = @"_CPPopUpListTableViewKey";
|
||||||
|
|
||||||
|
@implementation _CPPopUpList (CPCoding)
|
||||||
|
|
||||||
|
- (id)initWithCoder:(CPCoder)aCoder
|
||||||
|
{
|
||||||
|
self = [super initWithCoder:aCoder];
|
||||||
|
|
||||||
|
if (self)
|
||||||
|
{
|
||||||
|
_listWasClicked = NO;
|
||||||
|
_itemWasClicked = NO;
|
||||||
|
|
||||||
|
_dataSource = [aCoder decodeObjectForKey:_CPPopUpListDataSourceKey];
|
||||||
|
_listWidth = [aCoder decodeIntForKey:_CPPopUpListListWidthKey];
|
||||||
|
_panel = [aCoder decodeObjectForKey:_CPPopUpListListPanelKey];
|
||||||
|
_scrollView = [aCoder decodeObjectForKey:_CPPopUpListScrollViewKey];
|
||||||
|
_tableView = [aCoder decodeObjectForKey:_CPPopUpListTableViewKey];
|
||||||
|
_tableColumn = [_tableView tableColumnWithIdentifier:ListColumnIdentifier];
|
||||||
|
[_scrollView setDocumentView:_tableView];
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||||
|
{
|
||||||
|
[super encodeWithCoder:aCoder];
|
||||||
|
|
||||||
|
[aCoder encodeObject:_dataSource forKey:_CPPopUpListDataSourceKey];
|
||||||
|
[aCoder encodeObject:_listWidth forKey:_CPPopUpListListWidthKey];
|
||||||
|
[aCoder encodeObject:_panel forKey:_CPPopUpListListPanelKey];
|
||||||
|
[aCoder encodeObject:_scrollView forKey:_CPPopUpListScrollViewKey];
|
||||||
|
[aCoder encodeObject:_tableView forKey:_CPPopUpListTableViewKey];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation _CPPopUpList (CPTableViewDataSource)
|
||||||
|
|
||||||
|
- (int)numberOfRowsInTableView:(id)aTableView
|
||||||
|
{
|
||||||
|
return MAX([_dataSource numberOfItemsInList:self], 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)tableView:(id)aTableView objectValueForTableColumn:(CPTableColumn)aColumn row:(int)aRow
|
||||||
|
{
|
||||||
|
return [_dataSource list:self displayValueForObjectValue:[_dataSource list:self objectValueForItemAtIndex:aRow]];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation _CPPopUpTableView : CPTableView
|
||||||
|
|
||||||
|
- (void)mouseDown:(CPEvent)anEvent
|
||||||
|
{
|
||||||
|
if (![self isEnabled])
|
||||||
|
return;
|
||||||
|
|
||||||
|
[[self delegate] setItemWasClicked:YES];
|
||||||
|
[super mouseDown:anEvent];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
We always want the autocomplete to have focus
|
||||||
|
*/
|
||||||
|
- (BOOL)acceptsFirstResponder
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Return the column used for the list.
|
||||||
|
*/
|
||||||
|
- (CPTableColumn)listColumn
|
||||||
|
{
|
||||||
|
return _tableColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation _CPPopUpPanel : CPPanel
|
||||||
|
|
||||||
|
- (void)sendEvent:(CPEvent)anEvent
|
||||||
|
{
|
||||||
|
var type = [anEvent type];
|
||||||
|
|
||||||
|
if (type === CPLeftMouseDown || type === CPRightMouseDown)
|
||||||
|
[[self delegate] setListWasClicked:YES];
|
||||||
|
|
||||||
|
return [super sendEvent:anEvent];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
* _CPPopUpListDataSource.j
|
||||||
|
* AppKit
|
||||||
|
*
|
||||||
|
* Created by Aparajita Fishman.
|
||||||
|
* Copyright (c) 2011, Intalio, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
This abstract base class defines the methods that delegates of _CPPopUpList must implement.
|
||||||
|
You may either subclass this class to use the default implementation of
|
||||||
|
list:objectValueForItemAtIndex: and list:displayValueForObjectValue: or use your
|
||||||
|
own class and define these methods yourself.
|
||||||
|
*/
|
||||||
|
@implementation _CPPopUpListDataSource : CPObject
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether the given object conforms to the minimum protocol defined by this class.
|
||||||
|
*/
|
||||||
|
+ (BOOL)protocolIsImplementedByObject:(id)anObject
|
||||||
|
{
|
||||||
|
return (anObject &&
|
||||||
|
[anObject respondsToSelector:@selector(numberOfItemsInList:)] &&
|
||||||
|
[anObject respondsToSelector:@selector(numberOfVisibleItemsInList:)] &&
|
||||||
|
[anObject respondsToSelector:@selector(list:objectValueForItemAtIndex:)] &&
|
||||||
|
[anObject respondsToSelector:@selector(list:displayValueForObjectValue:)] &&
|
||||||
|
[anObject respondsToSelector:@selector(list:stringValueForObjectValue:)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the number of items managed by the list.
|
||||||
|
*/
|
||||||
|
- (int)numberOfItemsInList:(_CPPopUpList)aList
|
||||||
|
{
|
||||||
|
_CPRaiseInvalidAbstractInvocation(self, _cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the number of items to display at one time.
|
||||||
|
*/
|
||||||
|
- (int)numberOfVisibleItemsInList:(_CPPopUpList)aList
|
||||||
|
{
|
||||||
|
_CPRaiseInvalidAbstractInvocation(self, _cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the data for a given row index.
|
||||||
|
*/
|
||||||
|
- (id)list:(_CPPopUpList)aList objectValueForItemAtIndex:(int)index
|
||||||
|
{
|
||||||
|
_CPRaiseInvalidAbstractInvocation(self, _cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns a value to display for a single row in the list. Subclasses should override
|
||||||
|
this if the table data needs to be converted or formatted in some way to be displayed.
|
||||||
|
If your data source use a data representation other than CPStrings, you must override
|
||||||
|
this method and return the appropriate data when there are no search results.
|
||||||
|
|
||||||
|
If the _CPPopUpList's table uses a custom data view, this method should return a value suitable
|
||||||
|
for sending to the setObjectValue: method of the data view.
|
||||||
|
|
||||||
|
@param aValue Data for the given row
|
||||||
|
@return A value to be displayed in the list
|
||||||
|
*/
|
||||||
|
- (id)list:(_CPPopUpList)aList displayValueForObjectValue:(id)aValue
|
||||||
|
{
|
||||||
|
return aValue || @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns a single-line string representation for an object value. Subclasses should override
|
||||||
|
this if the object data is not convertible to a simple single-line string.
|
||||||
|
|
||||||
|
@param aValue Table data to be converted to a string
|
||||||
|
@return A value to be displayed in the autocomplete field
|
||||||
|
*/
|
||||||
|
- (CPString)list:(_CPPopUpList)aList stringValueForObjectValue:(id)aValue
|
||||||
|
{
|
||||||
|
return String(aValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
require File.join(File.dirname(__FILE__), "repositories.rb")
|
||||||
|
require File.join(File.dirname(__FILE__), "dependencies.rb")
|
||||||
|
|
||||||
|
# Keep this structure to allow the build system to update version numbers.
|
||||||
|
VERSION_NUMBER = "1.0.0.012"
|
||||||
|
|
||||||
|
|
||||||
|
# Shorten expressions
|
||||||
|
def jars(*args)
|
||||||
|
args.collect {|arg| project(arg).package(:jar)}
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Cappuccino Distribution"
|
||||||
|
define "cappuccino" do
|
||||||
|
project.version = VERSION_NUMBER
|
||||||
|
project.group = "com.intalio.cloud.cappuccino"
|
||||||
|
|
||||||
|
file(_("target/patch")).enhance do
|
||||||
|
mkdir_p "target/patch"
|
||||||
|
end
|
||||||
|
|
||||||
|
file(_("target/Frameworks")).enhance do
|
||||||
|
mkdir_p "target/Frameworks/Debug"
|
||||||
|
system <<-BASH
|
||||||
|
export BUILD_PATH="target/Build"
|
||||||
|
jake debug release
|
||||||
|
BASH
|
||||||
|
|
||||||
|
cp_r "target/Build/Release/AppKit", "target/Frameworks/"
|
||||||
|
cp_r "target/Build/Release/Foundation", "target/Frameworks/"
|
||||||
|
cp_r "target/Build/Release/Objective-J", "target/Frameworks/"
|
||||||
|
cp_r "target/Build/Debug/AppKit", "target/Frameworks/Debug/"
|
||||||
|
cp_r "target/Build/Debug/Foundation", "target/Frameworks/Debug/"
|
||||||
|
cp_r "target/Build/Debug/Objective-J", "target/Frameworks/Debug/"
|
||||||
|
end
|
||||||
|
|
||||||
|
# file(_("target/Build")).enhance do
|
||||||
|
# end
|
||||||
|
read_m = ::Buildr::Packaging::Java::Manifest.parse(File.read(_("META-INF/MANIFEST.MF"))).main
|
||||||
|
read_m["Copyright"]="Intalio, Inc 2011"
|
||||||
|
read_m["Bundle-Version"]=VERSION_NUMBER.gsub(/SNAPSHOT/, "#{Time.now.to_i}")
|
||||||
|
read_m.delete("Jetty-WarFragmentFolderPath")
|
||||||
|
read_m.delete("Jetty-WarPatchFragmentFolderPath")
|
||||||
|
package(:jar).with :manifest => read_m
|
||||||
|
#package(:jar).include _("target/patch"), :as => "patch"
|
||||||
|
package(:jar).include _("target/Frameworks"), :as => "META-INF/resources/Frameworks"
|
||||||
|
|
||||||
|
#do not include those: they are at best not read harmful.
|
||||||
|
#package(:bundle).include _("build.properties"), :as => "build.properties"
|
||||||
|
#package(:bundle).meta_inf << file('META-INF/web-fragment.xml')
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -428,7 +428,9 @@ var avgOperator,
|
|||||||
maxOperator,
|
maxOperator,
|
||||||
minOperator,
|
minOperator,
|
||||||
countOperator,
|
countOperator,
|
||||||
sumOperator;
|
sumOperator,
|
||||||
|
distinctUnionOfObjectsOperator,
|
||||||
|
unionOfObjectsOperator;
|
||||||
|
|
||||||
kvoOperators["avg"] = function avgOperator(self, _cmd, param)
|
kvoOperators["avg"] = function avgOperator(self, _cmd, param)
|
||||||
{
|
{
|
||||||
@@ -495,6 +497,18 @@ kvoOperators["sum"] = function sumOperator(self, _cmd, param)
|
|||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kvoOperators["distinctUnionOfObjects"] = function distinctUnionOfObjectsOperator(self, _cmd, param)
|
||||||
|
{
|
||||||
|
var objects = [self valueForKeyPath:param];
|
||||||
|
|
||||||
|
return [[CPSet setWithArray:objects] allObjects];
|
||||||
|
}
|
||||||
|
|
||||||
|
kvoOperators["unionOfObjects"] = function unionOfObjectsOperator(self, _cmd, param)
|
||||||
|
{
|
||||||
|
return [self valueForKeyPath:param];
|
||||||
|
}
|
||||||
|
|
||||||
@implementation CPArray (KeyValueObserving)
|
@implementation CPArray (KeyValueObserving)
|
||||||
|
|
||||||
- (void)addObserver:(id)anObserver toObjectsAtIndexes:(CPIndexSet)indexes forKeyPath:(CPString)aKeyPath options:(unsigned)options context:(id)context
|
- (void)addObserver:(id)anObserver toObjectsAtIndexes:(CPIndexSet)indexes forKeyPath:(CPString)aKeyPath options:(unsigned)options context:(id)context
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
|
|||||||
Object _observersForKey;
|
Object _observersForKey;
|
||||||
int _observersForKeyLength;
|
int _observersForKeyLength;
|
||||||
CPSet _replacedKeys;
|
CPSet _replacedKeys;
|
||||||
|
CPSet _suppressedNotifications;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id)proxyForObject:(CPObject)anObject
|
+ (id)proxyForObject:(CPObject)anObject
|
||||||
@@ -247,11 +248,12 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
|
|||||||
{
|
{
|
||||||
if (self = [super init])
|
if (self = [super init])
|
||||||
{
|
{
|
||||||
_targetObject = aTarget;
|
_targetObject = aTarget;
|
||||||
_nativeClass = [aTarget class];
|
_nativeClass = [aTarget class];
|
||||||
_observersForKey = {};
|
_observersForKey = {};
|
||||||
_changesForKey = {};
|
_changesForKey = {};
|
||||||
_observersForKeyLength = 0;
|
_observersForKeyLength = 0;
|
||||||
|
_suppressedNotifications = [CPSet set];
|
||||||
|
|
||||||
[self _replaceClass];
|
[self _replaceClass];
|
||||||
aTarget[KVOProxyKey] = self;
|
aTarget[KVOProxyKey] = self;
|
||||||
@@ -629,12 +631,12 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
|
|||||||
{
|
{
|
||||||
// Fire change events for the dependent keys
|
// Fire change events for the dependent keys
|
||||||
var dependentKeysForClass = _nativeClass[DependentKeysKey],
|
var dependentKeysForClass = _nativeClass[DependentKeysKey],
|
||||||
dependantKeys = [dependentKeysForClass[theKeyPath] allObjects];
|
dependentKeys = [dependentKeysForClass[theKeyPath] allObjects],
|
||||||
|
isBeforeFlag = !![theChanges objectForKey:CPKeyValueChangeNotificationIsPriorKey];
|
||||||
|
|
||||||
var isBeforeFlag = !![theChanges objectForKey:CPKeyValueChangeNotificationIsPriorKey];
|
for (var i = 0; i < [dependentKeys count]; i++)
|
||||||
for (var i = 0; i < [dependantKeys count]; i++)
|
|
||||||
{
|
{
|
||||||
var dependantKey = [dependantKeys objectAtIndex:i];
|
var dependantKey = [dependentKeys objectAtIndex:i];
|
||||||
[self _sendNotificationsForKey:dependantKey changeOptions:theChanges isBefore:isBeforeFlag];
|
[self _sendNotificationsForKey:dependantKey changeOptions:theChanges isBefore:isBeforeFlag];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -842,12 +844,23 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
|
|||||||
{
|
{
|
||||||
var keyPath = dependentKeyPaths[index];
|
var keyPath = dependentKeyPaths[index];
|
||||||
|
|
||||||
[self _sendNotificationsForKey:keyPath
|
if (![_suppressedNotifications containsObject:keyPath])
|
||||||
changeOptions:isBefore ? [changeOptions copy] : _changesForKey[keyPath]
|
[self _sendNotificationsForKey:keyPath
|
||||||
isBefore:isBefore];
|
changeOptions:isBefore ? [changeOptions copy] : _changesForKey[keyPath]
|
||||||
|
isBefore:isBefore];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)suppressNotificationsForKeyPath:(CPString)keyPath
|
||||||
|
{
|
||||||
|
[_suppressedNotifications addObject:keyPath];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)unsuppressNotificationsForKeyPath:(CPString)keyPath
|
||||||
|
{
|
||||||
|
[_suppressedNotifications removeObject:keyPath];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation _CPKVOModelSubclass
|
@implementation _CPKVOModelSubclass
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
source "http://rubygems.org"
|
||||||
|
|
||||||
|
gem "atoulme-Antwrap", "0.7.1" # -java
|
||||||
|
gem "bouncy-castle-java", "1.5.0146.1"
|
||||||
|
gem "builder", "2.1.2"
|
||||||
|
gem "buildr", "1.4.5" # -java
|
||||||
|
gem "buildr4osgi", "0.9.6"
|
||||||
|
gem "bundler", "1.0.0.rc.5"
|
||||||
|
gem "diff-lcs", "1.1.2"
|
||||||
|
gem "highline", "1.5.1"
|
||||||
|
gem "hoe", "2.3.3"
|
||||||
|
gem "jruby-openssl", "0.7.4"
|
||||||
|
gem "json_pure", "1.4.3"
|
||||||
|
gem "manifest", "0.0.8"
|
||||||
|
gem "minitar", "0.5.3"
|
||||||
|
gem "net-sftp", "2.0.4"
|
||||||
|
gem "net-ssh", "2.0.23" # 2.1.4
|
||||||
|
gem "rake", "0.8.7" # 0.9.1
|
||||||
|
gem "rspec", "2.1.0"
|
||||||
|
gem "rspec-core", "2.1.0"
|
||||||
|
gem "rspec-expectations", "2.1.0"
|
||||||
|
gem "rspec-mocks", "2.1.0"
|
||||||
|
gem "rubyforge", "2.0.3"
|
||||||
|
gem "rubyzip", "0.9.4"
|
||||||
|
gem "xml-simple", "1.0.12"
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
GEM
|
||||||
|
remote: http://rubygems.org/
|
||||||
|
specs:
|
||||||
|
atoulme-Antwrap (0.7.1-java)
|
||||||
|
bouncy-castle-java (1.5.0146.1)
|
||||||
|
builder (2.1.2)
|
||||||
|
buildr (1.4.5-java)
|
||||||
|
atoulme-Antwrap (= 0.7.1)
|
||||||
|
builder (= 2.1.2)
|
||||||
|
diff-lcs (= 1.1.2)
|
||||||
|
highline (= 1.5.1)
|
||||||
|
hoe (= 2.3.3)
|
||||||
|
jruby-openssl (>= 0.7)
|
||||||
|
json_pure (= 1.4.3)
|
||||||
|
minitar (= 0.5.3)
|
||||||
|
net-sftp (= 2.0.4)
|
||||||
|
net-ssh (= 2.0.23)
|
||||||
|
rake (= 0.8.7)
|
||||||
|
rspec (= 2.1.0)
|
||||||
|
rspec-core (= 2.1.0)
|
||||||
|
rspec-expectations (= 2.1.0)
|
||||||
|
rspec-mocks (= 2.1.0)
|
||||||
|
rubyforge (= 2.0.3)
|
||||||
|
rubyzip (= 0.9.4)
|
||||||
|
xml-simple (= 1.0.12)
|
||||||
|
buildr4osgi (0.9.6)
|
||||||
|
manifest (= 0.0.8)
|
||||||
|
diff-lcs (1.1.2)
|
||||||
|
highline (1.5.1)
|
||||||
|
hoe (2.3.3)
|
||||||
|
rake (>= 0.8.7)
|
||||||
|
rubyforge (>= 1.0.4)
|
||||||
|
jruby-openssl (0.7.4)
|
||||||
|
bouncy-castle-java
|
||||||
|
json_pure (1.4.3)
|
||||||
|
manifest (0.0.8)
|
||||||
|
minitar (0.5.3)
|
||||||
|
net-sftp (2.0.4)
|
||||||
|
net-ssh (>= 2.0.9)
|
||||||
|
net-ssh (2.0.23)
|
||||||
|
rake (0.8.7)
|
||||||
|
rspec (2.1.0)
|
||||||
|
rspec-core (~> 2.1.0)
|
||||||
|
rspec-expectations (~> 2.1.0)
|
||||||
|
rspec-mocks (~> 2.1.0)
|
||||||
|
rspec-core (2.1.0)
|
||||||
|
rspec-expectations (2.1.0)
|
||||||
|
diff-lcs (~> 1.1.2)
|
||||||
|
rspec-mocks (2.1.0)
|
||||||
|
rubyforge (2.0.3)
|
||||||
|
json_pure (>= 1.1.7)
|
||||||
|
rubyzip (0.9.4)
|
||||||
|
xml-simple (1.0.12)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
java
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
atoulme-Antwrap (= 0.7.1)
|
||||||
|
bouncy-castle-java (= 1.5.0146.1)
|
||||||
|
builder (= 2.1.2)
|
||||||
|
buildr (= 1.4.5)
|
||||||
|
buildr4osgi (= 0.9.6)
|
||||||
|
bundler (= 1.0.0.rc.5)
|
||||||
|
diff-lcs (= 1.1.2)
|
||||||
|
highline (= 1.5.1)
|
||||||
|
hoe (= 2.3.3)
|
||||||
|
jruby-openssl (= 0.7.4)
|
||||||
|
json_pure (= 1.4.3)
|
||||||
|
manifest (= 0.0.8)
|
||||||
|
minitar (= 0.5.3)
|
||||||
|
net-sftp (= 2.0.4)
|
||||||
|
net-ssh (= 2.0.23)
|
||||||
|
rake (= 0.8.7)
|
||||||
|
rspec (= 2.1.0)
|
||||||
|
rspec-core (= 2.1.0)
|
||||||
|
rspec-expectations (= 2.1.0)
|
||||||
|
rspec-mocks (= 2.1.0)
|
||||||
|
rubyforge (= 2.0.3)
|
||||||
|
rubyzip (= 0.9.4)
|
||||||
|
xml-simple (= 1.0.12)
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Bundle-ManifestVersion: 2
|
||||||
|
Bundle-Name: cappuccinofrag
|
||||||
|
Bundle-SymbolicName: com.intalio.cloud.cappuccino
|
||||||
|
Fragment-Host: com.intalio.cloud.carbon
|
||||||
|
Jetty-WarPatchFragmentFolderPath: /
|
||||||
|
Bundle-Version: 1.0.0.qualifier
|
||||||
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
|
Eclipse-BundleShape: dir
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
/*
|
||||||
|
* AppController.j
|
||||||
|
* BindingContentArrayTest
|
||||||
|
*
|
||||||
|
* Created by aparajita on August 17, 2011.
|
||||||
|
* Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@implementation Companies : CPObject
|
||||||
|
{
|
||||||
|
CPMutableArray items @accessors;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)init
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
|
||||||
|
if (self)
|
||||||
|
{
|
||||||
|
items = [CPMutableArray array];
|
||||||
|
[items addObject:[CPDictionary dictionaryWithObjectsAndKeys:@"Spacely Sprockets", @"name", [CPArray arrayWithObjects:@"Tom", @"Dick", @"Harry"], @"employees"]];
|
||||||
|
[items addObject:[CPDictionary dictionaryWithObjectsAndKeys:@"Cogswell Cogs", @"name", [CPArray arrayWithObjects:@"Jane", @"Mary", @"Vic"], @"employees"]];
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation AppController : CPObject
|
||||||
|
{
|
||||||
|
CPString employee @accessors;
|
||||||
|
Companies companies @accessors;
|
||||||
|
CPArrayController companiesController;
|
||||||
|
CPArrayController employeesController;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||||
|
{
|
||||||
|
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
|
||||||
|
contentView = [theWindow contentView],
|
||||||
|
companiesScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(30, 30, 200, 100)],
|
||||||
|
companiesTable = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)],
|
||||||
|
employeesScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(250, 30, 200, 100)],
|
||||||
|
employeesTable = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)],
|
||||||
|
text = [[CPTextField alloc] initWithFrame:CGRectMake(250, 140, 200, 29)];
|
||||||
|
|
||||||
|
companies = [Companies new];
|
||||||
|
|
||||||
|
var column = [[CPTableColumn alloc] initWithIdentifier:@"name"];
|
||||||
|
|
||||||
|
[column setResizingMask:CPTableColumnAutoresizingMask];
|
||||||
|
[companiesTable addTableColumn:column];
|
||||||
|
[companiesTable setAllowsMultipleSelection:YES];
|
||||||
|
[companiesTable setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
|
||||||
|
[companiesScrollView setHasHorizontalScroller:NO];
|
||||||
|
[companiesScrollView setHasVerticalScroller:NO];
|
||||||
|
[companiesScrollView setDocumentView:companiesTable];
|
||||||
|
[companiesScrollView setBorderType:CPBezelBorder];
|
||||||
|
[companiesTable setHeaderView:nil];
|
||||||
|
[companiesTable setAllowsEmptySelection:NO];
|
||||||
|
|
||||||
|
[contentView addSubview:companiesScrollView];
|
||||||
|
|
||||||
|
column = [[CPTableColumn alloc] initWithIdentifier:@"name"];
|
||||||
|
|
||||||
|
[column setResizingMask:CPTableColumnAutoresizingMask];
|
||||||
|
[employeesTable addTableColumn:column];
|
||||||
|
[employeesTable setAllowsMultipleSelection:YES];
|
||||||
|
[employeesTable setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
|
||||||
|
[employeesScrollView setHasHorizontalScroller:NO];
|
||||||
|
[employeesScrollView setHasVerticalScroller:NO];
|
||||||
|
[employeesScrollView setDocumentView:employeesTable];
|
||||||
|
[employeesScrollView setBorderType:CPBezelBorder];
|
||||||
|
[employeesTable setHeaderView:nil];
|
||||||
|
[employeesTable setAllowsEmptySelection:YES];
|
||||||
|
|
||||||
|
[contentView addSubview:employeesScrollView];
|
||||||
|
[contentView addSubview:text];
|
||||||
|
|
||||||
|
var button = [CPButton buttonWithTitle:@"Add Item"];
|
||||||
|
|
||||||
|
[button setFrameOrigin:CGPointMake(500, 30)];
|
||||||
|
[button setTarget:self];
|
||||||
|
[button setAction:@selector(addItem:)];
|
||||||
|
[contentView addSubview:button];
|
||||||
|
|
||||||
|
button = [CPButton buttonWithTitle:@"Insert Item"];
|
||||||
|
|
||||||
|
[button setFrameOrigin:CGPointMake(500, 70)];
|
||||||
|
[button setTarget:self];
|
||||||
|
[button setAction:@selector(insertItem:)];
|
||||||
|
[contentView addSubview:button];
|
||||||
|
|
||||||
|
button = [CPButton buttonWithTitle:@"Remove Item"];
|
||||||
|
|
||||||
|
[button setFrameOrigin:CGPointMake(500, 110)];
|
||||||
|
[button setTarget:self];
|
||||||
|
[button setAction:@selector(removeItem:)];
|
||||||
|
[contentView addSubview:button];
|
||||||
|
|
||||||
|
companiesController = [CPArrayController new];
|
||||||
|
[companiesController bind:@"contentArray" toObject:companies withKeyPath:@"items" options:nil];
|
||||||
|
|
||||||
|
employeesController = [CPArrayController new];
|
||||||
|
[employeesController bind:@"contentArray" toObject:companiesController withKeyPath:@"selection.employees" options:nil];
|
||||||
|
|
||||||
|
//var employeeController = [CPObjectController new];
|
||||||
|
|
||||||
|
//[employeeController bind:@"contentObject" toObject:self withKeyPath:@"employee" options:nil];
|
||||||
|
|
||||||
|
[[companiesTable tableColumnWithIdentifier:@"name"] bind:@"value" toObject:companiesController withKeyPath:@"arrangedObjects.name" options:nil];
|
||||||
|
[[employeesTable tableColumnWithIdentifier:@"name"] bind:@"value" toObject:employeesController withKeyPath:@"arrangedObjects" options:nil];
|
||||||
|
[text bind:@"value" toObject:employeesController withKeyPath:@"selection.self" options:nil];
|
||||||
|
|
||||||
|
[companiesController addObserver:self forKeyPath:@"selection" options:0 context:@"companies.selection"];
|
||||||
|
[companiesController addObserver:self forKeyPath:@"selectionIndexes" options:0 context:@"companies.selectionIndexes"];
|
||||||
|
[companiesController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:@"companies.arrangedObjects"];
|
||||||
|
[employeesController addObserver:self forKeyPath:@"selectionIndexes" options:0 context:@"employees.selectionIndexes"];
|
||||||
|
[employeesController addObserver:self forKeyPath:@"selection" options:0 context:@"employees.selection"];
|
||||||
|
[employeesController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:@"employees.arrangedObjects"];
|
||||||
|
|
||||||
|
[theWindow setInitialFirstResponder:companiesTable];
|
||||||
|
[theWindow orderFront:self];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)observeValueForKeyPath:(CPString)keyPath ofObject:(id)object change:(CPDictionary)change context:(id)context
|
||||||
|
{
|
||||||
|
console.log("\nkeyPath: %s\ncontext: %s\nnew: %s\nold: %s", keyPath, context, [[change valueForKey:CPKeyValueChangeNewKey] description], [[change valueForKey:CPKeyValueChangeOldKey] description]);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)addItem:(id)sender
|
||||||
|
{
|
||||||
|
var item = [CPDictionary dictionaryWithObjectsAndKeys:@"Seven Dwarves", @"name", [CPArray arrayWithObjects:@"Sneezy", @"Dopey", @"Sleepy", @"Doc", @"Bashful", @"Happy", @"Grumpy"], @"employees"];
|
||||||
|
|
||||||
|
[companiesController addObject:item];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)insertItem:(id)sender
|
||||||
|
{
|
||||||
|
var item = [CPDictionary dictionaryWithObjectsAndKeys:@"Acme Corp", @"name", [CPArray arrayWithObjects:@"Road Runner", @"Wile E. Coyote"], @"employees"];
|
||||||
|
|
||||||
|
[companiesController insertObject:item atArrangedObjectIndex:1];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeItem:(id)sender
|
||||||
|
{
|
||||||
|
if ([[companiesController arrangedObjects] count])
|
||||||
|
[companiesController removeObjectAtArrangedObjectIndex:0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CPApplicationDelegateClass</key>
|
||||||
|
<string>AppController</string>
|
||||||
|
<key>CPBundleName</key>
|
||||||
|
<string>BindingContentArrayTest</string>
|
||||||
|
<key>CPPrincipalClass</key>
|
||||||
|
<string>CPApplication</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
/*
|
||||||
|
* Jakefile
|
||||||
|
* BindingContentArrayTest
|
||||||
|
*
|
||||||
|
* Created by aparajita on August 17, 2011.
|
||||||
|
* Copyright 2011, Victory-Heart Productions 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 ("BindingContentArrayTest", function(task)
|
||||||
|
{
|
||||||
|
task.setBuildIntermediatesPath(FILE.join("Build", "BindingContentArrayTest.build", configuration));
|
||||||
|
task.setBuildPath(FILE.join("Build", configuration));
|
||||||
|
|
||||||
|
task.setProductName("BindingContentArrayTest");
|
||||||
|
task.setIdentifier("com.aparajita.BindingContentArrayTest");
|
||||||
|
task.setVersion("1.0");
|
||||||
|
task.setAuthor("Victory-Heart Productions");
|
||||||
|
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||||
|
task.setSummary("BindingContentArrayTest");
|
||||||
|
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", ["BindingContentArrayTest"], 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", "BindingContentArrayTest", "index.html")]);
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("run-release", ["release"], function()
|
||||||
|
{
|
||||||
|
OS.system(["open", FILE.join("Build", "Release", "BindingContentArrayTest", "index.html")]);
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("deploy", ["release"], function()
|
||||||
|
{
|
||||||
|
FILE.mkdirs(FILE.join("Build", "Deployment", "BindingContentArrayTest"));
|
||||||
|
OS.system(["press", "-f", FILE.join("Build", "Release", "BindingContentArrayTest"), FILE.join("Build", "Deployment", "BindingContentArrayTest")]);
|
||||||
|
printResults("Deployment")
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("desktop", ["release"], function()
|
||||||
|
{
|
||||||
|
FILE.mkdirs(FILE.join("Build", "Desktop", "BindingContentArrayTest"));
|
||||||
|
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "BindingContentArrayTest"), FILE.join("Build", "Desktop", "BindingContentArrayTest", "BindingContentArrayTest.app"));
|
||||||
|
printResults("Desktop")
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("run-desktop", ["desktop"], function()
|
||||||
|
{
|
||||||
|
OS.system([FILE.join("Build", "Desktop", "BindingContentArrayTest", "BindingContentArrayTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
function printResults(configuration)
|
||||||
|
{
|
||||||
|
print("----------------------------");
|
||||||
|
print(configuration+" app built at path: "+FILE.join("Build", configuration, "BindingContentArrayTest"));
|
||||||
|
print("----------------------------");
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
Run this application with the current master, and note the following bugs:
|
||||||
|
|
||||||
|
- When you click on any item, there are two selection change notifications instead of one.
|
||||||
|
|
||||||
|
- If you compare the order of the notifications with Cocoa, they are slightly different.
|
||||||
|
|
||||||
|
- The right hand table is configured to allow an empty selection. If you click in the
|
||||||
|
empty area below the names, there is an empty selection notification, but then the
|
||||||
|
the current selection changes to the first item and generates another notification.
|
||||||
|
|
||||||
|
- If you select multiple items on the left, there is an error. This is a bug that will
|
||||||
|
have to be fixed in a later commit.
|
||||||
|
|
||||||
|
If you apply the changes in these commits, the first three bugs are fixed.
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,103 @@
|
|||||||
|
<!DOCTYPE html
|
||||||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<!--
|
||||||
|
index-debug.html
|
||||||
|
Bindings
|
||||||
|
|
||||||
|
Created by aparajita on August 17, 2011.
|
||||||
|
Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||||
|
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||||
|
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||||
|
|
||||||
|
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||||
|
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||||
|
|
||||||
|
<title>Bindings</title>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
OBJJ_MAIN_FILE = "main.j";
|
||||||
|
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="Frameworks/Debug/Objective-J/Objective-J.js" type="text/javascript" charset="UTF-8"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
objj_msgSend_reset();
|
||||||
|
|
||||||
|
// DEBUG OPTIONS:
|
||||||
|
|
||||||
|
// Uncomment to enable printing of backtraces on exceptions:
|
||||||
|
//objj_msgSend_decorate(objj_backtrace_decorator);
|
||||||
|
|
||||||
|
// Uncomment to supress exceptions that take place inside a message
|
||||||
|
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
|
||||||
|
|
||||||
|
// Uncomment to enable runtime type checking:
|
||||||
|
//objj_msgSend_decorate(objj_typecheck_decorator);
|
||||||
|
|
||||||
|
// Uncomment (along with both above) to print backtraces on type check errors:
|
||||||
|
//objj_typecheck_prints_backtrace = true;
|
||||||
|
|
||||||
|
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
|
||||||
|
//CPLogUnregister(CPLogDefault);
|
||||||
|
|
||||||
|
// Uncomment to enable a specific logger:
|
||||||
|
//CPLogRegister(CPLogConsole);
|
||||||
|
//CPLogRegister(CPLogPopup);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
body{margin:0; padding:0;}
|
||||||
|
#container {position: absolute; top:50%; left:50%;}
|
||||||
|
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||||
|
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||||
|
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!--[if lt IE 7]>
|
||||||
|
<STYLE type="text/css">
|
||||||
|
#container { position: relative; top: 50%; }
|
||||||
|
#content { position: relative;}
|
||||||
|
</STYLE>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body style="">
|
||||||
|
<div id="cappuccino-body">
|
||||||
|
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.write("<div id='container'><p id='content'>" +
|
||||||
|
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||||
|
"Loading Bindings...</p></div>");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<noscript>
|
||||||
|
<div id="container">
|
||||||
|
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||||
|
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||||
|
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||||
|
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||||
|
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||||
|
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||||
|
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||||
|
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||||
|
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||||
|
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
<!DOCTYPE html
|
||||||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<!--
|
||||||
|
index.html
|
||||||
|
Bindings
|
||||||
|
|
||||||
|
Created by aparajita on August 17, 2011.
|
||||||
|
Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||||
|
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||||
|
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||||
|
|
||||||
|
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||||
|
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||||
|
|
||||||
|
<title>Bindings</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 Bindings...</p></div>");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<noscript>
|
||||||
|
<div id="container">
|
||||||
|
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||||
|
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||||
|
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||||
|
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||||
|
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||||
|
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||||
|
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||||
|
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||||
|
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||||
|
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* AppController.j
|
||||||
|
* BindingContentArrayTest
|
||||||
|
*
|
||||||
|
* Created by aparajita on August 17, 2011.
|
||||||
|
* Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import <Foundation/Foundation.j>
|
||||||
|
@import <AppKit/AppKit.j>
|
||||||
|
|
||||||
|
@import "AppController.j"
|
||||||
|
|
||||||
|
|
||||||
|
function main(args, namedArgs)
|
||||||
|
{
|
||||||
|
CPApplicationMain(args, namedArgs);
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* AppController.j
|
||||||
|
* test
|
||||||
|
*
|
||||||
|
* Created by aparajita on May 19, 2011.
|
||||||
|
* Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import <Foundation/CPObject.j>
|
||||||
|
|
||||||
|
function formatter(aString, aLevel, aTitle)
|
||||||
|
{
|
||||||
|
return aString;
|
||||||
|
}
|
||||||
|
|
||||||
|
@implementation AppController : CPObject
|
||||||
|
{
|
||||||
|
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
|
||||||
|
CPView simpleColor;
|
||||||
|
CPView patternColor;
|
||||||
|
CPView threePartColor;
|
||||||
|
CPView ninePartColor;
|
||||||
|
CPImage imageView;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||||
|
{
|
||||||
|
// This is called when the application is done loading.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)awakeFromCib
|
||||||
|
{
|
||||||
|
CPLogRegister(CPLogConsole, null, formatter);
|
||||||
|
|
||||||
|
// In this case, we want the window from Cib to become our full browser window
|
||||||
|
[theWindow setFullPlatformWindow:YES];
|
||||||
|
|
||||||
|
var color = [CPColor colorWithHexString:@"88B3FF"];
|
||||||
|
CPLog([color description]);
|
||||||
|
|
||||||
|
[simpleColor setBackgroundColor:color];
|
||||||
|
|
||||||
|
color = CPColorWithImages("wheel_button.png", 32, 32, [CPBundle bundleForClass:[CPView class]]);
|
||||||
|
CPLog([color description]);
|
||||||
|
|
||||||
|
[patternColor setBackgroundColor:color];
|
||||||
|
|
||||||
|
var bundle = [CPBundle bundleForClass:[CPView class]];
|
||||||
|
|
||||||
|
color = CPColorWithImages([
|
||||||
|
["Aristo.blend/Resources/button-bezel-left.png", 4, 24, bundle],
|
||||||
|
["Aristo.blend/Resources/button-bezel-center.png", 1, 24, bundle],
|
||||||
|
["Aristo.blend/Resources/button-bezel-right.png", 4, 24, bundle]
|
||||||
|
]);
|
||||||
|
CPLog([color description]);
|
||||||
|
|
||||||
|
[threePartColor setBackgroundColor:color];
|
||||||
|
|
||||||
|
color = CPColorWithImages([
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-0.png", 7, 7, bundle],
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-1.png", 1, 7, bundle],
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-2.png", 7, 7, bundle],
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-3.png", 7, 1, bundle],
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-4.png", 1, 1, bundle],
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-5.png", 7, 1, bundle],
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-6.png", 7, 7, bundle],
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-7.png", 1, 7, bundle],
|
||||||
|
["Aristo.blend/Resources/textfield-bezel-square-focused-8.png", 7, 7, bundle],
|
||||||
|
]);
|
||||||
|
CPLog([color description]);
|
||||||
|
|
||||||
|
[ninePartColor setBackgroundColor:color];
|
||||||
|
|
||||||
|
var image = CPImageInBundle("add1-32.png", CGSizeMake(32, 32));
|
||||||
|
|
||||||
|
CPLog([image description]);
|
||||||
|
[imageView setImage:image];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?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>CPColor-CPImage-description</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
/*
|
||||||
|
* Jakefile
|
||||||
|
* test
|
||||||
|
*
|
||||||
|
* Created by aparajita on May 19, 2011.
|
||||||
|
* Copyright 2011, Victory-Heart Productions 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 ("test", function(task)
|
||||||
|
{
|
||||||
|
task.setBuildIntermediatesPath(FILE.join("Build", "test.build", configuration));
|
||||||
|
task.setBuildPath(FILE.join("Build", configuration));
|
||||||
|
|
||||||
|
task.setProductName("test");
|
||||||
|
task.setIdentifier("com.aparajita.test");
|
||||||
|
task.setVersion("1.0");
|
||||||
|
task.setAuthor("Victory-Heart Productions");
|
||||||
|
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||||
|
task.setSummary("test");
|
||||||
|
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
|
||||||
|
task.setResources(new FileList("Resources/**"));
|
||||||
|
task.setIndexFilePath("index.html");
|
||||||
|
task.setInfoPlistPath("Info.plist");
|
||||||
|
task.setNib2CibFlags("-R Resources/");
|
||||||
|
|
||||||
|
if (configuration === "Debug")
|
||||||
|
task.setCompilerFlags("-DDEBUG -g");
|
||||||
|
else
|
||||||
|
task.setCompilerFlags("-O");
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("default", ["test"], 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", "test", "index.html")]);
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("run-release", ["release"], function()
|
||||||
|
{
|
||||||
|
OS.system(["open", FILE.join("Build", "Release", "test", "index.html")]);
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("deploy", ["release"], function()
|
||||||
|
{
|
||||||
|
FILE.mkdirs(FILE.join("Build", "Deployment", "test"));
|
||||||
|
OS.system(["press", "-f", FILE.join("Build", "Release", "test"), FILE.join("Build", "Deployment", "test")]);
|
||||||
|
printResults("Deployment")
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("desktop", ["release"], function()
|
||||||
|
{
|
||||||
|
FILE.mkdirs(FILE.join("Build", "Desktop", "test"));
|
||||||
|
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "test"), FILE.join("Build", "Desktop", "test", "test.app"));
|
||||||
|
printResults("Desktop")
|
||||||
|
});
|
||||||
|
|
||||||
|
task ("run-desktop", ["desktop"], function()
|
||||||
|
{
|
||||||
|
OS.system([FILE.join("Build", "Desktop", "test", "test.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
function printResults(configuration)
|
||||||
|
{
|
||||||
|
print("----------------------------");
|
||||||
|
print(configuration+" app built at path: "+FILE.join("Build", configuration, "test"));
|
||||||
|
print("----------------------------");
|
||||||
|
}
|
||||||
@@ -0,0 +1,654 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||||
|
<data>
|
||||||
|
<int key="IBDocument.SystemTarget">1050</int>
|
||||||
|
<string key="IBDocument.SystemVersion">10J869</string>
|
||||||
|
<string key="IBDocument.InterfaceBuilderVersion">804</string>
|
||||||
|
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||||
|
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||||
|
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||||
|
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string key="NS.object.0">804</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<integer value="372"/>
|
||||||
|
</object>
|
||||||
|
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||||
|
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||||
|
<integer value="1" key="NS.object.0"/>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<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, 370}, {389, 380}}</string>
|
||||||
|
<int key="NSWTFlags">1946157056</int>
|
||||||
|
<string key="NSWindowTitle">Window</string>
|
||||||
|
<string key="NSWindowClass">NSWindow</string>
|
||||||
|
<nil key="NSViewClass"/>
|
||||||
|
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
||||||
|
<object class="NSView" key="NSWindowView" id="439893737">
|
||||||
|
<reference key="NSNextResponder"/>
|
||||||
|
<int key="NSvFlags">256</int>
|
||||||
|
<object class="NSMutableArray" key="NSSubviews">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<object class="NSCustomView" id="1066696903">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{151, 297}, {159, 36}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<string key="NSClassName">NSView</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSTextField" id="385245898">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{47, 307}, {82, 17}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<bool key="NSEnabled">YES</bool>
|
||||||
|
<object class="NSTextFieldCell" key="NSCell" id="12386750">
|
||||||
|
<int key="NSCellFlags">68288064</int>
|
||||||
|
<int key="NSCellFlags2">272630784</int>
|
||||||
|
<string key="NSContents">Simple color</string>
|
||||||
|
<object class="NSFont" key="NSSupport" id="710279137">
|
||||||
|
<string key="NSName">LucidaGrande</string>
|
||||||
|
<double key="NSSize">13</double>
|
||||||
|
<int key="NSfFlags">1044</int>
|
||||||
|
</object>
|
||||||
|
<reference key="NSControlView" ref="385245898"/>
|
||||||
|
<object class="NSColor" key="NSBackgroundColor" id="616930867">
|
||||||
|
<int key="NSColorSpace">6</int>
|
||||||
|
<string key="NSCatalogName">System</string>
|
||||||
|
<string key="NSColorName">controlColor</string>
|
||||||
|
<object class="NSColor" key="NSColor">
|
||||||
|
<int key="NSColorSpace">3</int>
|
||||||
|
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="NSColor" key="NSTextColor" id="968014435">
|
||||||
|
<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>
|
||||||
|
</object>
|
||||||
|
<object class="NSCustomView" id="605260233">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{151, 243}, {159, 36}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<string key="NSClassName">NSView</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSTextField" id="179895693">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{47, 253}, {85, 17}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<bool key="NSEnabled">YES</bool>
|
||||||
|
<object class="NSTextFieldCell" key="NSCell" id="222300836">
|
||||||
|
<int key="NSCellFlags">68288064</int>
|
||||||
|
<int key="NSCellFlags2">272630784</int>
|
||||||
|
<string key="NSContents">Pattern color</string>
|
||||||
|
<reference key="NSSupport" ref="710279137"/>
|
||||||
|
<reference key="NSControlView" ref="179895693"/>
|
||||||
|
<reference key="NSBackgroundColor" ref="616930867"/>
|
||||||
|
<reference key="NSTextColor" ref="968014435"/>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="NSCustomView" id="688674788">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{151, 186}, {159, 36}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<string key="NSClassName">NSView</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSTextField" id="63869060">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{47, 196}, {85, 17}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<bool key="NSEnabled">YES</bool>
|
||||||
|
<object class="NSTextFieldCell" key="NSCell" id="828490958">
|
||||||
|
<int key="NSCellFlags">68288064</int>
|
||||||
|
<int key="NSCellFlags2">272630784</int>
|
||||||
|
<string key="NSContents">3-part color</string>
|
||||||
|
<reference key="NSSupport" ref="710279137"/>
|
||||||
|
<reference key="NSControlView" ref="63869060"/>
|
||||||
|
<reference key="NSBackgroundColor" ref="616930867"/>
|
||||||
|
<reference key="NSTextColor" ref="968014435"/>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="NSCustomView" id="100716157">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{151, 130}, {159, 36}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<string key="NSClassName">NSView</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSTextField" id="488609560">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{47, 140}, {85, 17}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<bool key="NSEnabled">YES</bool>
|
||||||
|
<object class="NSTextFieldCell" key="NSCell" id="548167261">
|
||||||
|
<int key="NSCellFlags">68288064</int>
|
||||||
|
<int key="NSCellFlags2">272630784</int>
|
||||||
|
<string key="NSContents">9-part color</string>
|
||||||
|
<reference key="NSSupport" ref="710279137"/>
|
||||||
|
<reference key="NSControlView" ref="488609560"/>
|
||||||
|
<reference key="NSBackgroundColor" ref="616930867"/>
|
||||||
|
<reference key="NSTextColor" ref="968014435"/>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="NSTextField" id="696346150">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<string key="NSFrame">{{47, 84}, {85, 17}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<bool key="NSEnabled">YES</bool>
|
||||||
|
<object class="NSTextFieldCell" key="NSCell" id="30856995">
|
||||||
|
<int key="NSCellFlags">68288064</int>
|
||||||
|
<int key="NSCellFlags2">272630784</int>
|
||||||
|
<string key="NSContents">Image</string>
|
||||||
|
<reference key="NSSupport" ref="710279137"/>
|
||||||
|
<reference key="NSControlView" ref="696346150"/>
|
||||||
|
<reference key="NSBackgroundColor" ref="616930867"/>
|
||||||
|
<reference key="NSTextColor" ref="968014435"/>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="NSImageView" id="276994718">
|
||||||
|
<reference key="NSNextResponder" ref="439893737"/>
|
||||||
|
<int key="NSvFlags">268</int>
|
||||||
|
<object class="NSMutableSet" key="NSDragTypes">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<object class="NSArray" key="set.sortedObjects">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<string>Apple PDF pasteboard type</string>
|
||||||
|
<string>Apple PICT pasteboard type</string>
|
||||||
|
<string>Apple PNG pasteboard type</string>
|
||||||
|
<string>NSFilenamesPboardType</string>
|
||||||
|
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
|
||||||
|
<string>NeXT TIFF v4.0 pasteboard type</string>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<string key="NSFrame">{{148, 68}, {48, 48}}</string>
|
||||||
|
<reference key="NSSuperview" ref="439893737"/>
|
||||||
|
<bool key="NSEnabled">YES</bool>
|
||||||
|
<object class="NSImageCell" key="NSCell" id="334634827">
|
||||||
|
<int key="NSCellFlags">130560</int>
|
||||||
|
<int key="NSCellFlags2">33554432</int>
|
||||||
|
<int key="NSAlign">0</int>
|
||||||
|
<int key="NSScale">2</int>
|
||||||
|
<int key="NSStyle">0</int>
|
||||||
|
<bool key="NSAnimates">NO</bool>
|
||||||
|
</object>
|
||||||
|
<bool key="NSEditable">YES</bool>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<string key="NSFrameSize">{389, 380}</string>
|
||||||
|
<reference key="NSSuperview"/>
|
||||||
|
</object>
|
||||||
|
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||||
|
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSCustomObject" id="635946545">
|
||||||
|
<string key="NSClassName">AppController</string>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||||
|
<object class="NSMutableArray" key="connectionRecords">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<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">ninePartColor</string>
|
||||||
|
<reference key="source" ref="635946545"/>
|
||||||
|
<reference key="destination" ref="100716157"/>
|
||||||
|
</object>
|
||||||
|
<int key="connectionID">480</int>
|
||||||
|
</object>
|
||||||
|
<object class="IBConnectionRecord">
|
||||||
|
<object class="IBOutletConnection" key="connection">
|
||||||
|
<string key="label">threePartColor</string>
|
||||||
|
<reference key="source" ref="635946545"/>
|
||||||
|
<reference key="destination" ref="688674788"/>
|
||||||
|
</object>
|
||||||
|
<int key="connectionID">481</int>
|
||||||
|
</object>
|
||||||
|
<object class="IBConnectionRecord">
|
||||||
|
<object class="IBOutletConnection" key="connection">
|
||||||
|
<string key="label">patternColor</string>
|
||||||
|
<reference key="source" ref="635946545"/>
|
||||||
|
<reference key="destination" ref="605260233"/>
|
||||||
|
</object>
|
||||||
|
<int key="connectionID">482</int>
|
||||||
|
</object>
|
||||||
|
<object class="IBConnectionRecord">
|
||||||
|
<object class="IBOutletConnection" key="connection">
|
||||||
|
<string key="label">simpleColor</string>
|
||||||
|
<reference key="source" ref="635946545"/>
|
||||||
|
<reference key="destination" ref="1066696903"/>
|
||||||
|
</object>
|
||||||
|
<int key="connectionID">483</int>
|
||||||
|
</object>
|
||||||
|
<object class="IBConnectionRecord">
|
||||||
|
<object class="IBOutletConnection" key="connection">
|
||||||
|
<string key="label">imageView</string>
|
||||||
|
<reference key="source" ref="635946545"/>
|
||||||
|
<reference key="destination" ref="276994718"/>
|
||||||
|
</object>
|
||||||
|
<int key="connectionID">490</int>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||||
|
<object class="NSArray" key="orderedObjects">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">0</int>
|
||||||
|
<object class="NSArray" key="object" id="0">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
</object>
|
||||||
|
<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"/>
|
||||||
|
<object class="NSMutableArray" key="children">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<reference key="parent" ref="0"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">372</int>
|
||||||
|
<reference key="object" ref="439893737"/>
|
||||||
|
<object class="NSMutableArray" key="children">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference ref="385245898"/>
|
||||||
|
<reference ref="1066696903"/>
|
||||||
|
<reference ref="605260233"/>
|
||||||
|
<reference ref="179895693"/>
|
||||||
|
<reference ref="688674788"/>
|
||||||
|
<reference ref="63869060"/>
|
||||||
|
<reference ref="100716157"/>
|
||||||
|
<reference ref="488609560"/>
|
||||||
|
<reference ref="696346150"/>
|
||||||
|
<reference ref="276994718"/>
|
||||||
|
</object>
|
||||||
|
<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">468</int>
|
||||||
|
<reference key="object" ref="1066696903"/>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">469</int>
|
||||||
|
<reference key="object" ref="385245898"/>
|
||||||
|
<object class="NSMutableArray" key="children">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference ref="12386750"/>
|
||||||
|
</object>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">470</int>
|
||||||
|
<reference key="object" ref="12386750"/>
|
||||||
|
<reference key="parent" ref="385245898"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">471</int>
|
||||||
|
<reference key="object" ref="605260233"/>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">472</int>
|
||||||
|
<reference key="object" ref="179895693"/>
|
||||||
|
<object class="NSMutableArray" key="children">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference ref="222300836"/>
|
||||||
|
</object>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">473</int>
|
||||||
|
<reference key="object" ref="222300836"/>
|
||||||
|
<reference key="parent" ref="179895693"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">474</int>
|
||||||
|
<reference key="object" ref="688674788"/>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">475</int>
|
||||||
|
<reference key="object" ref="63869060"/>
|
||||||
|
<object class="NSMutableArray" key="children">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference ref="828490958"/>
|
||||||
|
</object>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">476</int>
|
||||||
|
<reference key="object" ref="828490958"/>
|
||||||
|
<reference key="parent" ref="63869060"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">477</int>
|
||||||
|
<reference key="object" ref="100716157"/>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">478</int>
|
||||||
|
<reference key="object" ref="488609560"/>
|
||||||
|
<object class="NSMutableArray" key="children">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference ref="548167261"/>
|
||||||
|
</object>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">479</int>
|
||||||
|
<reference key="object" ref="548167261"/>
|
||||||
|
<reference key="parent" ref="488609560"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">485</int>
|
||||||
|
<reference key="object" ref="696346150"/>
|
||||||
|
<object class="NSMutableArray" key="children">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference ref="30856995"/>
|
||||||
|
</object>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">486</int>
|
||||||
|
<reference key="object" ref="30856995"/>
|
||||||
|
<reference key="parent" ref="696346150"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">487</int>
|
||||||
|
<reference key="object" ref="276994718"/>
|
||||||
|
<object class="NSMutableArray" key="children">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference ref="334634827"/>
|
||||||
|
</object>
|
||||||
|
<reference key="parent" ref="439893737"/>
|
||||||
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">488</int>
|
||||||
|
<reference key="object" ref="334634827"/>
|
||||||
|
<reference key="parent" ref="276994718"/>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<object class="NSArray" key="dict.sortedKeys">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<string>-3.IBPluginDependency</string>
|
||||||
|
<string>371.IBEditorWindowLastContentRect</string>
|
||||||
|
<string>371.IBPluginDependency</string>
|
||||||
|
<string>371.IBViewEditorWindowController.showingBoundsRectangles</string>
|
||||||
|
<string>371.IBViewEditorWindowController.showingLayoutRectangles</string>
|
||||||
|
<string>371.IBWindowTemplateEditedContentRect</string>
|
||||||
|
<string>371.NSWindowTemplate.visibleAtLaunch</string>
|
||||||
|
<string>371.editorWindowContentRectSynchronizationRect</string>
|
||||||
|
<string>372.IBPluginDependency</string>
|
||||||
|
<string>468.IBPluginDependency</string>
|
||||||
|
<string>468.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>469.IBPluginDependency</string>
|
||||||
|
<string>469.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>470.IBPluginDependency</string>
|
||||||
|
<string>471.IBPluginDependency</string>
|
||||||
|
<string>471.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>472.IBPluginDependency</string>
|
||||||
|
<string>472.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>473.IBPluginDependency</string>
|
||||||
|
<string>474.IBPluginDependency</string>
|
||||||
|
<string>474.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>475.IBPluginDependency</string>
|
||||||
|
<string>475.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>476.IBPluginDependency</string>
|
||||||
|
<string>477.IBPluginDependency</string>
|
||||||
|
<string>477.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>478.IBPluginDependency</string>
|
||||||
|
<string>478.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>479.IBPluginDependency</string>
|
||||||
|
<string>485.IBPluginDependency</string>
|
||||||
|
<string>485.IBViewBoundsToFrameTransform</string>
|
||||||
|
<string>486.IBPluginDependency</string>
|
||||||
|
<string>487.IBPluginDependency</string>
|
||||||
|
<string>488.IBPluginDependency</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableArray" key="dict.values">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>{{432, 718}, {389, 380}}</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<boolean value="YES"/>
|
||||||
|
<boolean value="YES"/>
|
||||||
|
<string>{{432, 718}, {389, 380}}</string>
|
||||||
|
<integer value="1"/>
|
||||||
|
<string>{{33, 99}, {480, 360}}</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">AUMXAABDm4AAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw6gAAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">AUMXAABDgIAAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw40AAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">AUMXAABDSAAAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAw2EAAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">AUMXAABDAgAAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">P4AAAL+AAABCPAAAwxsAAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<object class="NSAffineTransform">
|
||||||
|
<bytes key="NSTransformStruct">P4AAAL+AAABCUAAAwxYAAA</bytes>
|
||||||
|
</object>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference key="dict.sortedKeys" ref="0"/>
|
||||||
|
<object class="NSMutableArray" key="dict.values">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<nil key="activeLocalization"/>
|
||||||
|
<object class="NSMutableDictionary" key="localizations">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<reference key="dict.sortedKeys" ref="0"/>
|
||||||
|
<object class="NSMutableArray" key="dict.values">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<nil key="sourceID"/>
|
||||||
|
<int key="maxID">490</int>
|
||||||
|
</object>
|
||||||
|
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||||
|
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<object class="IBPartialClassDescription">
|
||||||
|
<string key="className">AppController</string>
|
||||||
|
<object class="NSMutableDictionary" key="outlets">
|
||||||
|
<string key="NS.key.0">theWindow</string>
|
||||||
|
<string key="NS.object.0">NSWindow</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||||
|
<string key="NS.key.0">theWindow</string>
|
||||||
|
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||||
|
<string key="name">theWindow</string>
|
||||||
|
<string key="candidateClassName">NSWindow</string>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||||
|
<string key="majorKey">IBProjectSource</string>
|
||||||
|
<string key="minorKey">./Classes/AppController.h</string>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="IBPartialClassDescription">
|
||||||
|
<string key="className">AppController</string>
|
||||||
|
<object class="NSMutableDictionary" key="outlets">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<object class="NSArray" key="dict.sortedKeys">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<string>imageView</string>
|
||||||
|
<string>ninePartColor</string>
|
||||||
|
<string>patternColor</string>
|
||||||
|
<string>simpleColor</string>
|
||||||
|
<string>threePartColor</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableArray" key="dict.values">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<string>id</string>
|
||||||
|
<string>id</string>
|
||||||
|
<string>id</string>
|
||||||
|
<string>id</string>
|
||||||
|
<string>id</string>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<object class="NSArray" key="dict.sortedKeys">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<string>imageView</string>
|
||||||
|
<string>ninePartColor</string>
|
||||||
|
<string>patternColor</string>
|
||||||
|
<string>simpleColor</string>
|
||||||
|
<string>threePartColor</string>
|
||||||
|
</object>
|
||||||
|
<object class="NSMutableArray" key="dict.values">
|
||||||
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<object class="IBToOneOutletInfo">
|
||||||
|
<string key="name">imageView</string>
|
||||||
|
<string key="candidateClassName">id</string>
|
||||||
|
</object>
|
||||||
|
<object class="IBToOneOutletInfo">
|
||||||
|
<string key="name">ninePartColor</string>
|
||||||
|
<string key="candidateClassName">id</string>
|
||||||
|
</object>
|
||||||
|
<object class="IBToOneOutletInfo">
|
||||||
|
<string key="name">patternColor</string>
|
||||||
|
<string key="candidateClassName">id</string>
|
||||||
|
</object>
|
||||||
|
<object class="IBToOneOutletInfo">
|
||||||
|
<string key="name">simpleColor</string>
|
||||||
|
<string key="candidateClassName">id</string>
|
||||||
|
</object>
|
||||||
|
<object class="IBToOneOutletInfo">
|
||||||
|
<string key="name">threePartColor</string>
|
||||||
|
<string key="candidateClassName">id</string>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||||
|
<string key="majorKey">IBUserSource</string>
|
||||||
|
<string key="minorKey"/>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<int key="IBDocument.localizationMode">0</int>
|
||||||
|
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||||
|
<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="3000" key="NS.object.0"/>
|
||||||
|
</object>
|
||||||
|
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||||
|
<nil key="IBDocument.LastKnownRelativeProjectPath"/>
|
||||||
|
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||||
|
</data>
|
||||||
|
</archive>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |