Merge branch 'master' of https://github.com/cappuccino/cappuccino into objj_compiler2
@@ -91,15 +91,15 @@ var bottomHeight = 71;
|
||||
CPView _accessoryView @accessors(property=accessoryView);
|
||||
CPImage _icon @accessors(property=icon);
|
||||
|
||||
CPArray _buttons @accessors(property=buttons,readonly);
|
||||
CPCheckBox _suppressionButton @accessors(property=suppressionButton,readonly);
|
||||
CPArray _buttons @accessors(property=buttons, readonly);
|
||||
CPCheckBox _suppressionButton @accessors(property=suppressionButton, readonly);
|
||||
|
||||
id _delegate @accessors(property=delegate);
|
||||
id _modalDelegate;
|
||||
SEL _didEndSelector;
|
||||
|
||||
_CPAlertThemeView _themeView @accessors(property=themeView, readonly);
|
||||
CPWindow _window @accessors(property=window,readonly);
|
||||
CPWindow _window @accessors(property=window, readonly);
|
||||
int _defaultWindowStyle;
|
||||
|
||||
CPImageView _alertImageView;
|
||||
@@ -640,7 +640,7 @@ var bottomHeight = 71;
|
||||
var frame = CGRectMakeZero();
|
||||
frame.size = [_themeView currentValueForThemeAttribute:@"size"];
|
||||
|
||||
_window = [[CPWindow alloc] initWithContentRect:frame styleMask:forceStyle || _defaultWindowStyle];
|
||||
_window = [[CPPanel alloc] initWithContentRect:frame styleMask:forceStyle || _defaultWindowStyle];
|
||||
[_window setLevel:CPStatusWindowLevel];
|
||||
|
||||
if (_title)
|
||||
|
||||
@@ -177,7 +177,7 @@ var DefaultLineWidth = 1.0;
|
||||
- (CGRect)bounds
|
||||
{
|
||||
// TODO: this should return this. The controlPointBounds is not a tight fit.
|
||||
// return CGPathGetPathBoundingBox(_path);
|
||||
// return CGPathGetBoundingBox(_path);
|
||||
|
||||
return [self controlPointBounds];
|
||||
}
|
||||
|
||||
@@ -287,7 +287,14 @@ CPBelowBottom = 6;
|
||||
|
||||
[aView setFrame:CGRectInset([self bounds], contentMargin.width + borderWidth, contentMargin.height + borderWidth)];
|
||||
[aView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
||||
[self replaceSubview:_contentView with:aView];
|
||||
|
||||
// A nil contentView is allowed (tested in Cocoa 2013-02-22).
|
||||
if (!aView)
|
||||
[_contentView removeFromSuperview];
|
||||
else if (_contentView)
|
||||
[self replaceSubview:_contentView with:aView];
|
||||
else
|
||||
[self addSubview:aView];
|
||||
|
||||
_contentView = aView;
|
||||
}
|
||||
@@ -429,16 +436,16 @@ CPBelowBottom = 6;
|
||||
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
var bounds = CGRectMakeCopy([self bounds]);
|
||||
var bounds = [self bounds];
|
||||
|
||||
switch (_boxType)
|
||||
{
|
||||
case CPBoxSeparator:
|
||||
// NSBox does not include a horizontal flag for the separator type. We have to determine
|
||||
// the type of separator to draw by the width and height of the frame.
|
||||
if (CGRectGetWidth(bounds) === 5.0)
|
||||
if (_CGRectGetWidth(bounds) === 5.0)
|
||||
return [self _drawVerticalSeparatorInRect:bounds];
|
||||
else if (CGRectGetHeight(bounds) === 5.0)
|
||||
else if (_CGRectGetHeight(bounds) === 5.0)
|
||||
return [self _drawHorizontalSeparatorInRect:bounds];
|
||||
|
||||
break;
|
||||
@@ -485,8 +492,8 @@ CPBelowBottom = 6;
|
||||
CGContextSetStrokeColor(context, [self borderColor]);
|
||||
CGContextSetLineWidth(context, 1.0);
|
||||
|
||||
CGContextMoveToPoint(context, CGRectGetMinX(aRect), CGRectGetMidY(aRect));
|
||||
CGContextAddLineToPoint(context, CGRectGetWidth(aRect), CGRectGetMidY(aRect));
|
||||
CGContextMoveToPoint(context, _CGRectGetMinX(aRect), _CGRectGetMidY(aRect));
|
||||
CGContextAddLineToPoint(context, _CGRectGetWidth(aRect), _CGRectGetMidY(aRect));
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
|
||||
@@ -497,8 +504,8 @@ CPBelowBottom = 6;
|
||||
CGContextSetStrokeColor(context, [self borderColor]);
|
||||
CGContextSetLineWidth(context, 1.0);
|
||||
|
||||
CGContextMoveToPoint(context, CGRectGetMidX(aRect), CGRectGetMinY(aRect));
|
||||
CGContextAddLineToPoint(context, CGRectGetMidX(aRect), CGRectGetHeight(aRect));
|
||||
CGContextMoveToPoint(context, _CGRectGetMidX(aRect), _CGRectGetMinY(aRect));
|
||||
CGContextAddLineToPoint(context, _CGRectGetMidX(aRect), _CGRectGetHeight(aRect));
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ CPButtonImageOffset = 3.0;
|
||||
+ (Class)_binderClassForBinding:(CPString)aBinding
|
||||
{
|
||||
if (aBinding === CPTargetBinding || [aBinding hasPrefix:CPArgumentBinding])
|
||||
return [CPArgumentTargetBinding class];
|
||||
return [CPActionBinding class];
|
||||
|
||||
return [super _binderClassForBinding:aBinding];
|
||||
}
|
||||
|
||||
@@ -1197,13 +1197,14 @@ Not supported. Use -collectionView:dataForItemsAtIndexes:fortype:
|
||||
|
||||
//draw white under the circle thing
|
||||
CGContextFillRect(context, circleRect);
|
||||
|
||||
//draw the circle thing
|
||||
CGContextStrokeEllipseInRect(context, circleRect);
|
||||
|
||||
//then draw the line
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, FLOOR(width / 2), _CGRectGetMinY(aRect) + width);
|
||||
CGContextAddLineToPoint(context, FLOOR(width / 2), _CGRectGetHeight(aRect));
|
||||
CGContextClosePath(context);
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -1069,7 +1069,8 @@ function CPColorWithImages()
|
||||
return imageFromSlices(args[0], args[1], imageFactory);
|
||||
|
||||
case 3:
|
||||
return [CPColor colorWithPatternImage:imageFactory(args[0], args[1], args[2])];
|
||||
case 4:
|
||||
return [CPColor colorWithPatternImage:imageFactory(args[0], args[1], args[2], args[3])];
|
||||
|
||||
default:
|
||||
throw("ERROR: Invalid argument count: " + args.length);
|
||||
@@ -1084,7 +1085,7 @@ var imageFromSlices = function(slices, isVertical, imageFactory)
|
||||
{
|
||||
var slice = slices[i];
|
||||
|
||||
imageSlices.push(slice ? imageFactory(slice[0], slice[1], slice[2]) : nil);
|
||||
imageSlices.push(slice ? imageFactory(slice[0], slice[1], slice[2], slice[3]) : nil);
|
||||
}
|
||||
|
||||
switch (slices.length)
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
_initialKey = @"key";
|
||||
_initialValue = @"value";
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -57,13 +58,21 @@
|
||||
while ([keys containsObject:newKey])
|
||||
newKey = [CPString stringWithFormat:@"%@%i", _initialKey, ++count];
|
||||
|
||||
[_contentDictionary setObject:_initialValue forKey:newKey];
|
||||
return [self _newObjectWithKey:newKey value:_initialValue];
|
||||
}
|
||||
|
||||
var keyValuePairProtocol = [_CPDictionaryControllerKeyValuePair new];
|
||||
keyValuePairProtocol._key = newKey;
|
||||
keyValuePairProtocol._dictionary = _contentDictionary;
|
||||
keyValuePairProtocol._controller = self;
|
||||
return keyValuePairProtocol;
|
||||
- (id)_newObjectWithKey:(CPString)aKey value:(id)aValue
|
||||
{
|
||||
var aNewObject = [_CPDictionaryControllerKeyValuePair new];
|
||||
|
||||
aNewObject._dictionary = _contentDictionary;
|
||||
aNewObject._controller = self;
|
||||
aNewObject._key = aKey;
|
||||
|
||||
if (aValue !== nil)
|
||||
[aNewObject setValue:aValue];
|
||||
|
||||
return aNewObject;
|
||||
}
|
||||
|
||||
- (CPDictionary)contentDictionary
|
||||
@@ -88,23 +97,15 @@
|
||||
|
||||
var iter = [[CPSet setWithArray:allKeys] objectEnumerator],
|
||||
obj;
|
||||
|
||||
|
||||
while ((obj = [iter nextObject]) !== nil)
|
||||
{
|
||||
if (![_excludedKeys containsObject:obj])
|
||||
{
|
||||
var keyValuePairProtocol = [_CPDictionaryControllerKeyValuePair new];
|
||||
keyValuePairProtocol._key = obj;
|
||||
keyValuePairProtocol._dictionary = _contentDictionary;
|
||||
keyValuePairProtocol._controller = self;
|
||||
[array addObject:keyValuePairProtocol];
|
||||
}
|
||||
}
|
||||
[array addObject:[self _newObjectWithKey:obj value:nil]];
|
||||
|
||||
[super setContent:array];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -138,6 +139,9 @@ var CPIncludedKeys = @"CPIncludedKeys",
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
@implementation _CPDictionaryControllerKeyValuePair : CPObject
|
||||
{
|
||||
CPString _key @accessors(property=key);
|
||||
|
||||
@@ -68,6 +68,7 @@ var CPGraphicsContextCurrent = nil,
|
||||
+ (void)restoreGraphicsState
|
||||
{
|
||||
var lastContext = [CPGraphicsContextThreadStack lastObject];
|
||||
|
||||
if (lastContext)
|
||||
{
|
||||
[lastContext restoreGraphicsState];
|
||||
|
||||
@@ -71,7 +71,7 @@ function CPImageInBundle()
|
||||
|
||||
if (typeof(arguments[1]) === "number")
|
||||
{
|
||||
if (arguments[1] !== nil && arguments[1] === undefined)
|
||||
if (arguments[1] !== nil && arguments[1] !== undefined)
|
||||
size = _CGSizeMake(arguments[1], arguments[2]);
|
||||
|
||||
bundle = arguments[3];
|
||||
@@ -302,6 +302,14 @@ function CPAppKitImage(aFilename, aSize)
|
||||
return _name;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the underlying Image element for a single image.
|
||||
*/
|
||||
- (Image)image
|
||||
{
|
||||
return _image;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the receiver's delegate.
|
||||
@param the delegate
|
||||
@@ -390,6 +398,11 @@ function CPAppKitImage(aFilename, aSize)
|
||||
#endif
|
||||
}
|
||||
|
||||
- (BOOL)isSingleImage
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)isThreePartImage
|
||||
{
|
||||
return NO;
|
||||
@@ -521,6 +534,11 @@ function CPAppKitImage(aFilename, aSize)
|
||||
return _isVertical;
|
||||
}
|
||||
|
||||
- (BOOL)isSingleImage
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)isThreePartImage
|
||||
{
|
||||
return YES;
|
||||
@@ -585,6 +603,11 @@ var CPThreePartImageImageSlicesKey = @"CPThreePartImageImageSlicesKey",
|
||||
return _imageSlices;
|
||||
}
|
||||
|
||||
- (BOOL)isSingleImage
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)isThreePartImage
|
||||
{
|
||||
return NO;
|
||||
|
||||
@@ -476,16 +476,30 @@ var CPImageViewEmptyPlaceholderImage = nil;
|
||||
{
|
||||
var image;
|
||||
|
||||
if (aBinding === CPDataBinding)
|
||||
if (aValue == nil)
|
||||
image = nil;
|
||||
else if (aBinding === CPDataBinding)
|
||||
image = [[CPImage alloc] initWithData:aValue];
|
||||
else if (aBinding === CPValueURLBinding || aBinding === CPValuePathBinding)
|
||||
image = [[CPImage alloc] initWithContentsOfFile:aValue];
|
||||
image = [CPImage cachedImageWithContentsOfFile:aValue];
|
||||
else if (aBinding === CPValueBinding)
|
||||
image = aValue;
|
||||
|
||||
[_source setImage:image];
|
||||
}
|
||||
|
||||
- (void)valueForBinding:(CPString)aBinding
|
||||
{
|
||||
var image = [_source image];
|
||||
|
||||
if (aBinding === CPDataBinding)
|
||||
return [image data];
|
||||
else if (aBinding === CPValueURLBinding || aBinding === CPValuePathBinding)
|
||||
return [image filename];
|
||||
else if (aBinding === CPValueBinding)
|
||||
return image;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPImageViewImageKey = @"CPImageViewImageKey",
|
||||
@@ -570,3 +584,21 @@ var CPImageViewImageKey = @"CPImageViewImageKey",
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPImage (CahedImage)
|
||||
|
||||
+ (CPImage)cachedImageWithContentsOfFile:(CPString)aFile
|
||||
{
|
||||
var cached_name = [CPString stringWithFormat:@"%@_%d", [self class], [aFile hash]],
|
||||
image = [CPImage imageNamed:cached_name];
|
||||
|
||||
if (!image)
|
||||
{
|
||||
image = [[CPImage alloc] initWithContentsOfFile:aFile];
|
||||
[image setName:cached_name];
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -550,7 +550,7 @@ var CPBindingOperationAnd = 0,
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPMultipleValueArgumentBinding : CPBinder
|
||||
@implementation _CPMultipleValueActionBinding : CPBinder
|
||||
{
|
||||
CPString _argumentBinding;
|
||||
CPString _targetBinding;
|
||||
@@ -652,7 +652,7 @@ var CPBindingOperationAnd = 0,
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPArgumentTargetBinding : _CPMultipleValueArgumentBinding
|
||||
@implementation CPActionBinding : _CPMultipleValueActionBinding
|
||||
|
||||
- (id)init
|
||||
{
|
||||
@@ -667,7 +667,7 @@ var CPBindingOperationAnd = 0,
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPDoubleClickArgumentTargetBinding : _CPMultipleValueArgumentBinding
|
||||
@implementation CPDoubleClickActionBinding : _CPMultipleValueActionBinding
|
||||
|
||||
- (id)init
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
@import <Foundation/CPNotificationCenter.j>
|
||||
@import <Foundation/CPString.j>
|
||||
|
||||
@import "CPKeyValueBinding.j"
|
||||
@import "CPMenuItem.j"
|
||||
|
||||
@global CPApp
|
||||
@@ -605,8 +606,9 @@ var _CPMenuBarVisible = NO,
|
||||
|
||||
/*!
|
||||
Enables or disables the receiver’s menu items.
|
||||
If the target does not implement the menu item's action method the item is disabled.
|
||||
If the target responsds to selector validateMenuItem: or validateUserInterfaceItem: (in that order) the return value is used.
|
||||
If the item has no target, an action binding is checked. If the target does not implement
|
||||
the menu item's action method or the binding's selector, the item is disabled.
|
||||
If the target responds to selector validateMenuItem: or validateUserInterfaceItem: (in that order) the return value is used.
|
||||
*/
|
||||
- (void)update
|
||||
{
|
||||
@@ -614,6 +616,7 @@ var _CPMenuBarVisible = NO,
|
||||
return;
|
||||
|
||||
var items = [self itemArray];
|
||||
|
||||
for (var i = 0; i < [items count]; i++)
|
||||
{
|
||||
var item = [items objectAtIndex:i];
|
||||
@@ -623,7 +626,26 @@ var _CPMenuBarVisible = NO,
|
||||
|
||||
var validator = [CPApp targetForAction:[item action] to:[item target] from:item];
|
||||
|
||||
if (!validator || ![validator respondsToSelector:[item action]])
|
||||
if (!validator)
|
||||
{
|
||||
// Check to see if there is a target binding with a valid selector
|
||||
var info = [CPBinder infoForBinding:CPTargetBinding forObject:item],
|
||||
valid = NO;
|
||||
|
||||
if (info)
|
||||
{
|
||||
var object = [info objectForKey:CPObservedObjectKey],
|
||||
keyPath = [info objectForKey:CPObservedKeyPathKey],
|
||||
options = [info objectForKey:CPOptionsKey],
|
||||
target = [object valueForKeyPath:keyPath],
|
||||
selector = [options valueForKey:CPSelectorNameBindingOption];
|
||||
|
||||
valid = target && selector && [target respondsToSelector:CPSelectorFromString(selector)];
|
||||
}
|
||||
|
||||
[item setEnabled:valid];
|
||||
}
|
||||
else if (![validator respondsToSelector:[item action]])
|
||||
[item setEnabled:NO];
|
||||
else if ([validator respondsToSelector:@selector(validateMenuItem:)])
|
||||
[item setEnabled:[validator validateMenuItem:item]];
|
||||
@@ -673,7 +695,13 @@ var _CPMenuBarVisible = NO,
|
||||
// highlightedItem is always enabled. Do there exist edge cases: disabling on closing a menu,
|
||||
// etc.? Requires further investigation and tests.
|
||||
if (highlightedItem && [highlightedItem isEnabled])
|
||||
{
|
||||
// Perform any action binding
|
||||
var binding = [CPBinder getBinding:CPTargetBinding forObject:highlightedItem];
|
||||
[binding invokeAction];
|
||||
|
||||
[CPApp sendAction:[highlightedItem action] to:[highlightedItem target] from:highlightedItem];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -109,6 +109,8 @@ var CPMenuItemStringRepresentationDictionary = [CPDictionary dictionaryWithObjec
|
||||
{
|
||||
if ([aBinding hasPrefix:CPEnabledBinding])
|
||||
return [CPMultipleValueAndBinding class];
|
||||
else if (aBinding === CPTargetBinding || [aBinding hasPrefix:CPArgumentBinding])
|
||||
return [CPActionBinding class];
|
||||
|
||||
return [super _binderClassForBinding:aBinding];
|
||||
}
|
||||
|
||||
@@ -247,8 +247,6 @@
|
||||
CGContextMoveToPoint(context, 1.0, 4.0);
|
||||
CGContextAddLineToPoint(context, 9.0, 4.0);
|
||||
CGContextAddLineToPoint(context, 5.0, 8.0);
|
||||
CGContextAddLineToPoint(context, 1.0, 4.0);
|
||||
|
||||
CGContextClosePath(context);
|
||||
|
||||
CGContextSetFillColor(context, _color);
|
||||
|
||||
@@ -1948,9 +1948,8 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt
|
||||
CGContextMoveToPoint(context, 0.0, 0.0);
|
||||
CGContextAddLineToPoint(context, 9.0, 0.0);
|
||||
CGContextAddLineToPoint(context, 4.5, 8.0);
|
||||
CGContextAddLineToPoint(context, 0.0, 0.0);
|
||||
|
||||
CGContextClosePath(context);
|
||||
|
||||
CGContextSetFillColor(context,
|
||||
colorForDisclosureTriangle([self hasThemeState:CPThemeStateSelected],
|
||||
[self hasThemeState:CPThemeStateHighlighted]));
|
||||
@@ -1958,8 +1957,8 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, 0.0, 0.0);
|
||||
|
||||
CGContextAddLineToPoint(context, 4.5, 8.0);
|
||||
|
||||
if (_angle === 0.0)
|
||||
CGContextAddLineToPoint(context, 9.0, 0.0);
|
||||
|
||||
|
||||
@@ -204,29 +204,122 @@ var CPRadioRadioGroupKey = @"CPRadioRadioGroupKey";
|
||||
|
||||
@implementation CPRadioGroup : CPObject
|
||||
{
|
||||
CPSet _radios;
|
||||
CPArray _radios;
|
||||
CPRadio _selectedRadio;
|
||||
|
||||
BOOL _enabled @accessors(getter=enabled);
|
||||
BOOL _hidden @accessors(getter=hidden);
|
||||
|
||||
id _target @accessors(property=target);
|
||||
SEL _action @accessors(property=action);
|
||||
}
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
if (self !== [CPRadioGroup class])
|
||||
return;
|
||||
|
||||
[self exposeBinding:CPSelectedValueBinding];
|
||||
[self exposeBinding:CPSelectedTagBinding];
|
||||
[self exposeBinding:CPSelectedIndexBinding];
|
||||
|
||||
[self exposeBinding:CPEnabledBinding];
|
||||
[self exposeBinding:CPHiddenBinding];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_radios = [CPSet set];
|
||||
_radios = [];
|
||||
_selectedRadio = nil;
|
||||
_enabled = YES;
|
||||
_hidden = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/*!
|
||||
Selects the radio button at the given index within the group.
|
||||
If index is -1, all of the radio buttons are turned off.
|
||||
*/
|
||||
- (void)selectRadioAtIndex:(int)index
|
||||
{
|
||||
if (index === -1)
|
||||
[self _setSelectedRadio:nil];
|
||||
else
|
||||
{
|
||||
var radio = [_radios objectAtIndex:index];
|
||||
|
||||
[self _setSelectedRadio:radio];
|
||||
[radio setState:CPOnState];
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Selects the first radio button within the group with the given tag.
|
||||
If a radio button with the given tag is found, selects it
|
||||
and returns YES. Otherwise returns NO.
|
||||
*/
|
||||
- (BOOL)selectRadioWithTag:(int)tag
|
||||
{
|
||||
var index = [_radios indexOfObjectPassingTest:function(radio)
|
||||
{
|
||||
return [radio tag] === tag;
|
||||
}];
|
||||
|
||||
if (index !== CPNotFound)
|
||||
{
|
||||
[self selectRadioAtIndex:index];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the CPRadio that is currently selected within the group,
|
||||
or nil if none are selected.
|
||||
*/
|
||||
- (CPRadio)selectedRadio
|
||||
{
|
||||
return _selectedRadio;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the index of the selected radio within the array of radio buttons.
|
||||
Buttons are numbered going left to right and top to bottom. Returns -1
|
||||
if no radio within the group is selected.
|
||||
*/
|
||||
- (int)selectedRadioIndex
|
||||
{
|
||||
return [_radios indexOfObject:_selectedRadio];
|
||||
}
|
||||
|
||||
- (CPArray)radios
|
||||
{
|
||||
return _radios;
|
||||
}
|
||||
|
||||
- (void)setEnabled:(BOOL)enabled
|
||||
{
|
||||
[_radios makeObjectsPerformSelector:@selector(setEnabled:) withObject:enabled];
|
||||
}
|
||||
|
||||
- (void)setHidden:(BOOL)hidden
|
||||
{
|
||||
[_radios makeObjectsPerformSelector:@selector(setHidden:) withObject:hidden];
|
||||
}
|
||||
|
||||
#pragma mark Private
|
||||
|
||||
- (void)_addRadio:(CPRadio)aRadio
|
||||
{
|
||||
[_radios addObject:aRadio];
|
||||
if ([_radios indexOfObject:aRadio] === CPNotFound)
|
||||
[_radios addObject:aRadio];
|
||||
|
||||
if ([aRadio state] === CPOnState)
|
||||
[self _setSelectedRadio:aRadio];
|
||||
@@ -240,23 +333,30 @@ var CPRadioRadioGroupKey = @"CPRadioRadioGroupKey";
|
||||
[_radios removeObject:aRadio];
|
||||
}
|
||||
|
||||
/*!
|
||||
Selects the first radio button within the group with the given tag.
|
||||
If a radio button with the given tag is found, selects it
|
||||
and returns YES. Otherwise returns NO.
|
||||
*/
|
||||
- (void)_selectRadioWithTitle:(CPString)aTitle
|
||||
{
|
||||
var index = [_radios indexOfObjectPassingTest:function(radio)
|
||||
{
|
||||
return [radio title] === aTitle;
|
||||
}];
|
||||
|
||||
[self selectRadioAtIndex:index];
|
||||
}
|
||||
|
||||
- (void)_setSelectedRadio:(CPRadio)aRadio
|
||||
{
|
||||
if (_selectedRadio === aRadio)
|
||||
return;
|
||||
|
||||
[_selectedRadio setState:CPOffState];
|
||||
|
||||
_selectedRadio = aRadio;
|
||||
}
|
||||
|
||||
- (CPRadio)selectedRadio
|
||||
{
|
||||
return _selectedRadio;
|
||||
}
|
||||
|
||||
- (CPArray)radios
|
||||
{
|
||||
return [_radios allObjects];
|
||||
[_CPRadioGroupSelectionBinder reverseSetValueForObject:self];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -286,3 +386,100 @@ var CPRadioGroupRadiosKey = @"CPRadioGroupRadiosKey",
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPRadioGroup (BindingSupport)
|
||||
|
||||
+ (Class)_binderClassForBinding:(CPString)aBinding
|
||||
{
|
||||
if (aBinding === CPSelectedValueBinding ||
|
||||
aBinding === CPSelectedTagBinding ||
|
||||
aBinding === CPSelectedIndexBinding)
|
||||
{
|
||||
var capitalizedBinding = aBinding.charAt(0).toUpperCase() + aBinding.substr(1);
|
||||
|
||||
return [CPClassFromString(@"_CPRadioGroup" + capitalizedBinding + "Binder") class];
|
||||
}
|
||||
else if ([aBinding hasPrefix:CPEnabledBinding])
|
||||
return [CPMultipleValueAndBinding class];
|
||||
else if ([aBinding hasPrefix:CPHiddenBinding])
|
||||
return [CPMultipleValueOrBinding class];
|
||||
|
||||
return [super _binderClassForBinding:aBinding];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var binderForObject = {};
|
||||
|
||||
@implementation _CPRadioGroupSelectionBinder : CPBinder
|
||||
{
|
||||
CPString _selectionBinding @accessors;
|
||||
}
|
||||
|
||||
- (id)initWithBinding:(CPString)aBinding name:(CPString)aName to:(id)aDestination keyPath:(CPString)aKeyPath options:(CPDictionary)options from:(id)aSource
|
||||
{
|
||||
self = [super initWithBinding:aBinding name:aName to:aDestination keyPath:aKeyPath options:options from:aSource];
|
||||
|
||||
if (self)
|
||||
{
|
||||
binderForObject[[aSource UID]] = self;
|
||||
_selectionBinding = aName;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (void)reverseSetValueForObject:(id)aSource
|
||||
{
|
||||
var binder = binderForObject[[aSource UID]];
|
||||
[binder reverseSetValueFor:[binder _selectionBinding]];
|
||||
}
|
||||
|
||||
- (void)setPlaceholderValue:(id)aValue withMarker:(CPString)aMarker forBinding:(CPString)aBinding
|
||||
{
|
||||
[self setValue:aValue forBinding:aBinding];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPRadioGroupSelectedIndexBinder : _CPRadioGroupSelectionBinder
|
||||
|
||||
- (void)setValue:(id)aValue forBinding:(CPString)aBinding
|
||||
{
|
||||
[_source selectRadioAtIndex:aValue];
|
||||
}
|
||||
|
||||
- (id)valueForBinding:(CPString)aBinding
|
||||
{
|
||||
return [_source selectedRadioIndex];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPRadioGroupSelectedTagBinder : _CPRadioGroupSelectionBinder
|
||||
|
||||
- (void)setValue:(id)aValue forBinding:(CPString)aBinding
|
||||
{
|
||||
[_source selectRadioWithTag:aValue];
|
||||
}
|
||||
|
||||
- (id)valueForBinding:(CPString)aBinding
|
||||
{
|
||||
return [[_source selectedRadio] tag];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPRadioGroupSelectedValueBinder : _CPRadioGroupSelectionBinder
|
||||
|
||||
- (void)setValue:(id)aValue forBinding:(CPString)aBinding
|
||||
{
|
||||
[_source _selectRadioWithTitle:aValue];
|
||||
}
|
||||
|
||||
- (id)valueForBinding:(CPString)aBinding
|
||||
{
|
||||
return [[_source selectedRadio] title];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
maxX = CGRectGetWidth(bounds),
|
||||
maxY = CGRectGetHeight(bounds);
|
||||
|
||||
// Draw background
|
||||
// Draw background
|
||||
if ([self _isSelected])
|
||||
_backgroundColor = [_ruleEditor _selectedRowColor];
|
||||
else
|
||||
@@ -78,20 +78,20 @@
|
||||
CGContextSetFillColor(context, _backgroundColor);
|
||||
CGContextFillRect(context, rect);
|
||||
|
||||
// Draw Top Border
|
||||
// Draw Top Border
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, 0, 0);
|
||||
CGContextAddLineToPoint(context, maxX, 0);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, [_ruleEditor _sliceTopBorderColor]);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
// Draw Bottom Border
|
||||
// Draw Bottom Border
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, 0, maxY);
|
||||
CGContextAddLineToPoint(context, maxX, maxY);
|
||||
CGContextClosePath(context);
|
||||
|
||||
var bottomColor = (_rowIndex == [_ruleEditor _lastRow]) ? [_ruleEditor _sliceLastBottomBorderColor] : [_ruleEditor _sliceBottomBorderColor];
|
||||
|
||||
CGContextSetStrokeColor(context, bottomColor);
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
|
||||
@@ -520,6 +520,17 @@ var CPTabViewItemsKey = "CPTabViewItemsKey",
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
// This is a quick and dirty fix of the tab view item we decode and install in _box
|
||||
// having a different _superview decoded later in the decoding process - e.g. the
|
||||
// CPTabView itself as is the case when we're coming from an xib. This solution could
|
||||
// probably be improved by fixing this in nib2cib instead, but the _box doesn't yet
|
||||
// exist then so it's not totally clear what to change the superview to at that stage.
|
||||
if ([_box contentView])
|
||||
_box._contentView._superview = _box;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[super encodeWithCoder:aCoder];
|
||||
|
||||
@@ -551,7 +551,7 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal
|
||||
[self stopTrackingTableColumn:_activeColumn at:aLocation];
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
|
||||
[_tableView _enqueueDraggingViews];
|
||||
}
|
||||
|
||||
@@ -701,6 +701,7 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal
|
||||
columnMaxX;
|
||||
|
||||
CGContextBeginPath(context);
|
||||
|
||||
for (; columnArrayIndex < columnArrayCount; columnArrayIndex++)
|
||||
{
|
||||
// grab each column rect and add vertical lines
|
||||
@@ -712,6 +713,7 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal
|
||||
CGContextMoveToPoint(context, FLOOR(columnMaxX) - 0.5, ROUND(_CGRectGetMinY(columnToStroke)));
|
||||
CGContextAddLineToPoint(context, FLOOR(columnMaxX) - 0.5, ROUND(_CGRectGetMaxY(columnToStroke)) - 1.0);
|
||||
}
|
||||
|
||||
CGContextClosePath(context);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
|
||||
@@ -1406,7 +1406,8 @@ NOT YET IMPLEMENTED
|
||||
|
||||
|
||||
/*!
|
||||
Deselects all rows
|
||||
@ignore
|
||||
Deselects all rows and columns
|
||||
*/
|
||||
- (void)deselectAll
|
||||
{
|
||||
@@ -1414,6 +1415,33 @@ NOT YET IMPLEMENTED
|
||||
[self selectColumnIndexes:[CPIndexSet indexSet] byExtendingSelection:NO];
|
||||
}
|
||||
|
||||
- (void)selectAll:(id)sender
|
||||
{
|
||||
if (_allowsMultipleSelection)
|
||||
{
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_selectionShouldChangeInTableView_ &&
|
||||
![_delegate selectionShouldChangeInTableView:self])
|
||||
return;
|
||||
|
||||
if ([[self selectedColumnIndexes] count])
|
||||
[self selectColumnIndexes:[CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, [self numberOfColumns])] byExtendingSelection:NO];
|
||||
else
|
||||
[self selectRowIndexes:[CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, [self numberOfRows])] byExtendingSelection:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)deselectAll:(id)sender
|
||||
{
|
||||
if ([self allowsEmptySelection])
|
||||
{
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_selectionShouldChangeInTableView_ &&
|
||||
![_delegate selectionShouldChangeInTableView:self])
|
||||
return;
|
||||
|
||||
[self deselectAll];
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the number of columns in the table
|
||||
*/
|
||||
@@ -2350,6 +2378,9 @@ NOT YET IMPLEMENTED
|
||||
autosaveName = [self autosaveName],
|
||||
tableColumns = [userDefaults objectForKey:[self _columnsKeyForAutosaveName:autosaveName]];
|
||||
|
||||
if ([tableColumns count] != [[self tableColumns] count])
|
||||
return;
|
||||
|
||||
for (var i = 0; i < [tableColumns count]; i++)
|
||||
{
|
||||
var metaData = [tableColumns objectAtIndex:i],
|
||||
@@ -2357,12 +2388,14 @@ NOT YET IMPLEMENTED
|
||||
column = [self columnWithIdentifier:columnIdentifier],
|
||||
tableColumn = [self tableColumnWithIdentifier:columnIdentifier];
|
||||
|
||||
[self _moveColumn:column toColumn:i];
|
||||
[tableColumn setWidth:[metaData objectForKey:@"width"]];
|
||||
if (tableColumn && column != CPNotFound)
|
||||
{
|
||||
[self _moveColumn:column toColumn:i];
|
||||
[tableColumn setWidth:[metaData objectForKey:@"width"]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
@anchor setdelegate
|
||||
Sets the delegate of the receiver.
|
||||
@@ -2883,7 +2916,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
[self _setObjectValueForTableColumn:tableColumn row:row forView:dataView];
|
||||
[view addSubview:dataView];
|
||||
[_draggingViews addObject:dataView];
|
||||
|
||||
|
||||
row = [theDraggedRows indexGreaterThanIndex:row];
|
||||
}
|
||||
}
|
||||
@@ -3648,6 +3681,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
while (colorIndex < colorCount)
|
||||
{
|
||||
CGContextBeginPath(context);
|
||||
|
||||
for (var row = firstRow + colorIndex; row <= lastRow; row += colorCount)
|
||||
{
|
||||
// if it's not a group row draw it otherwise we draw it later
|
||||
@@ -3656,6 +3690,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
else
|
||||
groupRowRects.push(CGRectIntersection(aRect, [self _rectOfRow:row checkRange:NO]));
|
||||
}
|
||||
|
||||
CGContextClosePath(context);
|
||||
|
||||
CGContextSetFillColor(context, rowColors[colorIndex]);
|
||||
@@ -3828,22 +3863,20 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
CGContextFillPath(context);
|
||||
CGContextBeginPath(context);
|
||||
}
|
||||
|
||||
CGContextAddRect(context, rowRect);
|
||||
|
||||
CGContextDrawLinearGradient(context, (shouldUseGroupGradient) ? gradientGroupColor : gradientColor, rowRect.origin, _CGPointMake(minX, maxY), 0);
|
||||
CGContextClosePath(context);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, minX, minY + .5);
|
||||
CGContextAddLineToPoint(context, maxX, minY + .5);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, (shouldUseGroupGradient) ? topGroupLineColor : topLineColor);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, minX, maxY - .5);
|
||||
CGContextAddLineToPoint(context, maxX, maxY - .5);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, (shouldUseGroupGradient) ? bottomGroupLineColor : bottomLineColor);
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
@@ -3878,7 +3911,9 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
}
|
||||
|
||||
CGContextBeginPath(context);
|
||||
|
||||
var gridStyleMask = [self gridStyleMask];
|
||||
|
||||
for (var i = 0; i < count2; i++)
|
||||
{
|
||||
var rect = objj_msgSend(self, rectSelector, indexes[i]),
|
||||
@@ -3893,7 +3928,9 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
exposedColumnIndexes = [],
|
||||
firstExposedColumn = [exposedColumns firstIndex],
|
||||
exposedRange = CPMakeRange(firstExposedColumn, [exposedColumns lastIndex] - firstExposedColumn + 1);
|
||||
|
||||
[exposedColumns getIndexes:exposedColumnIndexes maxCount:-1 inIndexRange:exposedRange];
|
||||
|
||||
var exposedColumnCount = [exposedColumnIndexes count];
|
||||
|
||||
for (var c = firstExposedColumn; c < exposedColumnCount; c++)
|
||||
@@ -3955,25 +3992,20 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
maxY = CGRectGetMaxY(rowRect);
|
||||
|
||||
CGContextDrawLinearGradient(context, gradientColor, rowRect.origin, CGPointMake(minX, maxY), 0);
|
||||
CGContextClosePath(context);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, minX, minY);
|
||||
CGContextAddLineToPoint(context, maxX, minY);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, topLineColor);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, minX, maxY);
|
||||
CGContextAddLineToPoint(context, maxX, maxY - 1);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, bottomLineColor);
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
}
|
||||
|
||||
CGContextClosePath(context);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -4547,7 +4579,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
{
|
||||
[self _enqueueReusableDataView:dataView];
|
||||
}];
|
||||
|
||||
|
||||
[_draggingViews removeAllObjects];
|
||||
}
|
||||
|
||||
@@ -4562,6 +4594,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
|
||||
var newSelection,
|
||||
shouldExtendSelection = NO;
|
||||
|
||||
// If cmd/ctrl was held down XOR the old selection with the proposed selection
|
||||
if ([self mouseDownFlags] & (CPCommandKeyMask | CPControlKeyMask | CPAlternateKeyMask))
|
||||
{
|
||||
@@ -4571,14 +4604,12 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
|
||||
[newSelection removeIndex:aRow];
|
||||
}
|
||||
|
||||
else if (_allowsMultipleSelection)
|
||||
{
|
||||
newSelection = [_selectedRowIndexes copy];
|
||||
|
||||
[newSelection addIndex:aRow];
|
||||
}
|
||||
|
||||
else
|
||||
newSelection = [CPIndexSet indexSetWithIndex:aRow];
|
||||
}
|
||||
@@ -5066,6 +5097,7 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey",
|
||||
CGContextSetFillColor(context, [CPColor colorWithRed:72 / 255 green:134 / 255 blue:202 / 255 alpha:0.25]);
|
||||
CGContextFillRoundedRectangleInRect(context, newRect, 8, YES, YES, YES, YES);
|
||||
}
|
||||
|
||||
CGContextStrokeRoundedRectangleInRect(context, newRect, 8, YES, YES, YES, YES);
|
||||
|
||||
}
|
||||
@@ -5086,7 +5118,6 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey",
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, 10, aRect.origin.y + 8);
|
||||
CGContextAddLineToPoint(context, aRect.size.width - aRect.origin.y - 8, aRect.origin.y + 8);
|
||||
CGContextClosePath(context);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
CGContextSetStrokeColor(context, [CPColor colorWithHexString:@"4886ca"]);
|
||||
@@ -5099,7 +5130,6 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey",
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, 10, aRect.origin.y + 8);
|
||||
CGContextAddLineToPoint(context, aRect.size.width - aRect.origin.y - 8, aRect.origin.y + 8);
|
||||
CGContextClosePath(context);
|
||||
CGContextStrokePath(context);
|
||||
//CGContextStrokeLineSegments(context, [aRect.origin.x + 8, aRect.origin.y + 8, 300 , aRect.origin.y + 8]);
|
||||
}
|
||||
|
||||
@@ -2787,6 +2787,12 @@ setBoundsOrigin:
|
||||
[self viewDidChangeTheme];
|
||||
}
|
||||
|
||||
- (void)_setThemeIncludingDescendants:(CPTheme)aTheme
|
||||
{
|
||||
[self setTheme:aTheme];
|
||||
[[self subviews] makeObjectsPerformSelector:@selector(_setThemeIncludingDescendants:) withObject:aTheme];
|
||||
}
|
||||
|
||||
- (CPTheme)theme
|
||||
{
|
||||
return _theme;
|
||||
|
||||
@@ -189,6 +189,7 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
|
||||
|
||||
CGContextSetStrokeColor(context, strokeColor);
|
||||
CGContextSetLineWidth(context, strokeWidth);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextSetShadowWithColor(context, shadowSize, shadowBlur, shadowColor);
|
||||
CGContextDrawLinearGradient(context, gradient, _CGPointMake(_CGRectGetMidX(frame), 0.0), _CGPointMake(_CGRectGetMidX(frame), frame.size.height), 0);
|
||||
@@ -206,6 +207,8 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
|
||||
pt = _CGPointMakeZero();
|
||||
|
||||
// draw!
|
||||
var path = CGPathCreateMutable();
|
||||
|
||||
switch (_preferredEdge)
|
||||
{
|
||||
case CPMinXEdge:
|
||||
@@ -213,12 +216,12 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
|
||||
// origin nw
|
||||
pt.x = CGAlignCoordinate(xMin + radius);
|
||||
pt.y = yMin;
|
||||
CGContextMoveToPoint(context, pt.x, pt.y);
|
||||
CGPathMoveToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// ne
|
||||
pt.x = CGAlignCoordinate(xMax - radius);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGContextAddCurveToPoint(context, pt.x, pt.y, xMax, yMin, xMax, CGAlignCoordinate(yMin + radius));
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, xMax, yMin, xMax, CGAlignCoordinate(yMin + radius));
|
||||
|
||||
if (_preferredEdge === CPMinXEdge)
|
||||
{
|
||||
@@ -237,30 +240,30 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
|
||||
|
||||
pt.x = arrowAnchor.x;
|
||||
arrowStart = _CGPointMakeCopy(pt);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// top edge -> point
|
||||
pt.x = CGAlignStroke(arrowAnchor.x + arrowHeight, strokeWidth);
|
||||
pt.y = arrowAnchor.y;
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// point -> bottom edge
|
||||
pt.x = arrowAnchor.x;
|
||||
pt.y = CGAlignCoordinate(arrowStart.y + arrowWidth);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
}
|
||||
|
||||
// se
|
||||
pt.x = xMax;
|
||||
pt.y = CGAlignCoordinate(yMax - radius);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGContextAddCurveToPoint(context, pt.x, pt.y, pt.x, yMax, CGAlignCoordinate(xMax - radius), yMax);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, pt.x, yMax, CGAlignCoordinate(xMax - radius), yMax);
|
||||
|
||||
// sw
|
||||
pt.x = CGAlignCoordinate(xMin + radius);
|
||||
pt.y = yMax;
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGContextAddCurveToPoint(context, pt.x, pt.y, xMin, pt.y, xMin, CGAlignCoordinate(yMax - radius));
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, xMin, pt.y, xMin, CGAlignCoordinate(yMax - radius));
|
||||
|
||||
if (_preferredEdge === CPMaxXEdge)
|
||||
{
|
||||
@@ -279,24 +282,24 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
|
||||
|
||||
pt.x = arrowAnchor.x;
|
||||
arrowStart = _CGPointMakeCopy(pt);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// bottom edge -> point
|
||||
pt.x = CGAlignStroke(arrowAnchor.x - arrowHeight, strokeWidth);
|
||||
pt.y = arrowAnchor.y;
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// point -> top edge
|
||||
pt.x = arrowAnchor.x;
|
||||
pt.y = CGAlignCoordinate(arrowStart.y - arrowWidth);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
}
|
||||
|
||||
// nw
|
||||
pt.x = xMin;
|
||||
pt.y = CGAlignCoordinate(yMin + radius);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGContextAddCurveToPoint(context, pt.x, pt.y, pt.x, yMin, CGAlignCoordinate(xMin + radius), yMin);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, pt.x, yMin, CGAlignCoordinate(xMin + radius), yMin);
|
||||
break;
|
||||
|
||||
case CPMaxYEdge:
|
||||
@@ -304,12 +307,12 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
|
||||
// origin sw
|
||||
pt.x = xMin;
|
||||
pt.y = CGAlignCoordinate(yMax - radius);
|
||||
CGContextMoveToPoint(context, pt.x, pt.y);
|
||||
CGPathMoveToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// nw
|
||||
pt.y = CGAlignCoordinate(yMin + radius);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGContextAddCurveToPoint(context, pt.x, pt.y, pt.x, yMin, CGAlignCoordinate(xMin + radius), yMin);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, pt.x, yMin, CGAlignCoordinate(xMin + radius), yMin);
|
||||
|
||||
if (_preferredEdge === CPMaxYEdge)
|
||||
{
|
||||
@@ -328,30 +331,30 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
|
||||
|
||||
pt.y = arrowAnchor.y;
|
||||
arrowStart = _CGPointMakeCopy(pt);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// left edge -> point
|
||||
pt.x = arrowAnchor.x;
|
||||
pt.y = CGAlignStroke(arrowAnchor.y - arrowHeight, strokeWidth);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// point -> right edge
|
||||
pt.x = CGAlignCoordinate(arrowStart.x + arrowWidth);
|
||||
pt.y = arrowAnchor.y;
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
}
|
||||
|
||||
// ne
|
||||
pt.x = CGAlignCoordinate(xMax - radius);
|
||||
pt.y = yMin;
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGContextAddCurveToPoint(context, pt.x, pt.y, xMax, pt.y, xMax, CGAlignCoordinate(yMin + radius));
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, xMax, pt.y, xMax, CGAlignCoordinate(yMin + radius));
|
||||
|
||||
// se
|
||||
pt.x = xMax;
|
||||
pt.y = CGAlignCoordinate(yMax - radius);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGContextAddCurveToPoint(context, pt.x, pt.y, pt.x, yMax, CGAlignCoordinate(xMax - radius), yMax);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, pt.x, yMax, CGAlignCoordinate(xMax - radius), yMax);
|
||||
|
||||
if (_preferredEdge === CPMinYEdge)
|
||||
{
|
||||
@@ -370,33 +373,35 @@ var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
|
||||
|
||||
pt.y = arrowAnchor.y;
|
||||
arrowStart = _CGPointMakeCopy(pt);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// right edge -> point
|
||||
pt.x = arrowAnchor.x;
|
||||
pt.y = CGAlignStroke(arrowAnchor.y + arrowHeight, strokeWidth);
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
|
||||
// point -> left edge
|
||||
pt.x = CGAlignCoordinate(arrowStart.x - arrowWidth);
|
||||
pt.y = arrowAnchor.y;
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
}
|
||||
|
||||
// sw
|
||||
pt.x = CGAlignCoordinate(xMin + radius);
|
||||
pt.y = yMax;
|
||||
CGContextAddLineToPoint(context, pt.x, pt.y);
|
||||
CGContextAddCurveToPoint(context, pt.x, pt.y, xMin, pt.y, xMin, CGAlignCoordinate(yMax - radius));
|
||||
CGPathAddLineToPoint(path, NULL, pt.x, pt.y);
|
||||
CGPathAddCurveToPoint(path, NULL, pt.x, pt.y, xMin, pt.y, xMin, CGAlignCoordinate(yMax - radius));
|
||||
break;
|
||||
|
||||
default:
|
||||
// no computed edge means standard rounded rect
|
||||
CGContextAddPath(context, CGPathWithRoundedRectangleInRect(frame, radius, radius, YES, YES, YES, YES));
|
||||
CGPathAddPath(path, NULL, CGPathWithRoundedRectangleInRect(frame, radius, radius, YES, YES, YES, YES));
|
||||
}
|
||||
|
||||
CGContextClosePath(context);
|
||||
CGContextAddPath(context, path);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
CGContextAddPath(context, path);
|
||||
CGContextFillPath(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,17 +99,17 @@
|
||||
CGContextSetStrokeColor(context, strokeColor);
|
||||
CGContextSetFillColor(context, bgColor);
|
||||
CGContextSetLineWidth(context, strokeWidth);
|
||||
CGContextBeginPath(context);
|
||||
|
||||
aRect.origin.x += strokeWidth;
|
||||
aRect.origin.y += strokeWidth;
|
||||
aRect.size.width -= strokeWidth * 2;
|
||||
aRect.size.height -= strokeWidth * 2;
|
||||
|
||||
CGContextAddPath(context, CGPathWithRoundedRectangleInRect(aRect, radius, radius, YES, YES, YES, YES));
|
||||
CGContextClosePath(context);
|
||||
|
||||
var path = CGPathWithRoundedRectangleInRect(aRect, radius, radius, YES, YES, YES, YES);
|
||||
CGContextAddPath(context, path);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
CGContextAddPath(context, path);
|
||||
CGContextFillPath(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ var CALayerGeometryBoundsMask = 1,
|
||||
CALayerGeometryAnchorPointMask = 4,
|
||||
CALayerGeometryAffineTransformMask = 8,
|
||||
CALayerGeometryParentSublayerTransformMask = 16;
|
||||
|
||||
var USE_BUFFER = NO;
|
||||
|
||||
var CALayerFrameOriginUpdateMask = 1,
|
||||
@@ -349,7 +350,7 @@ var CALayerRegisteredRunLoopUpdates = nil;
|
||||
*/
|
||||
- (void)setFrame:(CGRect)aFrame
|
||||
{
|
||||
alert("FIXME IMPLEMENT");
|
||||
// FIXME: implement this
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -474,6 +475,7 @@ var CALayerRegisteredRunLoopUpdates = nil;
|
||||
CGContextSaveGState(_context);
|
||||
|
||||
CGContextConcatCTM(_context, transform);//_transformFromView);
|
||||
|
||||
if (USE_BUFFER)
|
||||
{
|
||||
// CGContextDrawImage(_context, _bounds, _contents.context);
|
||||
@@ -481,6 +483,7 @@ var CALayerRegisteredRunLoopUpdates = nil;
|
||||
}
|
||||
else
|
||||
[self drawInContext:_context];
|
||||
|
||||
CGContextRestoreGState(_context);
|
||||
}
|
||||
|
||||
@@ -536,7 +539,7 @@ var CALayerRegisteredRunLoopUpdates = nil;
|
||||
@param aContext the context to draw the layer into
|
||||
*/
|
||||
- (void)drawInContext:(CGContext)aContext
|
||||
{ //if (!window.loop || window.nodisplay) CPLog.error("htiasd");
|
||||
{
|
||||
if (_backgroundColor)
|
||||
{
|
||||
CGContextSetFillColor(aContext, _backgroundColor);
|
||||
@@ -658,11 +661,6 @@ if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex)
|
||||
- (void)addSublayer:(CALayer)aLayer
|
||||
{
|
||||
[self insertSublayer:aLayer atIndex:_sublayers.length];
|
||||
return;
|
||||
ADJUST_CONTENTS_ZINDEX(aLayer);
|
||||
|
||||
[_sublayers addObject:aLayer];
|
||||
_DOMElement.appendChild(DOM(aLayer));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -746,6 +744,7 @@ if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex)
|
||||
- (void)insertSublayer:(CALayer)aLayer above:(CALayer)aSublayer
|
||||
{
|
||||
var index = aSublayer ? [_sublayers indexOfObjectIdenticalTo:aSublayer] : _sublayers.length;
|
||||
|
||||
if (index == CPNotFound)
|
||||
[CPException raise:"CALayerNotFoundException" reason:"aSublayer is not a sublayer of this layer"];
|
||||
|
||||
@@ -762,10 +761,9 @@ if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex)
|
||||
if (aSublayer == aLayer)
|
||||
return;
|
||||
|
||||
// FIXME: EXCEPTION
|
||||
if (aSublayer._superlayer != self)
|
||||
{
|
||||
alert("EXCEPTION");
|
||||
CPLog.warn("Attempt to replace a sublayer (%s) which is not in the sublayers of the receiver (%s).", [aSublayer description], [self description]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -798,6 +796,7 @@ if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex)
|
||||
|
||||
layer._runLoopUpdateMask = 0;
|
||||
}
|
||||
|
||||
window.loop = false;
|
||||
CALayerRegisteredRunLoopUpdates = nil;
|
||||
}
|
||||
@@ -928,7 +927,6 @@ if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex)
|
||||
return nil;
|
||||
|
||||
var point = CGPointApplyAffineTransform(aPoint, _transformToLayer);
|
||||
//alert(point.x + " " + point.y);
|
||||
|
||||
if (!_CGRectContainsPoint(_bounds, point))
|
||||
return nil;
|
||||
|
||||
@@ -548,6 +548,23 @@ function CGContextFillPath(aContext)
|
||||
CGContextClosePath(aContext);
|
||||
}
|
||||
|
||||
/*!
|
||||
Strokes a rectangle with the given dimensions and the given stroke width
|
||||
@param aContext the CGContext to draw into
|
||||
@param aRect the CGRect indicating the bounds of the rect to be drawn
|
||||
@param aWidth the width with which to stroke the rect
|
||||
@return void
|
||||
*/
|
||||
function CGContextStrokeRectWithWidth(aContext, aRect, aWidth)
|
||||
{
|
||||
CGContextSaveGState(aContext);
|
||||
|
||||
CGContextSetLineWidth(aContext, aWidth);
|
||||
CGContextStrokeRect(aContext, aRect);
|
||||
|
||||
CGContextRestoreGState(aContext);
|
||||
}
|
||||
|
||||
var KAPPA = 4.0 * ((SQRT2 - 1.0) / 3.0);
|
||||
|
||||
/*!
|
||||
|
||||
@@ -43,6 +43,16 @@ var CANVAS_LINECAP_TABLE = [ "butt", "round", "square" ],
|
||||
#define _CGContextFillRectCanvas(aContext, aRect) aContext.fillRect(_CGRectGetMinX(aRect), _CGRectGetMinY(aRect), _CGRectGetWidth(aRect), _CGRectGetHeight(aRect))
|
||||
#define _CGContextClipCanvas(aContext) aContext.clip()
|
||||
|
||||
// In Cocoa, all primitives excepts rects cannot be added to the context's path
|
||||
// until a move to point has been done, because an empty path has no current point.
|
||||
var hasPath = function(aContext, methodName)
|
||||
{
|
||||
if (!aContext.hasPath)
|
||||
CPLog.error(methodName + ": no current point");
|
||||
|
||||
return aContext.hasPath;
|
||||
}
|
||||
|
||||
function CGContextSaveGState(aContext)
|
||||
{
|
||||
aContext.save();
|
||||
@@ -80,6 +90,9 @@ function CGContextSetBlendMode(aContext, aBlendMode)
|
||||
|
||||
function CGContextAddArc(aContext, x, y, radius, startAngle, endAngle, clockwise)
|
||||
{
|
||||
if (!hasPath(aContext, "CGContextAddArc"))
|
||||
return;
|
||||
|
||||
// Despite the documentation saying otherwise, the last parameter is anti-clockwise not clockwise.
|
||||
// http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes#Arcs
|
||||
_CGContextAddArcCanvas(aContext, x, y, radius, startAngle, endAngle, !clockwise);
|
||||
@@ -87,16 +100,42 @@ function CGContextAddArc(aContext, x, y, radius, startAngle, endAngle, clockwise
|
||||
|
||||
function CGContextAddArcToPoint(aContext, x1, y1, x2, y2, radius)
|
||||
{
|
||||
if (!hasPath(aContext, "CGContextAddArcToPoint"))
|
||||
return;
|
||||
|
||||
_CGContextAddArcToPointCanvas(aContext, x1, y1, x2, y2, radius);
|
||||
}
|
||||
|
||||
function CGContextAddCurveToPoint(aContext, cp1x, cp1y, cp2x, cp2y, x, y)
|
||||
{
|
||||
if (!hasPath(aContext, "CGContextAddCurveToPoint"))
|
||||
return;
|
||||
|
||||
_CGContextAddCurveToPointCanvas(aContext, cp1x, cp1y, cp2x, cp2y, x, y);
|
||||
}
|
||||
|
||||
function CGContextAddLines(aContext, points, count)
|
||||
{
|
||||
// implementation mirrors that of CGPathAddLines()
|
||||
if (count === null || count === undefined)
|
||||
count = points.length;
|
||||
|
||||
if (count < 1)
|
||||
return;
|
||||
|
||||
_CGContextMoveToPointCanvas(aContext, points[0].x, points[0].y);
|
||||
|
||||
for (var i = 1; i < count; ++i)
|
||||
_CGContextAddLineToPointCanvas(aContext, points[i].x, points[i].y);
|
||||
|
||||
aContext.hasPath = YES;
|
||||
}
|
||||
|
||||
function CGContextAddLineToPoint(aContext, x, y)
|
||||
{
|
||||
if (!hasPath(aContext, "CGContextAddLineToPoint"))
|
||||
return;
|
||||
|
||||
_CGContextAddLineToPointCanvas(aContext, x, y);
|
||||
}
|
||||
|
||||
@@ -105,8 +144,14 @@ function CGContextAddPath(aContext, aPath)
|
||||
if (!aContext || CGPathIsEmpty(aPath))
|
||||
return;
|
||||
|
||||
var elements = aPath.elements,
|
||||
// If the context does not have a path, explicitly begin one
|
||||
if (!aContext.hasPath)
|
||||
_CGContextBeginPathCanvas(aContext);
|
||||
|
||||
// We must implicitly move to the start of the path
|
||||
_CGContextMoveToPointCanvas(aContext, aPath.start.x, aPath.start.y);
|
||||
|
||||
var elements = aPath.elements,
|
||||
i = 0,
|
||||
count = aPath.count;
|
||||
|
||||
@@ -117,46 +162,71 @@ function CGContextAddPath(aContext, aPath)
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case kCGPathElementMoveToPoint: _CGContextMoveToPointCanvas(aContext, element.x, element.y);
|
||||
break;
|
||||
case kCGPathElementAddLineToPoint: _CGContextAddLineToPointCanvas(aContext, element.x, element.y);
|
||||
break;
|
||||
case kCGPathElementAddQuadCurveToPoint: _CGContextAddQuadCurveToPointCanvas(aContext, element.cpx, element.cpy, element.x, element.y);
|
||||
break;
|
||||
case kCGPathElementAddCurveToPoint: _CGContextAddCurveToPointCanvas(aContext, element.cp1x, element.cp1y, element.cp2x, element.cp2y, element.x, element.y);
|
||||
break;
|
||||
case kCGPathElementCloseSubpath: _CGContextClosePathCanvas(aContext);
|
||||
break;
|
||||
case kCGPathElementAddArc: _CGContextAddArcCanvas(aContext, element.x, element.y, element.radius, element.startAngle, element.endAngle, element.clockwise);
|
||||
break;
|
||||
case kCGPathElementAddArcToPoint: _CGContextAddArcToPointCanvas(aContext, element.p1x, element.p1y, element.p2x, element.p2y, element.radius);
|
||||
break;
|
||||
case kCGPathElementMoveToPoint:
|
||||
_CGContextMoveToPointCanvas(aContext, element.x, element.y);
|
||||
break;
|
||||
|
||||
case kCGPathElementAddLineToPoint:
|
||||
_CGContextAddLineToPointCanvas(aContext, element.x, element.y);
|
||||
break;
|
||||
|
||||
case kCGPathElementAddQuadCurveToPoint:
|
||||
_CGContextAddQuadCurveToPointCanvas(aContext, element.cpx, element.cpy, element.x, element.y);
|
||||
break;
|
||||
|
||||
case kCGPathElementAddCurveToPoint:
|
||||
_CGContextAddCurveToPointCanvas(aContext, element.cp1x, element.cp1y, element.cp2x, element.cp2y, element.x, element.y);
|
||||
break;
|
||||
|
||||
case kCGPathElementCloseSubpath:
|
||||
_CGContextClosePathCanvas(aContext);
|
||||
break;
|
||||
|
||||
case kCGPathElementAddArc:
|
||||
_CGContextAddArcCanvas(aContext, element.x, element.y, element.radius, element.startAngle, element.endAngle, element.clockwise);
|
||||
break;
|
||||
|
||||
case kCGPathElementAddArcToPoint:
|
||||
_CGContextAddArcToPointCanvas(aContext, element.p1x, element.p1y, element.p2x, element.p2y, element.radius);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
aContext.hasPath = YES;
|
||||
}
|
||||
|
||||
function CGContextAddRect(aContext, aRect)
|
||||
{
|
||||
_CGContextAddRectCanvas(aContext, aRect);
|
||||
aContext.hasPath = YES;
|
||||
}
|
||||
|
||||
function CGContextAddQuadCurveToPoint(aContext, cpx, cpy, x, y)
|
||||
{
|
||||
if (!hasPath(aContext, "CGContextAddQuadCurveToPoint"))
|
||||
return;
|
||||
|
||||
_CGContextAddQuadCurveToPointCanvas(aContext, cpx, cpy, x, y);
|
||||
}
|
||||
|
||||
function CGContextAddRects(aContext, rects, count)
|
||||
{
|
||||
var i = 0;
|
||||
if (count === null || count === undefined)
|
||||
count = rects.length;
|
||||
|
||||
if (count === NULL)
|
||||
var count = rects.length;
|
||||
|
||||
for (; i < count; ++i)
|
||||
for (var i = 0; i < count; ++i)
|
||||
{
|
||||
var rect = rects[i];
|
||||
_CGContextAddRectCanvas(aContext, rect);
|
||||
}
|
||||
|
||||
aContext.hasPath = YES;
|
||||
}
|
||||
|
||||
function CGContextBeginPath(aContext)
|
||||
{
|
||||
_CGContextBeginPathCanvas(aContext);
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextClosePath(aContext)
|
||||
@@ -164,54 +234,68 @@ function CGContextClosePath(aContext)
|
||||
_CGContextClosePathCanvas(aContext);
|
||||
}
|
||||
|
||||
function CGContextIsPathEmpty(aContext)
|
||||
{
|
||||
return !aContext.hasPath;
|
||||
}
|
||||
|
||||
function CGContextMoveToPoint(aContext, x, y)
|
||||
{
|
||||
_CGContextMoveToPointCanvas(aContext, x, y);
|
||||
aContext.hasPath = YES;
|
||||
}
|
||||
|
||||
function CGContextClearRect(aContext, aRect)
|
||||
{
|
||||
aContext.clearRect(_CGRectGetMinX(aRect), _CGRectGetMinY(aRect), _CGRectGetWidth(aRect), _CGRectGetHeight(aRect));
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextDrawPath(aContext, aMode)
|
||||
{
|
||||
if (aMode == kCGPathFill || aMode == kCGPathFillStroke)
|
||||
aContext.fill();
|
||||
else if (aMode == kCGPathEOFill || aMode == kCGPathEOFillStroke)
|
||||
alert("not implemented!!!");
|
||||
if (!aContext.hasPath)
|
||||
return;
|
||||
|
||||
if (aMode == kCGPathStroke || aMode == kCGPathFillStroke || aMode == kCGPathEOFillStroke)
|
||||
if (aMode === kCGPathFill || aMode === kCGPathFillStroke)
|
||||
aContext.fill();
|
||||
else if (aMode === kCGPathStroke || aMode === kCGPathFillStroke || aMode === kCGPathEOFillStroke)
|
||||
aContext.stroke();
|
||||
else if (aMode === kCGPathEOFill || aMode === kCGPathEOFillStroke)
|
||||
CPLog.warn("Unimplemented fill mode in CGContextDrawPath: %d", aMode);
|
||||
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextFillRect(aContext, aRect)
|
||||
{
|
||||
_CGContextFillRectCanvas(aContext, aRect);
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextFillRects(aContext, rects, count)
|
||||
{
|
||||
var i = 0;
|
||||
if (count === null || count === undefined)
|
||||
count = rects.length;
|
||||
|
||||
if (count === NULL)
|
||||
var count = rects.length;
|
||||
|
||||
for (; i < count; ++i)
|
||||
for (var i = 0; i < count; ++i)
|
||||
{
|
||||
var rect = rects[i];
|
||||
_CGContextFillRectCanvas(aContext, rect);
|
||||
}
|
||||
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextStrokeRect(aContext, aRect)
|
||||
{
|
||||
aContext.strokeRect(_CGRectGetMinX(aRect), _CGRectGetMinY(aRect), _CGRectGetWidth(aRect), _CGRectGetHeight(aRect));
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextClip(aContext)
|
||||
{
|
||||
_CGContextClipCanvas(aContext);
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextClipToRect(aContext, aRect)
|
||||
@@ -221,16 +305,18 @@ function CGContextClipToRect(aContext, aRect)
|
||||
_CGContextClosePathCanvas(aContext);
|
||||
|
||||
_CGContextClipCanvas(aContext);
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextClipToRects(aContext, rects, count)
|
||||
{
|
||||
if (count === NULL)
|
||||
var count = rects.length;
|
||||
if (count === null || count === undefined)
|
||||
count = rects.length;
|
||||
|
||||
_CGContextBeginPathCanvas(aContext);
|
||||
CGContextAddRects(aContext, rects, count);
|
||||
_CGContextClipCanvas(aContext);
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGContextSetAlpha(aContext, anAlpha)
|
||||
@@ -240,20 +326,11 @@ function CGContextSetAlpha(aContext, anAlpha)
|
||||
|
||||
function CGContextSetFillColor(aContext, aColor)
|
||||
{
|
||||
if ([aColor patternImage])
|
||||
var patternImage = [aColor patternImage];
|
||||
|
||||
if ([patternImage isSingleImage])
|
||||
{
|
||||
var patternImg = [aColor patternImage],
|
||||
size = [patternImg size],
|
||||
img;
|
||||
|
||||
if (size)
|
||||
img = new Image(size.width, size.height);
|
||||
else
|
||||
img = new Image();
|
||||
|
||||
img.src = [patternImg filename];
|
||||
|
||||
var pattern = aContext.createPattern(img, "repeat");
|
||||
var pattern = aContext.createPattern([patternImage image], "repeat");
|
||||
|
||||
aContext.fillStyle = pattern;
|
||||
}
|
||||
@@ -261,9 +338,54 @@ function CGContextSetFillColor(aContext, aColor)
|
||||
aContext.fillStyle = [aColor cssString];
|
||||
}
|
||||
|
||||
/*!
|
||||
Creates a context into which you can render a fill pattern
|
||||
of the given size. Once the pattern is rendered, you can
|
||||
set the fill or stroke pattern to the rendered pattern
|
||||
with CGContextSetFillPattern or CGContextSetStrokePattern.
|
||||
*/
|
||||
function CGContextCreatePatternContext(aContext, aSize)
|
||||
{
|
||||
var pattern = document.createElement("canvas");
|
||||
|
||||
pattern.width = aSize.width;
|
||||
pattern.height = aSize.height;
|
||||
|
||||
return pattern.getContext("2d");
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the fill pattern for aContext to the rendered pattern context
|
||||
returned by CGContextCreatePatternContext.
|
||||
*/
|
||||
function CGContextSetFillPattern(aContext, aPatternContext)
|
||||
{
|
||||
var pattern = aContext.createPattern(aPatternContext.canvas, "repeat");
|
||||
aContext.fillStyle = pattern;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the stroke pattern for aContext to the rendered pattern context
|
||||
returned by CGContextCreatePatternContext.
|
||||
*/
|
||||
function CGContextSetStrokePattern(aContext, aPatternContext)
|
||||
{
|
||||
var pattern = aContext.createPattern(aPatternContext.canvas, "repeat");
|
||||
aContext.strokeStyle = pattern;
|
||||
}
|
||||
|
||||
function CGContextSetStrokeColor(aContext, aColor)
|
||||
{
|
||||
aContext.strokeStyle = [aColor cssString];
|
||||
var patternImage = [aColor patternImage];
|
||||
|
||||
if ([patternImage isSingleImage])
|
||||
{
|
||||
var pattern = aContext.createPattern([patternImage image], "repeat");
|
||||
|
||||
aContext.strokeStyle = pattern;
|
||||
}
|
||||
else
|
||||
aContext.strokeStyle = [aColor cssString];
|
||||
}
|
||||
|
||||
function CGContextSetShadow(aContext, aSize, aBlur)
|
||||
@@ -296,59 +418,63 @@ function CGContextTranslateCTM(aContext, tx, ty)
|
||||
aContext.translate(tx, ty);
|
||||
}
|
||||
|
||||
#define scale_rotate(a, b, c, d) \
|
||||
var sign = (a * d < 0.0 || b * c > 0.0) ? -1.0 : 1.0, \
|
||||
a2 = (ATAN2(b, d) + ATAN2(-sign * c, sign * a)) / 2.0, \
|
||||
cos = COS(a2),\
|
||||
sin = SIN(a2);\
|
||||
\
|
||||
if (cos == 0)\
|
||||
{\
|
||||
sx = -c / sin;\
|
||||
sy = b / sin;\
|
||||
}\
|
||||
else if (sin == 0)\
|
||||
{\
|
||||
sx = a / cos;\
|
||||
sy = d / cos;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
abs_cos = ABS(cos);\
|
||||
abs_sin = ABS(sin);\
|
||||
\
|
||||
sx = (abs_cos * a / cos + abs_sin * -c / sin) / (abs_cos + abs_sin);\
|
||||
sy = (abs_cos * d / cos + abs_sin * b / sin) / (abs_cos + abs_sin);\
|
||||
}\
|
||||
var scale_rotate = function(a, b, c, d)
|
||||
{
|
||||
var sign = (a * d < 0.0 || b * c > 0.0) ? -1.0 : 1.0,
|
||||
a2 = (ATAN2(b, d) + ATAN2(-sign * c, sign * a)) / 2.0,
|
||||
cos = COS(a2),
|
||||
sin = SIN(a2);
|
||||
|
||||
#define rotate_scale(a, b, c, d) \
|
||||
var sign = (a * d < 0.0 || b * c > 0.0) ? -1.0 : 1.0;\
|
||||
a1 = (ATAN2(sign * b, sign * a) + ATAN2(-c, d)) / 2.0,\
|
||||
cos = COS(a1),\
|
||||
sin = SIN(a1);\
|
||||
\
|
||||
if (cos == 0)\
|
||||
{\
|
||||
sx = b / sin;\
|
||||
sy = -c / sin;\
|
||||
}\
|
||||
else if (sin == 0)\
|
||||
{\
|
||||
sx = a / cos;\
|
||||
sy = d / cos;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
abs_cos = ABS(cos);\
|
||||
abs_sin = ABS(sin);\
|
||||
\
|
||||
sx = (abs_cos * a / cos + abs_sin * b / sin) / (abs_cos + abs_sin);\
|
||||
sy = (abs_cos * d / cos + abs_sin * -c / sin) / (abs_cos + abs_sin);\
|
||||
}\
|
||||
if (cos === 0)
|
||||
{
|
||||
sx = -c / sin;
|
||||
sy = b / sin;
|
||||
}
|
||||
else if (sin === 0)
|
||||
{
|
||||
sx = a / cos;
|
||||
sy = d / cos;
|
||||
}
|
||||
else
|
||||
{
|
||||
abs_cos = ABS(cos);
|
||||
abs_sin = ABS(sin);
|
||||
|
||||
sx = (abs_cos * a / cos + abs_sin * -c / sin) / (abs_cos + abs_sin);
|
||||
sy = (abs_cos * d / cos + abs_sin * b / sin) / (abs_cos + abs_sin);
|
||||
}
|
||||
};
|
||||
|
||||
var rotate_scale = function(a, b, c, d)
|
||||
{
|
||||
var sign = (a * d < 0.0 || b * c > 0.0) ? -1.0 : 1.0;
|
||||
a1 = (ATAN2(sign * b, sign * a) + ATAN2(-c, d)) / 2.0,
|
||||
cos = COS(a1),
|
||||
sin = SIN(a1);
|
||||
|
||||
if (cos === 0)
|
||||
{
|
||||
sx = b / sin;
|
||||
sy = -c / sin;
|
||||
}
|
||||
else if (sin === 0)
|
||||
{
|
||||
sx = a / cos;
|
||||
sy = d / cos;
|
||||
}
|
||||
else
|
||||
{
|
||||
abs_cos = ABS(cos);
|
||||
abs_sin = ABS(sin);
|
||||
|
||||
sx = (abs_cos * a / cos + abs_sin * b / sin) / (abs_cos + abs_sin);
|
||||
sy = (abs_cos * d / cos + abs_sin * -c / sin) / (abs_cos + abs_sin);
|
||||
}
|
||||
};
|
||||
|
||||
function eigen(anAffineTransform)
|
||||
{
|
||||
alert("IMPLEMENT ME!");
|
||||
CPLog.warn("Unimplemented function: eigen");
|
||||
}
|
||||
|
||||
|
||||
@@ -378,20 +504,20 @@ CGContextConcatCTM = function(aContext, anAffineTransform)
|
||||
a2 = 0.0;
|
||||
|
||||
// Detect the simple case of just scaling.
|
||||
if (b == 0.0 && c == 0.0)
|
||||
if (b === 0.0 && c === 0.0)
|
||||
{
|
||||
sx = a;
|
||||
sy = d;
|
||||
}
|
||||
|
||||
// a scale followed by a rotate
|
||||
else if (a * b == -c * d)
|
||||
else if (a * b === -c * d)
|
||||
{
|
||||
scale_rotate(a, b, c, d)
|
||||
}
|
||||
|
||||
// rotate, then scale.
|
||||
else if (a * c == -b * d)
|
||||
else if (a * c === -b * d)
|
||||
{
|
||||
rotate_scale(a, b, c, d)
|
||||
}
|
||||
@@ -435,6 +561,7 @@ CGContextConcatCTM = function(aContext, anAffineTransform)
|
||||
function CGContextDrawImage(aContext, aRect, anImage)
|
||||
{
|
||||
aContext.drawImage(anImage._image, _CGRectGetMinX(aRect), _CGRectGetMinY(aRect), _CGRectGetWidth(aRect), _CGRectGetHeight(aRect));
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function to_string(aColor)
|
||||
@@ -454,6 +581,7 @@ function CGContextDrawLinearGradient(aContext, aGradient, aStartPoint, anEndPoin
|
||||
|
||||
aContext.fillStyle = linearGradient;
|
||||
aContext.fill();
|
||||
aContext.hasPath = NO;
|
||||
}
|
||||
|
||||
function CGBitmapGraphicsContextCreate()
|
||||
@@ -463,5 +591,8 @@ function CGBitmapGraphicsContextCreate()
|
||||
|
||||
context.DOMElement = DOMElement;
|
||||
|
||||
// canvas gives us no way to query whether the path is empty or not, so we have to track it ourselves
|
||||
context.hasPath = NO;
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ kCGPathElementAddArcToPoint = 6;
|
||||
*/
|
||||
function CGPathCreateMutable()
|
||||
{
|
||||
return { count:0, start:NULL, current:NULL, elements:[] };
|
||||
return { count:0, start:_CGPointMake(0, 0), current:_CGPointMake(0, 0), elements:[] };
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -101,7 +101,7 @@ function CGPathAddArc(aPath, aTransform, x, y, aRadius, aStartAngle, anEndAngle,
|
||||
// Angles that equal "modulo" 2 pi return as equal after transforming them,
|
||||
// so we have to make sure to make them different again if they were different
|
||||
// to start out with. It's the difference between no circle and a full circle.
|
||||
if (anEndAngle == aStartAngle && oldEndAngle != oldStartAngle)
|
||||
if (anEndAngle === aStartAngle && oldEndAngle != oldStartAngle)
|
||||
if (oldStartAngle > oldEndAngle)
|
||||
anEndAngle = anEndAngle - PI2;
|
||||
else
|
||||
@@ -112,7 +112,30 @@ function CGPathAddArc(aPath, aTransform, x, y, aRadius, aStartAngle, anEndAngle,
|
||||
aRadius = SQRT(aRadius.width * aRadius.width + aRadius.height * aRadius.height);
|
||||
}
|
||||
|
||||
aPath.current = _CGPointMake(x + aRadius * COS(anEndAngle), y + aRadius * SIN(anEndAngle));
|
||||
/*
|
||||
From the Cocoa docs:
|
||||
|
||||
If the specified path already contains a subpath, Quartz implicitly adds a line connecting the subpath’s current point to the beginning of the arc. If the path is empty, Quartz creates a new subpath with a starting point set to the starting point of the arc.
|
||||
|
||||
The ending point of the arc becomes the new current point of the path.
|
||||
*/
|
||||
var arcEndX = x + aRadius * COS(anEndAngle),
|
||||
arcEndY = y + aRadius * SIN(anEndAngle);
|
||||
|
||||
if (aPath.count)
|
||||
{
|
||||
if (aPath.current.x !== arcEndX || aPath.current.y !== arcEndY)
|
||||
CGPathAddLineToPoint(aPath, aTransform, arcEndX, arcEndY);
|
||||
}
|
||||
else
|
||||
{
|
||||
var arcStartX = x + aRadius * COS(aStartAngle),
|
||||
arcStartY = y + aRadius * SIN(aStartAngle);
|
||||
|
||||
aPath.start = _CGPointMake(arcStartX, arcStartY);
|
||||
}
|
||||
|
||||
aPath.current = _CGPointMake(arcEndX, arcEndY);
|
||||
aPath.elements[aPath.count++] = { type:kCGPathElementAddArc, x:x, y:y, radius:aRadius, startAngle:aStartAngle, endAngle:anEndAngle, clockwise:isClockwise };
|
||||
}
|
||||
|
||||
@@ -127,6 +150,21 @@ function CGPathAddArcToPoint(aPath, aTransform, x1, y1, x2, y2, aRadius)
|
||||
p2 = _CGPointApplyAffineTransform(p2, aTransform);
|
||||
}
|
||||
|
||||
/*
|
||||
From the Cocoa docs:
|
||||
|
||||
If the current point and the first tangent point of the arc (the starting point) are not equal, Quartz appends a straight line segment from the current point to the first tangent point.
|
||||
|
||||
The ending point of the arc becomes the new current point of the path.
|
||||
*/
|
||||
if (aPath.count)
|
||||
{
|
||||
if (aPath.current.x !== p1.x || aPath.current.y !== p1.y)
|
||||
CGPathAddLineToPoint(aPath, aTransform, p1.x, p1.y);
|
||||
}
|
||||
else
|
||||
aPath.start = p1;
|
||||
|
||||
aPath.current = p2;
|
||||
aPath.elements[aPath.count++] = { type:kCGPathElementAddArcToPoint, p1x:p1.x, p1y:p1.y, p2x:p2.x, p2y:p2.y, radius:aRadius };
|
||||
}
|
||||
@@ -144,23 +182,21 @@ function CGPathAddCurveToPoint(aPath, aTransform, cp1x, cp1y, cp2x, cp2y, x, y)
|
||||
end = _CGPointApplyAffineTransform(end, aTransform);
|
||||
}
|
||||
|
||||
aPath.current = end;
|
||||
aPath.elements[aPath.count++] = { type:kCGPathElementAddCurveToPoint, cp1x:cp1.x, cp1y:cp1.y, cp2x:cp2.x, cp2y:cp2.y, x:end.x, y:end.y };
|
||||
aPath.current = end;
|
||||
aPath.elements[aPath.count++] = { type:kCGPathElementAddCurveToPoint, cp1x:cp1.x, cp1y:cp1.y, cp2x:cp2.x, cp2y:cp2.y, x:end.x, y:end.y };
|
||||
}
|
||||
|
||||
function CGPathAddLines(aPath, aTransform, points, count)
|
||||
{
|
||||
var i = 1;
|
||||
if (count === null || count === undefined)
|
||||
count = points.length;
|
||||
|
||||
if (count === NULL)
|
||||
var count = points.length;
|
||||
|
||||
if (!aPath || count < 2)
|
||||
if (!aPath || count < 1)
|
||||
return;
|
||||
|
||||
CGPathMoveToPoint(aPath, aTransform, points[0].x, points[0].y);
|
||||
|
||||
for (; i < count; ++i)
|
||||
for (var i = 1; i < count; ++i)
|
||||
CGPathAddLineToPoint(aPath, aTransform, points[i].x, points[i].y);
|
||||
}
|
||||
|
||||
@@ -266,21 +302,23 @@ function CGPathAddRects(aPath, aTransform, rects, count)
|
||||
|
||||
function CGPathMoveToPoint(aPath, aTransform, x, y)
|
||||
{
|
||||
var point = _CGPointMake(x, y),
|
||||
count = aPath.count;
|
||||
var point = _CGPointMake(x, y);
|
||||
|
||||
if (aTransform != NULL)
|
||||
point = _CGPointApplyAffineTransform(point, aTransform);
|
||||
|
||||
aPath.start = point;
|
||||
aPath.current = point;
|
||||
aPath.start = aPath.current = point;
|
||||
|
||||
var previous = aPath.elements[count - 1];
|
||||
|
||||
if (count != 0 && previous.type == kCGPathElementMoveToPoint)
|
||||
// If the previous op was a move, just update that point
|
||||
if (aPath.count)
|
||||
{
|
||||
previous.x = point.x;
|
||||
previous.y = point.y;
|
||||
var previous = aPath.elements[count - 1];
|
||||
|
||||
if (previous.type === kCGPathElementMoveToPoint)
|
||||
{
|
||||
previous.x = point.x;
|
||||
previous.y = point.y;
|
||||
}
|
||||
}
|
||||
else
|
||||
aPath.elements[aPath.count++] = { type:kCGPathElementMoveToPoint, x:point.x, y:point.y };
|
||||
@@ -292,7 +330,7 @@ function CGPathWithEllipseInRect(aRect)
|
||||
{
|
||||
var path = CGPathCreateMutable();
|
||||
|
||||
if (_CGRectGetWidth(aRect) == _CGRectGetHeight(aRect))
|
||||
if (_CGRectGetWidth(aRect) === _CGRectGetHeight(aRect))
|
||||
CGPathAddArc(path, nil, _CGRectGetMidX(aRect), _CGRectGetMidY(aRect), _CGRectGetWidth(aRect) / 2.0, 0.0, 2 * PI, YES);
|
||||
else
|
||||
{
|
||||
@@ -364,15 +402,17 @@ function CGPathCloseSubpath(aPath)
|
||||
var count = aPath.count;
|
||||
|
||||
// Don't bother closing this subpath if there aren't any current elements, or the last element already closed the subpath.
|
||||
if (count == 0 || aPath.elements[count - 1].type == kCGPathElementCloseSubpath)
|
||||
if (count === 0 || aPath.elements[count - 1].type === kCGPathElementCloseSubpath)
|
||||
return;
|
||||
|
||||
// After closing, the current point is the previous path's starting point
|
||||
aPath.current = _CGPointCreateCopy(aPath.start);
|
||||
aPath.elements[aPath.count++] = { type:kCGPathElementCloseSubpath, points:[aPath.start] };
|
||||
}
|
||||
|
||||
function CGPathEqualToPath(aPath, anotherPath)
|
||||
{
|
||||
if (aPath == anotherPath)
|
||||
if (aPath === anotherPath)
|
||||
return YES;
|
||||
|
||||
if (aPath.count != anotherPath.count || !_CGPointEqualToPoint(aPath.start, anotherPath.start) || !_CGPointEqualToPoint(aPath.current, anotherPath.current))
|
||||
@@ -389,7 +429,7 @@ function CGPathEqualToPath(aPath, anotherPath)
|
||||
if (element.type != anotherElement.type)
|
||||
return NO;
|
||||
|
||||
if ((element.type == kCGPathElementAddArc || element.type == kCGPathElementAddArcToPoint) &&
|
||||
if ((element.type === kCGPathElementAddArc || element.type === kCGPathElementAddArcToPoint) &&
|
||||
element.radius != anotherElement.radius)
|
||||
return NO;
|
||||
|
||||
@@ -410,7 +450,7 @@ function CGPathGetCurrentPoint(aPath)
|
||||
|
||||
function CGPathIsEmpty(aPath)
|
||||
{
|
||||
return !aPath || aPath.count == 0;
|
||||
return !aPath || aPath.count === 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -440,7 +480,7 @@ function CGPathGetBoundingBox(aPath)
|
||||
var element = aPath.elements[i];
|
||||
|
||||
// Just enclose all the control points. The curves must be inside of the control points.
|
||||
// This won't work for CGPathGetPathBoundingBox.
|
||||
// This won't work for CGPathGetBoundingBox.
|
||||
switch (element.type)
|
||||
{
|
||||
case kCGPathElementAddLineToPoint:
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
var DOMFixedWidthSpanElement = nil,
|
||||
DOMFlexibleWidthSpanElement = nil,
|
||||
DOMMetricsDivElement = nil,
|
||||
DOMMetricsTextSpanElement = nil,
|
||||
DOMMetricsImgElement = nil,
|
||||
DefaultFont = nil;
|
||||
|
||||
@@ -98,24 +97,18 @@ var DOMFixedWidthSpanElement = nil,
|
||||
|
||||
DOMMetricsDivElement = document.createElement("div");
|
||||
DOMMetricsDivElement.className = "cpdontremove";
|
||||
DOMMetricsDivElement.style.position = "absolute";
|
||||
DOMMetricsDivElement.style.left = "-10000px";
|
||||
DOMMetricsDivElement.style.zIndex = -10000;
|
||||
DOMMetricsDivElement.style.width = "100000px";
|
||||
|
||||
bodyElement.appendChild(DOMMetricsDivElement);
|
||||
|
||||
DOMMetricsTextSpanElement = document.createElement("span");
|
||||
DOMMetricsTextSpanElement.className = "cpdontremove";
|
||||
DOMMetricsTextSpanElement.innerHTML = "x";
|
||||
style = DOMMetricsTextSpanElement.style;
|
||||
style = DOMMetricsDivElement.style;
|
||||
style.position = "absolute";
|
||||
style.left = "-10000px";
|
||||
style.zIndex = -10000;
|
||||
style.visibility = "visible";
|
||||
style.width = "100000px";
|
||||
style.whiteSpace = "nowrap";
|
||||
style.lineHeight = "1em";
|
||||
style.padding = "0px";
|
||||
style.margin = "0px";
|
||||
style.whiteSpace = "pre";
|
||||
DOMMetricsDivElement.innerHTML = "x";
|
||||
|
||||
bodyElement.appendChild(DOMMetricsDivElement);
|
||||
|
||||
var imgPath = [[CPBundle bundleForClass:[CPView class]] pathForResource:@"empty.png"];
|
||||
|
||||
@@ -126,8 +119,6 @@ var DOMFixedWidthSpanElement = nil,
|
||||
DOMMetricsImgElement.setAttribute("height", "1");
|
||||
DOMMetricsImgElement.setAttribute("alt", "");
|
||||
style = DOMMetricsImgElement.style;
|
||||
style.position = "absolute";
|
||||
style.left = "-10000px";
|
||||
style.zIndex = -10000;
|
||||
style.visibility = "visible";
|
||||
style.padding = "0px";
|
||||
@@ -135,7 +126,6 @@ var DOMFixedWidthSpanElement = nil,
|
||||
style.border = "none";
|
||||
style.verticalAlign = "baseline";
|
||||
|
||||
DOMMetricsDivElement.appendChild(DOMMetricsTextSpanElement);
|
||||
DOMMetricsDivElement.appendChild(DOMMetricsImgElement);
|
||||
}
|
||||
|
||||
@@ -171,9 +161,9 @@ var DOMFixedWidthSpanElement = nil,
|
||||
|
||||
DOMMetricsDivElement.style.font = [(aFont || DefaultFont) cssString];
|
||||
|
||||
var baseline = DOMMetricsImgElement.offsetTop - DOMMetricsTextSpanElement.offsetTop + DOMMetricsImgElement.offsetHeight,
|
||||
descender = baseline - DOMMetricsTextSpanElement.offsetHeight,
|
||||
lineHeight = DOMMetricsTextSpanElement.offsetHeight;
|
||||
var lineHeight = DOMMetricsDivElement.offsetHeight,
|
||||
baseline = DOMMetricsImgElement.offsetTop + DOMMetricsImgElement.offsetHeight,
|
||||
descender = baseline - lineHeight;
|
||||
|
||||
return [CPDictionary dictionaryWithObjectsAndKeys:baseline, @"ascender", descender, @"descender", lineHeight, @"lineHeight"];
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 89 B After Width: | Height: | Size: 89 B |
|
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 89 B After Width: | Height: | Size: 89 B |
|
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 75 B After Width: | Height: | Size: 78 B |
|
Before Width: | Height: | Size: 108 B After Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 133 B |
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 70 B |
|
Before Width: | Height: | Size: 76 B After Width: | Height: | Size: 77 B |
|
Before Width: | Height: | Size: 76 B After Width: | Height: | Size: 77 B |
|
Before Width: | Height: | Size: 77 B After Width: | Height: | Size: 80 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 133 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 145 B |
|
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 1.3 KiB |
@@ -556,7 +556,7 @@ var themedButtonValues = nil,
|
||||
[@"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-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],
|
||||
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateGroupRow]
|
||||
];
|
||||
@@ -1383,7 +1383,7 @@ var themedButtonValues = nil,
|
||||
suppressionButtonXOffset = 2.0,
|
||||
suppressionButtonYOffset = 10.0,
|
||||
suppressionButtonFont = [CPFont systemFontOfSize:CPFontCurrentSystemSize],
|
||||
warningIcon = PatternImage("alert-warning.png", 53.0, 46.0);
|
||||
warningIcon = PatternImage("alert-warning.png", 48.0, 43.0);
|
||||
|
||||
// Global
|
||||
themedAlertValues =
|
||||
@@ -2229,7 +2229,7 @@ var themedButtonValues = nil,
|
||||
[@"text-color", [CPColor colorWithCalibratedWhite:1.0 alpha:0.6], CPThemeStateDisabled],
|
||||
[@"text-shadow-color", [CPColor blackColor]],
|
||||
[@"text-shadow-color", [CPColor blackColor], CPThemeStateDisabled],
|
||||
[@"text-shadow-offset", CGSizeMake(-1.0, -1.0)]
|
||||
[@"text-shadow-offset", CGSizeMake(0, 1.0)]
|
||||
];
|
||||
|
||||
if (themeValues)
|
||||
|
||||
@@ -119,7 +119,7 @@ var documentLoaded = NO;
|
||||
|
||||
function afterDocumentLoad(/*Function*/ aFunction)
|
||||
{
|
||||
if (documentLoaded)
|
||||
if (documentLoaded || document.readyState === "complete")
|
||||
return aFunction();
|
||||
|
||||
if (window.addEventListener)
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1080</int>
|
||||
<string key="IBDocument.SystemVersion">12C60</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2844</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">625.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">2844</string>
|
||||
<string key="NS.object.0">3084</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSButton</string>
|
||||
@@ -44,7 +44,7 @@
|
||||
<object class="NSWindowTemplate" id="1056085528">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{71, 767}, {468, 425}}</string>
|
||||
<string key="NSWindowRect">{{71, 767}, {468, 455}}</string>
|
||||
<int key="NSWTFlags">1946157056</int>
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
@@ -57,7 +57,7 @@
|
||||
<object class="NSSlider" id="626349312">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">301</int>
|
||||
<string key="NSFrame">{{59, 52}, {96, 21}}</string>
|
||||
<string key="NSFrame">{{59, 53}, {96, 21}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="225469319"/>
|
||||
@@ -86,7 +86,7 @@
|
||||
<object class="NSTextField" id="225469319">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">301</int>
|
||||
<string key="NSFrame">{{166, 51}, {96, 22}}</string>
|
||||
<string key="NSFrame">{{166, 52}, {96, 22}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="393836098"/>
|
||||
@@ -127,7 +127,7 @@
|
||||
<object class="NSButton" id="917693159">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{381, 12}, {80, 32}}</string>
|
||||
<string key="NSFrame">{{381, 13}, {80, 32}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
@@ -152,7 +152,7 @@
|
||||
<object class="NSButton" id="503115995">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{14, 345}, {150, 32}}</string>
|
||||
<string key="NSFrame">{{14, 375}, {150, 32}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="368830815"/>
|
||||
@@ -177,7 +177,7 @@
|
||||
<object class="NSButton" id="368830815">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{14, 313}, {150, 32}}</string>
|
||||
<string key="NSFrame">{{14, 343}, {150, 32}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="223206700"/>
|
||||
@@ -202,7 +202,7 @@
|
||||
<object class="NSButton" id="666980504">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{14, 377}, {150, 32}}</string>
|
||||
<string key="NSFrame">{{14, 407}, {150, 32}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="503115995"/>
|
||||
@@ -227,10 +227,10 @@
|
||||
<object class="NSButton" id="223206700">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{14, 281}, {150, 32}}</string>
|
||||
<string key="NSFrame">{{14, 311}, {150, 32}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="531109111"/>
|
||||
<reference key="NSNextKeyView" ref="968632972"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="202127501">
|
||||
@@ -252,10 +252,10 @@
|
||||
<object class="NSButton" id="968632972">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{14, 249}, {150, 32}}</string>
|
||||
<string key="NSFrame">{{14, 279}, {150, 32}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="816373959"/>
|
||||
<reference key="NSNextKeyView" ref="531109111"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="895163260">
|
||||
@@ -277,7 +277,7 @@
|
||||
<object class="NSButton" id="821769865">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{234, 12}, {147, 32}}</string>
|
||||
<string key="NSFrame">{{234, 13}, {147, 32}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="917693159"/>
|
||||
@@ -302,7 +302,7 @@
|
||||
<object class="NSButton" id="244990043">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{14, 12}, {122, 32}}</string>
|
||||
<string key="NSFrame">{{14, 13}, {122, 32}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="821769865"/>
|
||||
@@ -327,7 +327,7 @@
|
||||
<object class="NSButton" id="133258452">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 186}, {329, 18}}</string>
|
||||
<string key="NSFrame">{{18, 187}, {329, 18}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="772963208"/>
|
||||
@@ -359,7 +359,7 @@
|
||||
<object class="NSButton" id="1070361803">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 130}, {329, 18}}</string>
|
||||
<string key="NSFrame">{{18, 131}, {329, 18}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="945251289"/>
|
||||
@@ -386,7 +386,7 @@
|
||||
<object class="NSButton" id="945251289">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 110}, {329, 18}}</string>
|
||||
<string key="NSFrame">{{18, 111}, {329, 18}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="671904505"/>
|
||||
@@ -413,7 +413,7 @@
|
||||
<object class="NSButton" id="671904505">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 90}, {329, 18}}</string>
|
||||
<string key="NSFrame">{{18, 91}, {329, 18}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="626349312"/>
|
||||
@@ -440,7 +440,7 @@
|
||||
<object class="NSButton" id="816373959">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{193, 268}, {174, 18}}</string>
|
||||
<string key="NSFrame">{{193, 278}, {174, 18}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="893839534"/>
|
||||
@@ -467,7 +467,7 @@
|
||||
<object class="NSButton" id="893839534">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{193, 248}, {174, 18}}</string>
|
||||
<string key="NSFrame">{{193, 258}, {174, 18}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="583986702"/>
|
||||
@@ -494,14 +494,14 @@
|
||||
<object class="NSMatrix" id="531109111">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{194, 292}, {261, 113}}</string>
|
||||
<string key="NSFrame">{{193, 299}, {261, 136}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="968632972"/>
|
||||
<reference key="NSNextKeyView" ref="816373959"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<int key="NSNumRows">5</int>
|
||||
<int key="NSNumRows">6</int>
|
||||
<int key="NSNumCols">1</int>
|
||||
<array class="NSMutableArray" key="NSCells">
|
||||
<object class="NSButtonCell" id="552182731">
|
||||
@@ -615,6 +615,19 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
</object>
|
||||
<object class="NSButtonCell" id="500370685">
|
||||
<int key="NSCellFlags">67108864</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">CIB HUD Window</string>
|
||||
<reference key="NSSupport" ref="394344788"/>
|
||||
<reference key="NSControlView" ref="531109111"/>
|
||||
<int key="NSTag">-1</int>
|
||||
<int key="NSButtonFlags">1211912448</int>
|
||||
<int key="NSButtonFlags2">0</int>
|
||||
<reference key="NSAlternateImage" ref="680600750"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSCellSize">{261, 21}</string>
|
||||
<string key="NSIntercellSpacing">{4, 2}</string>
|
||||
@@ -686,7 +699,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<object class="NSButton" id="583986702">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{192, 228}, {210, 18}}</string>
|
||||
<string key="NSFrame">{{192, 238}, {210, 18}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="132928531"/>
|
||||
@@ -713,7 +726,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<object class="NSButton" id="132928531">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{192, 208}, {180, 18}}</string>
|
||||
<string key="NSFrame">{{192, 218}, {180, 18}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="133258452"/>
|
||||
@@ -740,7 +753,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<object class="NSTextField" id="772963208">
|
||||
<reference key="NSNextResponder" ref="161598483"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{30, 154}, {368, 26}}</string>
|
||||
<string key="NSFrame">{{30, 155}, {368, 26}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1070361803"/>
|
||||
@@ -774,7 +787,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<set class="NSMutableSet" key="NSDragTypes">
|
||||
<string>NSStringPboardType</string>
|
||||
</set>
|
||||
<string key="NSFrame">{{275, 51}, {96, 22}}</string>
|
||||
<string key="NSFrame">{{275, 52}, {96, 22}}</string>
|
||||
<reference key="NSSuperview" ref="161598483"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="244990043"/>
|
||||
@@ -798,7 +811,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<int key="NSTokenFieldVersion">2</int>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{468, 425}</string>
|
||||
<string key="NSFrameSize">{468, 455}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="666980504"/>
|
||||
@@ -1048,7 +1061,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<reference ref="968632972"/>
|
||||
<reference ref="816373959"/>
|
||||
<reference ref="893839534"/>
|
||||
<reference ref="531109111"/>
|
||||
<reference ref="583986702"/>
|
||||
<reference ref="132928531"/>
|
||||
<reference ref="133258452"/>
|
||||
@@ -1062,6 +1074,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<reference ref="225469319"/>
|
||||
<reference ref="393836098"/>
|
||||
<reference ref="626349312"/>
|
||||
<reference ref="531109111"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1056085528"/>
|
||||
</object>
|
||||
@@ -1218,14 +1231,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<reference ref="569365394"/>
|
||||
<reference ref="755250605"/>
|
||||
<reference ref="830766462"/>
|
||||
<reference ref="500370685"/>
|
||||
</array>
|
||||
<reference key="parent" ref="161598483"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">170</int>
|
||||
<reference key="object" ref="510263560"/>
|
||||
<reference key="parent" ref="531109111"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">171</int>
|
||||
<reference key="object" ref="552182731"/>
|
||||
@@ -1381,6 +1390,16 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<reference key="object" ref="437001198"/>
|
||||
<reference key="parent" ref="393836098"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">227</int>
|
||||
<reference key="object" ref="500370685"/>
|
||||
<reference key="parent" ref="531109111"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">170</int>
|
||||
<reference key="object" ref="510263560"/>
|
||||
<reference key="parent" ref="531109111"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -1431,6 +1450,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<string key="221.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="224.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="225.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="227.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="25.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1447,7 +1467,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">226</int>
|
||||
<int key="maxID">228</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
|
||||
@implementation SheetWindowController : CPWindowController
|
||||
{
|
||||
@outlet CPButton _closeButton;
|
||||
@outlet CPButton _sheetWindowHackCheckbox;
|
||||
@outlet CPButton _altCloseButton;
|
||||
@outlet CPButton _otherCloseButton;
|
||||
@outlet CPButton _orderOutAfterCheckbox;
|
||||
@outlet CPRadioGroup _windowTypeMatrix;
|
||||
@outlet CPButton _titledMaskButton;
|
||||
@outlet CPButton _closableMaskButton;
|
||||
@outlet CPButton _miniaturizableMaskButton;
|
||||
@outlet CPButton _resizableMaskButton;
|
||||
@outlet CPButton _shadeWindowView;
|
||||
@outlet CPButton _shadeContentView;
|
||||
@outlet CPButton _shadeParentWindow;
|
||||
@outlet CPButton _closeButton;
|
||||
@outlet CPButton _sheetWindowHackCheckbox;
|
||||
@outlet CPButton _altCloseButton;
|
||||
@outlet CPButton _otherCloseButton;
|
||||
@outlet CPButton _orderOutAfterCheckbox;
|
||||
@outlet CPRadioGroup _windowTypeMatrix;
|
||||
@outlet CPButton _titledMaskButton;
|
||||
@outlet CPButton _closableMaskButton;
|
||||
@outlet CPButton _miniaturizableMaskButton;
|
||||
@outlet CPButton _resizableMaskButton;
|
||||
@outlet CPButton _shadeWindowView;
|
||||
@outlet CPButton _shadeContentView;
|
||||
@outlet CPButton _shadeParentWindow;
|
||||
|
||||
CPModalSession _modalSession;
|
||||
CPWindow _parentWindow;
|
||||
CPWindow _sheet;
|
||||
int _returnCode;
|
||||
CPColor _savedColor;
|
||||
CPModalSession _modalSession;
|
||||
CPWindow _parentWindow;
|
||||
CPWindow _sheet;
|
||||
int _returnCode;
|
||||
CPColor _savedColor;
|
||||
|
||||
BOOL _hud;
|
||||
}
|
||||
|
||||
- (void)initWithWindowCibName:(CPString)cibName
|
||||
@@ -60,6 +62,19 @@
|
||||
[_altCloseButton setAction:@selector(unsetAction:)];
|
||||
[_otherCloseButton setTarget:self];
|
||||
[_otherCloseButton setAction:@selector(unsetAction:)];
|
||||
|
||||
if (_hud)
|
||||
{
|
||||
var theWindow = [self window],
|
||||
contentView = [theWindow contentView],
|
||||
hudWindow = [[CPWindow alloc] initWithContentRect:[contentView bounds] styleMask:[theWindow styleMask] | CPHUDBackgroundWindowMask];
|
||||
[theWindow orderOut:nil];
|
||||
[hudWindow setFrame:[theWindow frame]];
|
||||
[hudWindow setContentView:contentView];
|
||||
[hudWindow orderFront:nil];
|
||||
[self setWindow:hudWindow];
|
||||
[contentView _setThemeIncludingDescendants:[CPTheme defaultHudTheme]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)unsetAction:(id)sender
|
||||
@@ -100,12 +115,17 @@
|
||||
[_otherCloseButton setTarget:self];
|
||||
[_otherCloseButton setAction:unsetAction];
|
||||
[[aWindow contentView] addSubview:_otherCloseButton positioned:CPWindowAbove relativeTo:nil];
|
||||
|
||||
if ([aWindow styleMask] & CPHUDBackgroundWindowMask)
|
||||
[[_closeButton, _altCloseButton, _otherCloseButton] makeObjectsPerformSelector:@selector(setTheme:) withObject:[CPTheme defaultHudTheme]];
|
||||
}
|
||||
|
||||
- (SheetWindowController)initWithStyleMask:(int)styleMask debug:(int)debug
|
||||
- (SheetWindowController)initWithStyleMask:(int)styleMask debug:(int)debug hud:(BOOL)shouldBeHud
|
||||
{
|
||||
CPLog.debug("[%@ %@] mask=%d radioGroup=%@", [self class], _cmd, styleMask, _windowTypeMatrix);
|
||||
|
||||
_hud = shouldBeHud;
|
||||
|
||||
if (styleMask < 0)
|
||||
return [self initWithWindowCibName:@"Window"];
|
||||
|
||||
@@ -162,7 +182,7 @@
|
||||
if ([_resizableMaskButton state])
|
||||
styleMask |= CPResizableWindowMask;
|
||||
|
||||
if (type == 1)
|
||||
if (type == 1 || type == -1)
|
||||
styleMask = -1;
|
||||
|
||||
var debug = 0;
|
||||
@@ -172,7 +192,9 @@
|
||||
if ([_shadeContentView state])
|
||||
debug |= 2;
|
||||
|
||||
return [[SheetWindowController alloc] initWithStyleMask:styleMask debug:debug];
|
||||
var hud = type === -1;
|
||||
|
||||
return [[SheetWindowController alloc] initWithStyleMask:styleMask debug:debug hud:hud];
|
||||
}
|
||||
|
||||
- (SheetWindowController)allocWithPanel:(CPPanel)panel
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* NewApplication
|
||||
*
|
||||
* Created by You on November 16, 2011.
|
||||
* Copyright 2011, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
|
||||
@implementation DiamondView : CPView
|
||||
{
|
||||
}
|
||||
|
||||
- (void)drawRect:(CGRect)aRect
|
||||
{
|
||||
[super drawRect:aRect];
|
||||
|
||||
var points = [CPArray array];
|
||||
var minX = CGRectGetMinX(aRect);
|
||||
var midX = CGRectGetMidX(aRect);
|
||||
var maxX = CGRectGetMaxX(aRect);
|
||||
var minY = CGRectGetMinY(aRect);
|
||||
var midY = CGRectGetMidY(aRect);
|
||||
var maxY = CGRectGetMaxY(aRect);
|
||||
var quarterX = minX + (maxX - minX)/4;
|
||||
[points addObject:CGPointMake(midX, minY)];
|
||||
[points addObject:CGPointMake(maxX, midY)];
|
||||
[points addObject:CGPointMake(midX, maxY)];
|
||||
[points addObject:CGPointMake(minX, midY)];
|
||||
[points addObject:CGPointMake(midX, minY)];
|
||||
|
||||
[self lockFocus];
|
||||
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort];
|
||||
CGContextSetLineWidth(context, 2);
|
||||
CGContextSetStrokeColor(context, [CPColor blueColor]);
|
||||
|
||||
// test CGContextAddLines
|
||||
CGContextBeginPath(context);
|
||||
CGContextAddLines(context, points, NULL);
|
||||
|
||||
// test CGContextAddQuadCurveToPoint
|
||||
CGContextAddQuadCurveToPoint(context, quarterX, midY, midX, maxY);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
// test CGContextStrokeRectWithWidth
|
||||
var innerRect = CGRectInset(aRect, CGRectGetWidth(aRect)/2 - 10, CGRectGetHeight(aRect)/2 - 10);
|
||||
CGContextStrokeRectWithWidth(context, innerRect, 4);
|
||||
|
||||
[self unlockFocus];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
|
||||
contentView = [theWindow contentView];
|
||||
|
||||
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
|
||||
|
||||
[label setStringValue:@"Hello World!"];
|
||||
[label setFont:[CPFont boldSystemFontOfSize:24.0]];
|
||||
|
||||
[label sizeToFit];
|
||||
|
||||
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
|
||||
[label setCenter:[contentView center]];
|
||||
|
||||
[contentView addSubview:label];
|
||||
[contentView addSubview:[[DiamondView alloc] initWithFrame:CGRectMake(100, 100, 200, 200)]];
|
||||
|
||||
[theWindow orderFront:self];
|
||||
|
||||
// Uncomment the following line to turn on the standard menu bar.
|
||||
//[CPMenu setMenuBarVisible:YES];
|
||||
}
|
||||
|
||||
@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>cgcanvascontext</string>
|
||||
<key>CPPrincipalClass</key>
|
||||
<string>CPApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* cgcanvascontext
|
||||
*
|
||||
* Created by You on February 19, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
JAKE = require("jake"),
|
||||
task = JAKE.task,
|
||||
FileList = JAKE.FileList,
|
||||
app = require("cappuccino/jake").app,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
||||
OS = require("os");
|
||||
|
||||
app ("cgcanvascontext", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "cgcanvascontext.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("cgcanvascontext");
|
||||
task.setIdentifier("com.yourcompany.cgcanvascontext");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("cgcanvascontext");
|
||||
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", ["cgcanvascontext"], 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", "cgcanvascontext", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "cgcanvascontext", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "cgcanvascontext"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "cgcanvascontext"), FILE.join("Build", "Deployment", "cgcanvascontext")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", "cgcanvascontext"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "cgcanvascontext"), FILE.join("Build", "Desktop", "cgcanvascontext", "cgcanvascontext.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", "cgcanvascontext", "cgcanvascontext.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "cgcanvascontext"));
|
||||
print("----------------------------");
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,107 @@
|
||||
<!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
|
||||
cgcanvascontext
|
||||
|
||||
Created by You on February 19, 2013.
|
||||
Copyright 2013, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||
|
||||
<title>cgcanvascontext</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);
|
||||
|
||||
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
|
||||
// the class name of the view that created them. Comment this or set to false to disable.
|
||||
appkit_tag_dom_elements = true;
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading cgcanvascontext...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,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
|
||||
cgcanvascontext
|
||||
|
||||
Created by You on February 19, 2013.
|
||||
Copyright 2013, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||
|
||||
<title>cgcanvascontext</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 cgcanvascontext...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* cgcanvascontext
|
||||
*
|
||||
* Created by You on February 19, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -15,12 +15,12 @@ function formatter(aString, aLevel, aTitle)
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
|
||||
CPView simpleColor;
|
||||
CPView patternColor;
|
||||
CPView threePartColor;
|
||||
CPView ninePartColor;
|
||||
CPImage imageView;
|
||||
@outlet CPWindow theWindow; //this "outlet" is connected automatically by the Cib
|
||||
@outlet CPView simpleColor;
|
||||
@outlet CPView patternColor;
|
||||
@outlet CPView threePartColor;
|
||||
@outlet CPView ninePartColor;
|
||||
@outlet CPImageView imageView;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
@@ -48,25 +48,27 @@ function formatter(aString, aLevel, aTitle)
|
||||
var bundle = [CPBundle bundleForClass:[CPView class]];
|
||||
|
||||
color = CPColorWithImages([
|
||||
["Aristo2.blend/Resources/button-bezel-left.png", 4, 24, bundle],
|
||||
["Aristo2.blend/Resources/button-bezel-center.png", 1, 24, bundle],
|
||||
["Aristo2.blend/Resources/button-bezel-right.png", 4, 24, bundle]
|
||||
["Aristo2.blend/Resources/button-bezel-left.png", 4, 25, bundle],
|
||||
["Aristo2.blend/Resources/button-bezel-center.png", 1, 25, bundle],
|
||||
["Aristo2.blend/Resources/button-bezel-right.png", 4, 25, bundle]
|
||||
]);
|
||||
|
||||
CPLog([color description]);
|
||||
|
||||
[threePartColor setBackgroundColor:color];
|
||||
|
||||
color = CPColorWithImages([
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-0.png", 7, 7, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-1.png", 1, 7, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-2.png", 7, 7, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-3.png", 7, 1, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-0.png", 4, 4, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-1.png", 1, 4, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-2.png", 4, 4, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-3.png", 4, 1, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-4.png", 1, 1, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-5.png", 7, 1, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-6.png", 7, 7, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-7.png", 1, 7, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-8.png", 7, 7, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-5.png", 4, 1, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-6.png", 4, 4, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-7.png", 1, 4, bundle],
|
||||
["Aristo2.blend/Resources/textfield-bezel-square-focused-8.png", 4, 4, bundle],
|
||||
]);
|
||||
|
||||
CPLog([color description]);
|
||||
|
||||
[ninePartColor setBackgroundColor:color];
|
||||
|
||||
@@ -2,17 +2,24 @@
|
||||
<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>
|
||||
<string key="IBDocument.SystemVersion">12C3012</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">625.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>
|
||||
<string key="NS.object.0">3084</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="372"/>
|
||||
<string>NSCustomObject</string>
|
||||
<string>NSCustomView</string>
|
||||
<string>NSImageCell</string>
|
||||
<string>NSImageView</string>
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSView</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -41,7 +48,7 @@
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="439893737">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
@@ -52,6 +59,7 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{151, 297}, {159, 36}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSTextField" id="385245898">
|
||||
@@ -59,9 +67,10 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{47, 307}, {82, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="12386750">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Simple color</string>
|
||||
<object class="NSFont" key="NSSupport" id="710279137">
|
||||
@@ -89,12 +98,14 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</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"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSTextField" id="179895693">
|
||||
@@ -102,9 +113,10 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{47, 253}, {85, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="222300836">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Pattern color</string>
|
||||
<reference key="NSSupport" ref="710279137"/>
|
||||
@@ -112,12 +124,14 @@
|
||||
<reference key="NSBackgroundColor" ref="616930867"/>
|
||||
<reference key="NSTextColor" ref="968014435"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</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"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSTextField" id="63869060">
|
||||
@@ -125,9 +139,10 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{47, 196}, {85, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="828490958">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">3-part color</string>
|
||||
<reference key="NSSupport" ref="710279137"/>
|
||||
@@ -135,12 +150,14 @@
|
||||
<reference key="NSBackgroundColor" ref="616930867"/>
|
||||
<reference key="NSTextColor" ref="968014435"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</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"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSTextField" id="488609560">
|
||||
@@ -148,9 +165,10 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{47, 140}, {85, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="548167261">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">9-part color</string>
|
||||
<reference key="NSSupport" ref="710279137"/>
|
||||
@@ -158,15 +176,17 @@
|
||||
<reference key="NSBackgroundColor" ref="616930867"/>
|
||||
<reference key="NSTextColor" ref="968014435"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</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"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="30856995">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Image</string>
|
||||
<reference key="NSSupport" ref="710279137"/>
|
||||
@@ -174,6 +194,7 @@
|
||||
<reference key="NSBackgroundColor" ref="616930867"/>
|
||||
<reference key="NSTextColor" ref="968014435"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSImageView" id="276994718">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
@@ -192,23 +213,27 @@
|
||||
</object>
|
||||
<string key="NSFrame">{{148, 68}, {48, 48}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSImageCell" key="NSCell" id="334634827">
|
||||
<int key="NSCellFlags">130560</int>
|
||||
<int key="NSCellFlags">134217728</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="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<bool key="NSEditable">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{389, 380}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="635946545">
|
||||
<string key="NSClassName">AppController</string>
|
||||
@@ -225,29 +250,13 @@
|
||||
</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>
|
||||
<int key="connectionID">491</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
@@ -255,7 +264,7 @@
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="605260233"/>
|
||||
</object>
|
||||
<int key="connectionID">482</int>
|
||||
<int key="connectionID">492</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
@@ -263,7 +272,23 @@
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="1066696903"/>
|
||||
</object>
|
||||
<int key="connectionID">483</int>
|
||||
<int key="connectionID">493</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">494</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">495</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
@@ -271,7 +296,7 @@
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="276994718"/>
|
||||
</object>
|
||||
<int key="connectionID">490</int>
|
||||
<int key="connectionID">496</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
@@ -445,92 +470,54 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<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>450.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">
|
||||
<object class="NSArray" 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>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<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>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -539,35 +526,81 @@
|
||||
<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>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</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>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">490</int>
|
||||
<int key="maxID">496</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>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">theWindow</string>
|
||||
<string key="NS.object.0">NSWindow</string>
|
||||
<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>theWindow</string>
|
||||
<string>threePartColor</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSImageView</string>
|
||||
<string>NSView</string>
|
||||
<string>NSView</string>
|
||||
<string>NSView</string>
|
||||
<string>NSWindow</string>
|
||||
<string>NSView</string>
|
||||
</object>
|
||||
</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>
|
||||
<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>theWindow</string>
|
||||
<string>threePartColor</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">imageView</string>
|
||||
<string key="candidateClassName">NSImageView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">ninePartColor</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">patternColor</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">simpleColor</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">theWindow</string>
|
||||
<string key="candidateClassName">NSWindow</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">threePartColor</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
@@ -575,66 +608,6 @@
|
||||
<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>
|
||||
@@ -648,7 +621,6 @@
|
||||
<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>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPRadioBindings
|
||||
*
|
||||
* Created by You on February 22, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow;
|
||||
@outlet CPRadioGroup radios @accessors;
|
||||
CPString title @accessors;
|
||||
int index @accessors;
|
||||
int tag @accessors;
|
||||
BOOL enabled @accessors;
|
||||
BOOL visible @accessors;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
[self setTitle:@"Two"];
|
||||
[self setIndex:2];
|
||||
[self setTag:13];
|
||||
[self setEnabled:YES];
|
||||
[self setVisible:YES];
|
||||
}
|
||||
|
||||
- (@action)deselectAll:(id)sender
|
||||
{
|
||||
[radios selectRadioAtIndex:-1];
|
||||
}
|
||||
|
||||
@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>CPRadioBindings</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CPRadioBindings
|
||||
*
|
||||
* Created by You on February 22, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
JAKE = require("jake"),
|
||||
task = JAKE.task,
|
||||
FileList = JAKE.FileList,
|
||||
app = require("cappuccino/jake").app,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
||||
OS = require("os");
|
||||
|
||||
app ("CPRadioBindings", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CPRadioBindings.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CPRadioBindings");
|
||||
task.setIdentifier("com.yourcompany.CPRadioBindings");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CPRadioBindings");
|
||||
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", ["CPRadioBindings"], 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", "CPRadioBindings", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "CPRadioBindings", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "CPRadioBindings"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "CPRadioBindings"), FILE.join("Build", "Deployment", "CPRadioBindings")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", "CPRadioBindings"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPRadioBindings"), FILE.join("Build", "Desktop", "CPRadioBindings", "CPRadioBindings.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", "CPRadioBindings", "CPRadioBindings.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPRadioBindings"));
|
||||
print("----------------------------");
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
CPRadioBindings
|
||||
|
||||
Created by You on February 22, 2013.
|
||||
Copyright 2013, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>CPRadioBindings</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
objj_msgSend_reset();
|
||||
|
||||
// DEBUG OPTIONS:
|
||||
|
||||
// Uncomment to enable printing of backtraces on exceptions:
|
||||
//objj_msgSend_decorate(objj_backtrace_decorator);
|
||||
|
||||
// Uncomment to supress exceptions that take place inside a message
|
||||
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
|
||||
|
||||
// Uncomment to enable runtime type checking:
|
||||
//objj_msgSend_decorate(objj_typecheck_decorator);
|
||||
|
||||
// Uncomment (along with both above) to print backtraces on type check errors:
|
||||
//objj_typecheck_prints_backtrace = true;
|
||||
|
||||
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
|
||||
//CPLogUnregister(CPLogDefault);
|
||||
|
||||
// Uncomment to enable a specific logger:
|
||||
//CPLogRegister(CPLogConsole);
|
||||
//CPLogRegister(CPLogPopup);
|
||||
|
||||
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
|
||||
// the class name of the view that created them. Comment this or set to false to disable.
|
||||
appkit_tag_dom_elements = true;
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPRadioBindings...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index.html
|
||||
CPRadioBindings
|
||||
|
||||
Created by You on February 22, 2013.
|
||||
Copyright 2013, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>CPRadioBindings</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 CPRadioBindings...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPRadioBindings
|
||||
*
|
||||
* Created by You on February 22, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -175,6 +175,7 @@ var SharedAppController = nil;
|
||||
float textTop;
|
||||
float ascender;
|
||||
float descender;
|
||||
float lineHeight;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
@@ -205,7 +206,7 @@ var SharedAppController = nil;
|
||||
if (ascender === 0)
|
||||
return;
|
||||
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort];
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort],
|
||||
bounds = [self bounds],
|
||||
minX = CGRectGetMinX(bounds),
|
||||
maxX = CGRectGetMaxX(bounds);
|
||||
|
||||
@@ -1,28 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1070</int>
|
||||
<string key="IBDocument.SystemVersion">11E53</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.47</string>
|
||||
<string key="IBDocument.HIToolboxVersion">569.00</string>
|
||||
<int key="IBDocument.SystemTarget">1080</int>
|
||||
<string key="IBDocument.SystemVersion">12C3012</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">625.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">2182</string>
|
||||
<string key="NS.object.0">3084</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSPopUpButton</string>
|
||||
<string>NSMenuItem</string>
|
||||
<string>NSMenu</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSSlider</string>
|
||||
<string>NSSliderCell</string>
|
||||
<string>NSBox</string>
|
||||
<string>NSCustomObject</string>
|
||||
<string>NSCustomView</string>
|
||||
<string>NSMenu</string>
|
||||
<string>NSMenuItem</string>
|
||||
<string>NSPopUpButton</string>
|
||||
<string>NSPopUpButtonCell</string>
|
||||
<string>NSSlider</string>
|
||||
<string>NSSliderCell</string>
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSView</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
<string>NSTextField</string>
|
||||
<string>NSPopUpButtonCell</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -44,8 +45,8 @@
|
||||
<object class="NSWindowTemplate" id="972006081">
|
||||
<int key="NSWindowStyleMask">7</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{408, 675}, {332, 290}}</string>
|
||||
<int key="NSWTFlags">1946157056</int>
|
||||
<string key="NSWindowRect">{{155, 483}, {332, 262}}</string>
|
||||
<int key="NSWTFlags">1948778496</int>
|
||||
<string key="NSWindowTitle">Font Metrics Explorer</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
@@ -57,13 +58,13 @@
|
||||
<object class="NSPopUpButton" id="999404096">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{54, 206}, {243, 26}}</string>
|
||||
<string key="NSFrame">{{54, 218}, {243, 26}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="908680470"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSPopUpButtonCell" key="NSCell" id="443809738">
|
||||
<int key="NSCellFlags">-2076049856</int>
|
||||
<int key="NSCellFlags">-2076180416</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<object class="NSFont" key="NSSupport" id="138691916">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
@@ -71,7 +72,7 @@
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="999404096"/>
|
||||
<int key="NSButtonFlags">109199615</int>
|
||||
<int key="NSButtonFlags">109199360</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
@@ -108,17 +109,18 @@
|
||||
<bool key="NSAltersState">YES</bool>
|
||||
<int key="NSArrowPosition">2</int>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="1039897555">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{19, 210}, {38, 17}}</string>
|
||||
<string key="NSFrame">{{19, 223}, {38, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="999404096"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="239508957">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Font:</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -142,17 +144,18 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="246524262">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{19, 80}, {67, 17}}</string>
|
||||
<string key="NSFrame">{{19, 104}, {67, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="725348302"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="994899642">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Ascender:</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -160,17 +163,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="725348302">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{99, 80}, {35, 17}}</string>
|
||||
<string key="NSFrame">{{99, 104}, {35, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="823167139"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="364967556">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">4195328</int>
|
||||
<string key="NSContents">0</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -178,17 +182,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="730682452">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{99, 55}, {35, 17}}</string>
|
||||
<string key="NSFrame">{{99, 79}, {35, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="417280360"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="264413839">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">4195328</int>
|
||||
<string key="NSContents">0</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -196,17 +201,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="380300553">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{99, 30}, {35, 17}}</string>
|
||||
<string key="NSFrame">{{99, 54}, {35, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="605512847"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="755927601">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">4195328</int>
|
||||
<string key="NSContents">0</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -214,17 +220,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="823167139">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{19, 55}, {75, 17}}</string>
|
||||
<string key="NSFrame">{{19, 79}, {75, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="730682452"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="223373694">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Descender:</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -232,17 +239,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="417280360">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{19, 30}, {80, 17}}</string>
|
||||
<string key="NSFrame">{{19, 54}, {80, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="380300553"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="617236685">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Line Height:</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -250,17 +258,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="553841872">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{146, 16}, {167, 14}}</string>
|
||||
<string key="NSFrame">{{146, 20}, {167, 14}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="508133354">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">138544128</int>
|
||||
<string key="NSContents">Click grid to change text</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
@@ -272,57 +281,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="138531732">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 250}, {72, 22}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1039897555"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="297713421">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Font</string>
|
||||
<object class="NSFont" key="NSSupport" id="123242968">
|
||||
<string key="NSName">LucidaGrande-Bold</string>
|
||||
<double key="NSSize">18</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="138531732"/>
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="411217540">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 115}, {72, 22}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="246524262"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="588810411">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Metrics</string>
|
||||
<reference key="NSSupport" ref="123242968"/>
|
||||
<reference key="NSControlView" ref="411217540"/>
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="908680470">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{19, 173}, {38, 17}}</string>
|
||||
<string key="NSFrame">{{19, 186}, {38, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="42125743"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="938349708">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Size:</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -330,17 +300,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="803856037">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{282, 173}, {31, 17}}</string>
|
||||
<string key="NSFrame">{{282, 186}, {31, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="411217540"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="1067054775">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">12</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
@@ -348,17 +319,18 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSSlider" id="42125743">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{57, 174}, {214, 21}}</string>
|
||||
<string key="NSFrame">{{57, 184}, {214, 21}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="803856037"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSSliderCell" key="NSCell" id="275925957">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags">-2080112384</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents"/>
|
||||
<reference key="NSControlView" ref="42125743"/>
|
||||
@@ -371,6 +343,7 @@
|
||||
<bool key="NSAllowsTickMarkValuesOnly">NO</bool>
|
||||
<bool key="NSVertical">NO</bool>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSCustomView" id="605512847">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
@@ -385,7 +358,7 @@
|
||||
<reference key="NSNextKeyView" ref="1067943843"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="331121288">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags">68157504</int>
|
||||
<int key="NSCellFlags2">138413056</int>
|
||||
<string key="NSContents">log</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
@@ -397,9 +370,10 @@
|
||||
<reference key="NSBackgroundColor" ref="44883150"/>
|
||||
<reference key="NSTextColor" ref="618459948"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{149, 35}, {163, 100}}</string>
|
||||
<string key="NSFrame">{{149, 39}, {163, 100}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="654402926"/>
|
||||
@@ -408,19 +382,51 @@
|
||||
<object class="NSCustomView" id="1067943843">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{149, 35}, {163, 100}}</string>
|
||||
<string key="NSFrame">{{149, 39}, {163, 100}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="553841872"/>
|
||||
<string key="NSClassName">BaselineView</string>
|
||||
</object>
|
||||
<object class="NSBox" id="383729043">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">12</int>
|
||||
<string key="NSFrame">{{20, 159}, {292, 5}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<string key="NSOffsets">{0, 0}</string>
|
||||
<object class="NSTextFieldCell" key="NSTitleCell">
|
||||
<int key="NSCellFlags">67108864</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Box</string>
|
||||
<reference key="NSSupport" ref="138691916"/>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">textBackgroundColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MCAwLjgwMDAwMDAxMTkAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<int key="NSBorderType">3</int>
|
||||
<int key="NSBoxType">2</int>
|
||||
<int key="NSTitlePosition">0</int>
|
||||
<bool key="NSTransparent">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{332, 290}</string>
|
||||
<string key="NSFrameSize">{332, 262}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="138531732"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
@@ -573,22 +579,21 @@
|
||||
<int key="objectID">372</int>
|
||||
<reference key="object" ref="439893737"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="803856037"/>
|
||||
<reference ref="999404096"/>
|
||||
<reference ref="1039897555"/>
|
||||
<reference ref="908680470"/>
|
||||
<reference ref="803856037"/>
|
||||
<reference ref="42125743"/>
|
||||
<reference ref="383729043"/>
|
||||
<reference ref="246524262"/>
|
||||
<reference ref="725348302"/>
|
||||
<reference ref="730682452"/>
|
||||
<reference ref="380300553"/>
|
||||
<reference ref="823167139"/>
|
||||
<reference ref="417280360"/>
|
||||
<reference ref="138531732"/>
|
||||
<reference ref="411217540"/>
|
||||
<reference ref="908680470"/>
|
||||
<reference ref="42125743"/>
|
||||
<reference ref="1067943843"/>
|
||||
<reference ref="605512847"/>
|
||||
<reference ref="553841872"/>
|
||||
<reference ref="605512847"/>
|
||||
<reference ref="1067943843"/>
|
||||
</array>
|
||||
<reference key="parent" ref="972006081"/>
|
||||
</object>
|
||||
@@ -678,32 +683,6 @@
|
||||
<reference key="object" ref="1067054775"/>
|
||||
<reference key="parent" ref="803856037"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1069</int>
|
||||
<reference key="object" ref="138531732"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="297713421"/>
|
||||
</array>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1070</int>
|
||||
<reference key="object" ref="297713421"/>
|
||||
<reference key="parent" ref="138531732"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1071</int>
|
||||
<reference key="object" ref="411217540"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="588810411"/>
|
||||
</array>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1072</int>
|
||||
<reference key="object" ref="588810411"/>
|
||||
<reference key="parent" ref="411217540"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1073</int>
|
||||
<reference key="object" ref="246524262"/>
|
||||
@@ -821,6 +800,11 @@
|
||||
<reference key="object" ref="508133354"/>
|
||||
<reference key="parent" ref="553841872"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1112</int>
|
||||
<reference key="object" ref="383729043"/>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -839,10 +823,6 @@
|
||||
<string key="1060.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1061.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1062.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1069.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1070.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1071.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1072.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1073.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1074.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1075.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -861,6 +841,9 @@
|
||||
<string key="1106.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1110.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1111.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1112.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="371.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
<boolean value="NO" key="371.IBNSWindowAutoPositionCentersVertical"/>
|
||||
<string key="371.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="371.IBWindowTemplateEditedContentRect">{{884, 511}, {332, 290}}</string>
|
||||
<integer value="1" key="371.NSWindowTemplate.visibleAtLaunch"/>
|
||||
@@ -871,7 +854,7 @@
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">1111</int>
|
||||
<int key="maxID">1112</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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">
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
TableCibTest
|
||||
@@ -11,13 +8,28 @@
|
||||
Copyright 2009, 280 North, Inc. All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>Font Metrics Explorer</title>
|
||||
|
||||
<script type = "text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
|
||||
</script>
|
||||
|
||||
<script src = "Frameworks/Debug/Objective-J/Objective-J.js" type = "text/javascript"></script>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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">
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index.html
|
||||
TableCibTest
|
||||
@@ -11,7 +8,22 @@
|
||||
Copyright 2009, 280 North, Inc. All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>Font Metrics Explorer</title>
|
||||
|
||||
|
||||
@@ -67,6 +67,24 @@
|
||||
informativeTextWithFormat:nil] runModal];
|
||||
}
|
||||
|
||||
- (void)sayHello
|
||||
{
|
||||
[[CPAlert alertWithMessageText:@"Hello!"
|
||||
defaultButton:@"OK"
|
||||
alternateButton:nil
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:nil] runModal];
|
||||
}
|
||||
|
||||
- (void)showHelp
|
||||
{
|
||||
[[CPAlert alertWithMessageText:@"So you want some help?"
|
||||
defaultButton:@"Help!"
|
||||
alternateButton:nil
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:nil] runModal];
|
||||
}
|
||||
|
||||
- (void)setNow
|
||||
{
|
||||
var now = [CPDate date];
|
||||
|
||||
@@ -1354,7 +1354,7 @@
|
||||
<string key="NSFrame">{{380, 88}, {205, 14}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="681004576"/>
|
||||
<reference key="NSNextKeyView" ref="631249643"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="77038898">
|
||||
@@ -1461,10 +1461,10 @@ IGNvbG9yIGNoYW5nZSBjaGVja2VkA</string>
|
||||
<object class="NSTextField" id="631249643">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{36, 83}, {221, 34}}</string>
|
||||
<string key="NSFrame">{{36, 43}, {221, 34}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="332508083"/>
|
||||
<reference key="NSNextKeyView" ref="681004576"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="364356646">
|
||||
@@ -1526,6 +1526,31 @@ cjIgPT0gMA</string>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSButton" id="639407082">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{21, 213}, {132, 32}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="658171732"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="877645627">
|
||||
<int key="NSCellFlags">67108864</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Action no args</string>
|
||||
<reference key="NSSupport" ref="441663663"/>
|
||||
<string key="NSCellIdentifier">_NS:9</string>
|
||||
<reference key="NSControlView" ref="639407082"/>
|
||||
<int key="NSButtonFlags">-2038284288</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSButton" id="439651256">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
@@ -1574,7 +1599,7 @@ cjIgPT0gMA</string>
|
||||
<string key="NSFrame">{{15, 27}, {191, 34}}</string>
|
||||
<reference key="NSSuperview" ref="756478285"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="658171732"/>
|
||||
<reference key="NSNextKeyView" ref="41538496"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="555235322">
|
||||
@@ -1597,7 +1622,7 @@ cjIgPT0gMA</string>
|
||||
<string key="NSReuseIdentifierKey">_NS:11</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{26, 139}, {259, 101}}</string>
|
||||
<string key="NSFrame">{{26, 99}, {259, 101}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="756478285"/>
|
||||
@@ -1922,7 +1947,7 @@ cjIgPT0gMA</string>
|
||||
<string key="NSFrame">{{373, 283}, {345, 17}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="24124202"/>
|
||||
<reference key="NSNextKeyView" ref="639407082"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="802100270">
|
||||
@@ -1943,7 +1968,7 @@ cjIgPT0gMA</string>
|
||||
<string key="NSFrame">{{375, 234}, {142, 18}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="41538496"/>
|
||||
<reference key="NSNextKeyView" ref="24124202"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="1049552921">
|
||||
@@ -1970,7 +1995,7 @@ cjIgPT0gMA</string>
|
||||
<string key="NSFrame">{{530, 134}, {75, 18}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="631249643"/>
|
||||
<reference key="NSNextKeyView" ref="332508083"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="207629173">
|
||||
@@ -2126,10 +2151,10 @@ cjIgPT0gMA</string>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">orderFrontStandardAboutPanel:</string>
|
||||
<reference key="source" ref="1021"/>
|
||||
<reference key="source" ref="1050"/>
|
||||
<reference key="destination" ref="238522557"/>
|
||||
</object>
|
||||
<int key="connectionID">142</int>
|
||||
<int key="connectionID">1087</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
@@ -2339,14 +2364,6 @@ cjIgPT0gMA</string>
|
||||
</object>
|
||||
<int key="connectionID">357</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">showHelp:</string>
|
||||
<reference key="source" ref="1014"/>
|
||||
<reference key="destination" ref="238773614"/>
|
||||
</object>
|
||||
<int key="connectionID">360</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">saveDocument:</string>
|
||||
@@ -2661,6 +2678,46 @@ cjIgPT0gMA</string>
|
||||
</object>
|
||||
<int key="connectionID">773</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">target: self</string>
|
||||
<reference key="source" ref="238522557"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="238522557"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">target: self</string>
|
||||
<string key="NSBinding">target</string>
|
||||
<string key="NSKeyPath">self</string>
|
||||
<object class="NSDictionary" key="NSOptions">
|
||||
<string key="NS.key.0">NSSelectorName</string>
|
||||
<string key="NS.object.0">showHelp</string>
|
||||
</object>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">1089</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">target: self</string>
|
||||
<reference key="source" ref="238773614"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="238773614"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">target: self</string>
|
||||
<string key="NSBinding">target</string>
|
||||
<string key="NSKeyPath">self</string>
|
||||
<object class="NSDictionary" key="NSOptions">
|
||||
<string key="NS.key.0">NSSelectorName</string>
|
||||
<string key="NS.object.0">showHelp</string>
|
||||
</object>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">1084</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">displayPatternTitle1: currentTime</string>
|
||||
@@ -3683,6 +3740,26 @@ cjIgPT0gMA</string>
|
||||
</object>
|
||||
<int key="connectionID">1061</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">target: self</string>
|
||||
<reference key="source" ref="639407082"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="639407082"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">target: self</string>
|
||||
<string key="NSBinding">target</string>
|
||||
<string key="NSKeyPath">self</string>
|
||||
<object class="NSDictionary" key="NSOptions">
|
||||
<string key="NS.key.0">NSSelectorName</string>
|
||||
<string key="NS.object.0">sayHello</string>
|
||||
</object>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">1073</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -4284,6 +4361,7 @@ cjIgPT0gMA</string>
|
||||
<reference ref="714393797"/>
|
||||
<reference ref="3579291"/>
|
||||
<reference ref="681633572"/>
|
||||
<reference ref="639407082"/>
|
||||
</object>
|
||||
<reference key="parent" ref="972006081"/>
|
||||
</object>
|
||||
@@ -5078,6 +5156,20 @@ cjIgPT0gMA</string>
|
||||
<reference key="object" ref="350888133"/>
|
||||
<reference key="parent" ref="3579291"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1062</int>
|
||||
<reference key="object" ref="639407082"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="877645627"/>
|
||||
</object>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1063</int>
|
||||
<reference key="object" ref="877645627"/>
|
||||
<reference key="parent" ref="639407082"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -5091,6 +5183,8 @@ cjIgPT0gMA</string>
|
||||
<string>1052.IBPluginDependency</string>
|
||||
<string>1053.IBPluginDependency</string>
|
||||
<string>106.IBPluginDependency</string>
|
||||
<string>1062.IBPluginDependency</string>
|
||||
<string>1063.IBPluginDependency</string>
|
||||
<string>111.IBPluginDependency</string>
|
||||
<string>112.IBPluginDependency</string>
|
||||
<string>124.IBPluginDependency</string>
|
||||
@@ -5351,6 +5445,8 @@ cjIgPT0gMA</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO"/>
|
||||
<boolean value="NO"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -5499,7 +5595,7 @@ cjIgPT0gMA</string>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">1061</int>
|
||||
<int key="maxID">1089</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -5569,45 +5665,6 @@ cjIgPT0gMA</string>
|
||||
<string key="minorKey">./Classes/AppController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSTextView</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>orderFrontSharingServicePicker:</string>
|
||||
<string>toggleQuickLookPreviewPanel:</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>orderFrontSharingServicePicker:</string>
|
||||
<string>toggleQuickLookPreviewPanel:</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">orderFrontSharingServicePicker:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">toggleQuickLookPreviewPanel:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/NSTextView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPBrowserTest
|
||||
*
|
||||
* Created by You on February 10, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
@import <AppKit/CPBrowser.j>
|
||||
|
||||
@implementation Node : CPObject
|
||||
{
|
||||
id value;
|
||||
}
|
||||
|
||||
+ (id)withValue:(id)aValue
|
||||
{
|
||||
var a = [[self alloc] init];
|
||||
a.value = aValue;
|
||||
return a;
|
||||
}
|
||||
|
||||
- (id)value
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
- (CPArray)children
|
||||
{
|
||||
return [[Node withValue:1],
|
||||
[Node withValue:2],
|
||||
[Node withValue:3],
|
||||
[Node withValue:2],
|
||||
[Node withValue:3],
|
||||
[Node withValue:2],
|
||||
[Node withValue:3],
|
||||
[Node withValue:2],
|
||||
[Node withValue:3],
|
||||
[Node withValue:2],
|
||||
[Node withValue:3],
|
||||
[Node withValue:2],
|
||||
[Node withValue:3],
|
||||
[Node withValue:4]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow; //this "outlet" is connected automatically by the Cib
|
||||
@outlet CPBrowser browser;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
// This is called when the application is done loading.
|
||||
[browser setDelegate:self];
|
||||
|
||||
[browser setTarget:self];
|
||||
[browser setAction:@selector(browserClicked:)];
|
||||
[browser setDoubleAction:@selector(dblClicked:)];
|
||||
[browser registerForDraggedTypes:["Type"]];
|
||||
|
||||
console.log(browser);
|
||||
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
// This is called when the cib is done loading.
|
||||
// You can implement this method on any object instantiated from a Cib.
|
||||
// It's a useful hook for setting up current UI values, and other things.
|
||||
|
||||
// In this case, we want the window from Cib to become our full browser window
|
||||
// [theWindow setFullPlatformWindow:YES];
|
||||
}
|
||||
|
||||
- (BOOL)browser:(CPBrowser)aBrowser writeRowsWithIndexes:(CPIndexSet)indexes inColumn:(int)column toPasteboard:(CPPasteboard)pboard
|
||||
{
|
||||
var encodedData = [CPKeyedArchiver archivedDataWithRootObject:"Foo"];
|
||||
[pboard declareTypes:["Type"] owner:self];
|
||||
[pboard setData:encodedData forType:"Type"];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)browser:(id)aBrowser validateDrop:(id)info proposedRow:(int)row column:(int)column dropOperation:(id)op
|
||||
{
|
||||
return CPDragOperationMove;
|
||||
}
|
||||
- (BOOL)browser:(id)aBrowser acceptDrop:(id)info atRow:(int)row column:(int)column dropOperation:(id)op
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)browserClicked:(id)aBrowser
|
||||
{
|
||||
console.log("selected column: " + [aBrowser selectedColumn] + " row: " + [aBrowser selectedRowInColumn:[aBrowser selectedColumn]]);
|
||||
}
|
||||
|
||||
- (void)dblClicked:(id)sender
|
||||
{
|
||||
alert("DOUBLE");
|
||||
}
|
||||
|
||||
/*- (id)rootItemForBrowser:(id)aBrowser
|
||||
{
|
||||
return [Node withValue:0];
|
||||
}*/
|
||||
|
||||
- (id)browser:(id)aBrowser numberOfChildrenOfItem:(id)anItem
|
||||
{
|
||||
if (anItem === nil)
|
||||
return 4;
|
||||
return [[anItem children] count];
|
||||
}
|
||||
|
||||
- (id)browser:(id)aBrowser child:(int)index ofItem:(id)anItem
|
||||
{
|
||||
if (!anItem)
|
||||
return [[[Node withValue:0] children] objectAtIndex:index];
|
||||
|
||||
return [[anItem children] objectAtIndex:index];
|
||||
}
|
||||
|
||||
- (id)browser:(id)aBrowser imageValueForItem:(id)anItem
|
||||
{
|
||||
return [[CPImage alloc] initWithContentsOfFile:"http://cappuccino-project.org/img/favicon.ico" size:CGSizeMake(16, 16)];
|
||||
}
|
||||
|
||||
- (id)browser:(id)aBrowser objectValueForItem:(id)anItem
|
||||
{
|
||||
return [anItem value];
|
||||
}
|
||||
|
||||
- (id)browser:(id)aBrowser isLeafItem:(id)anItem
|
||||
{
|
||||
return ![[anItem children] count] || [anItem value] === 4;
|
||||
}
|
||||
|
||||
@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>NSBrowserTest</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* NSBrowserTest
|
||||
*
|
||||
* Created by You on February 21, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
JAKE = require("jake"),
|
||||
task = JAKE.task,
|
||||
FileList = JAKE.FileList,
|
||||
app = require("cappuccino/jake").app,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
||||
OS = require("os");
|
||||
|
||||
app ("NSBrowserTest", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "NSBrowserTest.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("NSBrowserTest");
|
||||
task.setIdentifier("com.yourcompany.NSBrowserTest");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("NSBrowserTest");
|
||||
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", ["NSBrowserTest"], 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", "NSBrowserTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "NSBrowserTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "NSBrowserTest"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "NSBrowserTest"), FILE.join("Build", "Deployment", "NSBrowserTest")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", "NSBrowserTest"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "NSBrowserTest"), FILE.join("Build", "Desktop", "NSBrowserTest", "NSBrowserTest.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", "NSBrowserTest", "NSBrowserTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "NSBrowserTest"));
|
||||
print("----------------------------");
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
NSBrowserTest
|
||||
|
||||
Created by You on February 21, 2013.
|
||||
Copyright 2013, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>NSBrowserTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
objj_msgSend_reset();
|
||||
|
||||
// DEBUG OPTIONS:
|
||||
|
||||
// Uncomment to enable printing of backtraces on exceptions:
|
||||
//objj_msgSend_decorate(objj_backtrace_decorator);
|
||||
|
||||
// Uncomment to supress exceptions that take place inside a message
|
||||
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
|
||||
|
||||
// Uncomment to enable runtime type checking:
|
||||
//objj_msgSend_decorate(objj_typecheck_decorator);
|
||||
|
||||
// Uncomment (along with both above) to print backtraces on type check errors:
|
||||
//objj_typecheck_prints_backtrace = true;
|
||||
|
||||
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
|
||||
//CPLogUnregister(CPLogDefault);
|
||||
|
||||
// Uncomment to enable a specific logger:
|
||||
//CPLogRegister(CPLogConsole);
|
||||
//CPLogRegister(CPLogPopup);
|
||||
|
||||
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
|
||||
// the class name of the view that created them. Comment this or set to false to disable.
|
||||
appkit_tag_dom_elements = true;
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading NSBrowserTest...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index.html
|
||||
NSBrowserTest
|
||||
|
||||
Created by You on February 21, 2013.
|
||||
Copyright 2013, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>NSBrowserTest</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 NSBrowserTest...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* NSBrowserTest
|
||||
*
|
||||
* Created by You on February 21, 2013.
|
||||
* Copyright 2013, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -12,10 +12,7 @@
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
CPView contentView;
|
||||
CPTextField label1;
|
||||
CPTextField label2;
|
||||
MyView myView;
|
||||
CPImageView view2;
|
||||
CPImage patternImage1;
|
||||
BOOL patternImage1Loaded;
|
||||
CPImage patternImage2;
|
||||
@@ -28,11 +25,15 @@
|
||||
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask];
|
||||
|
||||
contentView = [theWindow contentView];
|
||||
label1 = [CPTextField labelWithTitle:@"Dynamically drawn"];
|
||||
label2 = [CPTextField labelWithTitle:@"Screen capture from IE before COORD fix, notice the fuzziness in the pattern"];
|
||||
|
||||
var label1 = [CPTextField labelWithTitle:@"Dynamically drawn"],
|
||||
label2 = [CPTextField labelWithTitle:@"Screen capture from IE before COORD fix, notice the fuzziness in the pattern"];
|
||||
|
||||
patternImage1 = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"help.png"] size:CGSizeMake(21, 22)];
|
||||
view2 = [[CPImageView alloc] initWithFrame:CGRectMake(x, 210, 200, 200)];
|
||||
img2 = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"bad.png"] size:CGSizeMake(200, 200)];
|
||||
|
||||
var view2 = [[CPImageView alloc] initWithFrame:CGRectMake(x, 210, 200, 200)],
|
||||
img2 = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"bad.png"] size:CGSizeMake(200, 200)];
|
||||
|
||||
patternImage2 = [[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"pattern.gif"] size:CGSizeMake(56, 32)];
|
||||
|
||||
var fillColor1 = [CPColor colorWithPatternImage:patternImage1],
|
||||
@@ -48,6 +49,11 @@
|
||||
[label2 setFrameOrigin:CGPointMake(x, CGRectGetMaxY([myView frame]) + 20)];
|
||||
[view2 setFrameOrigin:CGPointMake(x, CGRectGetMaxY([label2 frame]) + 5)];
|
||||
|
||||
var label3 = [CPTextField labelWithTitle:@"Pattern fill with rendered path"];
|
||||
[label3 setFrameOrigin:CGPointMake(300, 20)];
|
||||
|
||||
var patternView = [[PatternView alloc] initWithFrame:CGRectMake(300, CGRectGetMaxY([label3 frame]) + 5, 200, 200)];
|
||||
|
||||
// Pattern images MUST be loaded before they are used, so we have to use a load delegate
|
||||
// for each image and draw only when we have them all.
|
||||
if ([patternImage1 loadStatus] === CPImageLoadStatusCompleted)
|
||||
@@ -69,6 +75,13 @@
|
||||
if (patternImage1Loaded && patternImage2Loaded)
|
||||
[self addSubviews];
|
||||
|
||||
[contentView addSubview:label1];
|
||||
[contentView addSubview:label2];
|
||||
[contentView addSubview:label3];
|
||||
[contentView addSubview:myView];
|
||||
[contentView addSubview:view2];
|
||||
[contentView addSubview:patternView];
|
||||
|
||||
[theWindow orderFront:self];
|
||||
|
||||
// Uncomment the following line to turn on the standard menu bar.
|
||||
@@ -83,15 +96,7 @@
|
||||
patternImage2Loaded = YES;
|
||||
|
||||
if (patternImage1Loaded && patternImage2Loaded)
|
||||
[self addSubviews];
|
||||
}
|
||||
|
||||
- (void)addSubviews
|
||||
{
|
||||
[contentView addSubview:label1];
|
||||
[contentView addSubview:label2];
|
||||
[contentView addSubview:myView];
|
||||
[contentView addSubview:view2];
|
||||
[myView setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -117,25 +122,69 @@
|
||||
|
||||
- (void)drawRect:(CGRect)dirtyRect
|
||||
{
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort];
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort],
|
||||
bounds = [self bounds];
|
||||
|
||||
CGContextSetFillColor(context, fillColor1);
|
||||
CGContextFillRect(context, [self bounds]);
|
||||
|
||||
CGContextSetFillColor(context, [CPColor yellowColor]);
|
||||
CGContextFillEllipseInRect(context, CGRectInset([self bounds], 40, 40));
|
||||
CGContextFillEllipseInRect(context, CGRectInset(bounds, 40, 40));
|
||||
|
||||
CGContextSetStrokeColor(context, [CPColor blueColor]);
|
||||
CGContextStrokeRect(context, CGRectInset([self bounds], 0.5, 0.5));
|
||||
CGContextStrokeRect(context, CGRectInset(bounds, 0.5, 0.5));
|
||||
|
||||
CGContextSetStrokeColor(context, [CPColor redColor]);
|
||||
CGContextStrokeEllipseInRect(context, CGRectInset([self bounds], 20.5, 20.5));
|
||||
CGContextStrokeEllipseInRect(context, CGRectInset(bounds, 20.5, 20.5));
|
||||
|
||||
CGContextSetStrokeColor(context, [CPColor greenColor]);
|
||||
CGContextStrokeRect(context, CGRectInset([self bounds], 30.5, 30.5));
|
||||
CGContextStrokeRect(context, CGRectInset(bounds, 30.5, 30.5));
|
||||
|
||||
CGContextSetFillColor(context, fillColor2);
|
||||
CGContextFillEllipseInRect(context, CGRectInset([self bounds], 50, 50));
|
||||
CGContextFillEllipseInRect(context, CGRectInset(bounds, 50, 50));
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation PatternView : CPView
|
||||
|
||||
- (void)drawRect:(CGRect)dirtyRect
|
||||
{
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort],
|
||||
path = CGPathCreateMutable();
|
||||
|
||||
CGPathMoveToPoint(path, NULL, 0.0, 40.0);
|
||||
CGPathAddLineToPoint(path, NULL, 26.9, 36.0);
|
||||
CGPathAddCurveToPoint(path, NULL, 31.7, 36.0, 36.0, 32.1, 36.0, 27.3);
|
||||
CGPathAddLineToPoint(path, NULL, 40.0, 0.0);
|
||||
CGPathAddLineToPoint(path, NULL, 11.8, 3.0);
|
||||
CGPathAddCurveToPoint(path, NULL, 7.0, 3.0, 3.0, 6.9, 3.0, 11.7);
|
||||
CGPathAddLineToPoint(path, NULL, 0.0, 40.0);
|
||||
CGPathCloseSubpath(path);
|
||||
|
||||
var patternContext = CGContextCreatePatternContext(context, CGSizeMake(50, 70));
|
||||
|
||||
CGContextSetFillColor(patternContext, [CPColor colorWithRed:188 / 255 green:222 / 255 blue:178 / 255 alpha:1.0]);
|
||||
|
||||
CGContextAddPath(patternContext, path);
|
||||
CGContextFillPath(patternContext);
|
||||
|
||||
CGContextSetLineWidth(patternContext, 0.8);
|
||||
CGContextSetStrokeColor(patternContext, [CPColor colorWithRed:0 green:156 / 255 blue:86 / 255 alpha:1.0]);
|
||||
CGContextSetLineJoin(patternContext, "miter");
|
||||
CGContextSetMiterLimit(patternContext, 4.0);
|
||||
|
||||
CGContextAddPath(patternContext, path);
|
||||
CGContextStrokePath(patternContext);
|
||||
|
||||
var bounds = [self bounds];
|
||||
|
||||
CGContextSetFillPattern(context, patternContext);
|
||||
CGContextFillRect(context, bounds);
|
||||
|
||||
CGContextSetStrokeColor(context, [CPColor blueColor]);
|
||||
CGContextStrokeRect(context, CGRectInset(bounds, 0.5, 0.5));
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ tableTestDragType = @"CPTableViewTestDragType";
|
||||
|
||||
var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(16, 16, 0, 0)];
|
||||
[iconView setImageScaling:CPImageScaleNone];
|
||||
|
||||
var iconColumn = [[CPTableColumn alloc] initWithIdentifier:"icons"];
|
||||
[iconColumn setWidth:32.0];
|
||||
[iconColumn setMinWidth:32.0];
|
||||
@@ -63,6 +64,7 @@ tableTestDragType = @"CPTableViewTestDragType";
|
||||
|
||||
|
||||
var desc = [CPSortDescriptor sortDescriptorWithKey:@"self" ascending:YES];
|
||||
|
||||
for (var i = 1; i <= 5; i++)
|
||||
{
|
||||
var column = [[CPTableColumn alloc] initWithIdentifier:String(i)];
|
||||
@@ -80,6 +82,9 @@ tableTestDragType = @"CPTableViewTestDragType";
|
||||
randomColumn = column;
|
||||
}
|
||||
|
||||
[tableView setAutosaveTableColumns:YES];
|
||||
[tableView setAutosaveName:@"TableTest"];
|
||||
|
||||
// we offset this scrollview to make sure all the coordinates are calculated correctly
|
||||
// bad things can happen when the tableview doesn't sit at (0,0)
|
||||
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(200, 50, CGRectGetWidth([contentView bounds]) - 200, CGRectGetHeight([contentView bounds]) -200)];
|
||||
@@ -199,6 +204,7 @@ tableTestDragType = @"CPTableViewTestDragType";
|
||||
[tableView2 addTableColumn:checkBoxColumn];
|
||||
|
||||
var desc = [CPSortDescriptor sortDescriptorWithKey:@"self" ascending:YES];
|
||||
|
||||
for (var i = 1; i <= 3; i++)
|
||||
{
|
||||
var column = [[CPTableColumn alloc] initWithIdentifier:String(i)];
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* loadDynamicFrameworks
|
||||
*
|
||||
* Created by Blair Duncan on February 23, 2013.
|
||||
* Copyright 2013, SGL Studio, BBDO Toronto All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
// This is called when the application is done loading.
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
// This is called when the cib is done loading.
|
||||
// You can implement this method on any object instantiated from a Cib.
|
||||
// It's a useful hook for setting up current UI values, and other things.
|
||||
|
||||
// In this case, we want the window from Cib to become our full browser window
|
||||
[theWindow setFullPlatformWindow:YES];
|
||||
}
|
||||
|
||||
@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>loadDynamicFrameworks</string>
|
||||
</dict>
|
||||
</plist>
|
||||