Merge branch 'refs/heads/master' into slevenbits

This commit is contained in:
Alexander Ljungberg
2012-11-15 17:15:18 +00:00
44 changed files with 935 additions and 408 deletions
+1
View File
@@ -595,6 +595,7 @@ CPCriticalAlertStyle = 2;
frame.size = [self currentValueForThemeAttribute:@"size"];
_window = [[CPWindow alloc] initWithContentRect:frame styleMask:forceStyle || _defaultWindowStyle];
[_window setLevel:CPStatusWindowLevel];
if (_title)
[_window setTitle:_title];
+11 -1
View File
@@ -1218,7 +1218,17 @@ function CPApplicationMain(args, namedArgs)
#if PLATFORM(DOM)
// hook to allow recorder, etc to manipulate things before starting AppKit
if (window.parent !== window && typeof window.parent._childAppIsStarting === "function")
window.parent._childAppIsStarting(window);
{
try
{
window.parent._childAppIsStarting(window);
}
catch(err)
{
// This could happen if we're in an iframe without access to the parent frame.
CPLog.warn("Failed to call parent frame's _childAppIsStarting().");
}
}
#endif
var mainBundle = [CPBundle mainBundle],
+35
View File
@@ -165,6 +165,19 @@ var DefaultLineWidth = 1.0;
CGPathAddCurveToPoint(_path, nil, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, endPoint.x, endPoint.y);
}
- (CGRect)bounds
{
// TODO: this should return this. The controlPointBounds is not a tight fit.
// return CGPathGetPathBoundingBox(_path);
return [self controlPointBounds];
}
- (CGRect)controlPointBounds
{
return CGPathGetBoundingBox(_path);
}
/*!
Create a line segment between the first and last points in the subpath, closing it.
*/
@@ -272,6 +285,11 @@ var DefaultLineWidth = 1.0;
CGPathAddPath(_path, nil, CGPathWithRoundedRectangleInRect(rect, xRadius, yRadius, YES, YES, YES, YES));
}
- (void)appendBezierPathWithArcFromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint radius:(float)radius
{
CGPathAddArcToPoint(_path, null, fromPoint.x, fromPoint.y, toPoint.x, toPoint.y, radius);
}
/*!
Append the contents of a CPBezierPath object.
*/
@@ -288,4 +306,21 @@ var DefaultLineWidth = 1.0;
_path = CGPathCreateMutable();
}
- (void)addClip
{
var ctx = [[CPGraphicsContext currentContext] graphicsPort];
CGContextAddPath(ctx, _path);
CGContextClip(ctx);
}
- (void)setClip
{
var ctx = [[CPGraphicsContext currentContext] graphicsPort];
CGContextBeginPath(ctx);
CGContextAddPath(ctx, _path);
CGContextClip(ctx);
}
@end
+20
View File
@@ -322,6 +322,26 @@ CPBelowBottom = 6;
[self _manageTitlePositioning];
}
- (CPFont)titleFont
{
return [_titleView font];
}
- (void)setTitleFont:(CPFont)aFont
{
[_titleView setFont:aFont];
}
/*!
Return the text field used to display the receiver's title.
This is the Cappuccino equivalent to the `titleCell` method.
*/
- (CPTextField)titleView
{
return _titleView;
}
- (void)_manageTitlePositioning
{
if (_titlePosition == CPNoTitle)
+4
View File
@@ -690,6 +690,10 @@
- (void)mouseDragged:(CPEvent)anEvent
{
// Don't crash if we never registered the intial click.
if (!_mouseDownEvent)
return;
var locationInWindow = [anEvent locationInWindow],
mouseDownLocationInWindow = [_mouseDownEvent locationInWindow];
+8
View File
@@ -611,6 +611,14 @@ function CPColorWithImages()
return [[[self class] alloc] _initWithRGBA:components];
}
/*!
Returns the receiver. This method is a placeholder that does nothing but may be implemented in the future.
*/
- (CPColor)colorUsingColorSpaceName:(id)aColorSpaceName
{
return self;
}
/*!
Returns an array with the HSB values for this color.
The index values are ordered as:
+15
View File
@@ -174,6 +174,21 @@ following:
return _CPFontSystemFontSize;
}
+ (float)systemFontSizeForControlSize:(CPControlSize)aSize
{
// TODO These sizes should be themable or made less arbitrary in some other way.
switch (aSize)
{
case CPSmallControlSize:
return _CPFontSystemFontSize - 1;
case CPMiniControlSize:
return _CPFontSystemFontSize - 2;
case CPRegularControlSize:
default:
return _CPFontSystemFontSize;
}
}
/*!
Sets the default system font size.
*/
+10
View File
@@ -23,6 +23,16 @@
@import "CPColor.j"
@import "CPGraphicsContext.j"
CPCalibratedWhiteColorSpace = @"CalibratedWhiteColorSpace";
CPCalibratedBlackColorSpace = @"CalibratedBlackColorSpace";
CPCalibratedRGBColorSpace = @"CalibratedRGBColorSpace";
CPDeviceWhiteColorSpace = @"DeviceWhiteColorSpace";
CPDeviceBlackColorSpace = @"DeviceBlackColorSpace";
CPDeviceRGBColorSpace = @"DeviceRGBColorSpace";
CPDeviceCMYKColorSpace = @"DeviceCMYKColorSpace";
CPNamedColorSpace = @"NamedColorSpace";
CPPatternColorSpace = @"PatternColorSpace";
CPCustomColorSpace = @"CustomColorSpace";
function CPDrawTiledRects(
/* CGRect */ boundsRect,
+34 -1
View File
@@ -25,7 +25,8 @@
@import "CGContext.j"
var CPGraphicsContextCurrent = nil;
var CPGraphicsContextCurrent = nil,
CPGraphicsContextThreadStack = nil;
/*!
@ingroup appkit
@@ -52,6 +53,28 @@ var CPGraphicsContextCurrent = nil;
CPGraphicsContextCurrent = aGraphicsContext;
}
+ (void)saveGraphicsState
{
if (!CPGraphicsContextCurrent)
return;
if (!CPGraphicsContextThreadStack)
CPGraphicsContextThreadStack = [CPMutableArray array];
[CPGraphicsContextThreadStack addObject:CPGraphicsContextCurrent];
[CPGraphicsContextCurrent saveGraphicsState];
}
+ (void)restoreGraphicsState
{
var lastContext = [CPGraphicsContextThreadStack lastObject];
if (lastContext)
{
[lastContext restoreGraphicsState];
[CPGraphicsContextThreadStack removeLastObject];
}
}
/*!
Creates a graphics context with a provided port.
@param aContext the context to initialize with
@@ -99,4 +122,14 @@ var CPGraphicsContextCurrent = nil;
return YES;
}
- (void)saveGraphicsState
{
CGContextSaveGState(_graphicsPort);
}
- (void)restoreGraphicsState
{
CGContextRestoreGState(_graphicsPort);
}
@end
+5 -5
View File
@@ -45,7 +45,7 @@
{
var context = [[CPGraphicsContext currentContext] graphicsPort],
bounds = [self bounds],
maxX = CGRectGetWidth(bounds) - 2,
maxX = CGRectGetWidth(bounds),
maxY = CGRectGetHeight(bounds);
// Draw background
@@ -63,7 +63,7 @@
// Draw Top Border
CGContextBeginPath(context);
CGContextMoveToPoint(context, 1, 0);
CGContextMoveToPoint(context, 0, 0);
CGContextAddLineToPoint(context, maxX, 0);
CGContextClosePath(context);
CGContextSetStrokeColor(context, [_ruleEditor _sliceTopBorderColor]);
@@ -71,8 +71,8 @@
// Draw Bottom Border
CGContextBeginPath(context);
CGContextMoveToPoint(context, 1, maxY - 0.5);
CGContextAddLineToPoint(context, maxX, maxY - 0.5);
CGContextMoveToPoint(context, 0, maxY);
CGContextAddLineToPoint(context, maxX, maxY);
CGContextClosePath(context);
var bottomColor = (_rowIndex == [_ruleEditor _lastRow]) ? [_ruleEditor _sliceLastBottomBorderColor] : [_ruleEditor _sliceBottomBorderColor];
CGContextSetStrokeColor(context, bottomColor);
@@ -106,4 +106,4 @@
return [CPString stringWithFormat:@"<%@ %p index:%d indentation:%d>",[self className],self,[self rowIndex],[self indentation]];
}
@end
@end
@@ -121,7 +121,7 @@ var CONTROL_HEIGHT = 16.,
return [CPMenuItem separatorItem];
}
- (_CPRuleEditorTextField)_createStaticTextFieldWithStringValue:(CPString )text
- (_CPRuleEditorTextField)_createStaticTextFieldWithStringValue:(CPString)text
{
var textField = [[_CPRuleEditorTextField alloc] initWithFrame:CPMakeRect(0, 0, 200, CONTROL_HEIGHT)],
refont = [_ruleEditor font],
@@ -352,6 +352,15 @@ var CONTROL_HEIGHT = 16.,
optionFrame = _ruleOptionFrames[i];
optionFrame.origin.y = (rowHeight - CGRectGetHeight(optionFrame)) / 2 - 2;
// small positioning fix
if ([ruleOptionView isKindOfClass:CPTextField])
{
optionFrame.origin.y += 2;
[_ruleOptionViews[i] setValue:CGInsetMake(7, 7, 7, 8) forThemeAttribute:@"content-inset"];
}
if (widthChanged)
{
optionFrame.origin.x = optionViewOriginX;
+6 -1
View File
@@ -501,7 +501,12 @@ var RECENT_SEARCH_PREFIX = @" ";
if (_CGRectContainsPoint([self searchButtonRectForBounds:[self bounds]], point))
{
if (_searchMenuTemplate == nil)
[self _sendAction:self];
{
if ([_searchButton target] && [_searchButton action])
[_searchButton mouseDown:anEvent];
else
[self _sendAction:self];
}
else
[self _showMenu];
}
+1 -1
View File
@@ -138,7 +138,7 @@ CPPressedTab = 2;
_view = aView;
if ([_tabView selectedTabViewItem] == self)
[_tabView _setContentViewForItem:self];
[_tabView _setContentViewFromItem:self];
}
/*!
+31 -1
View File
@@ -494,7 +494,13 @@ CPTableColumnUserResizingMask = 1 << 1;
*/
- (CPSortDescriptor)sortDescriptorPrototype
{
return _sortDescriptorPrototype;
if (_sortDescriptorPrototype)
return _sortDescriptorPrototype;
var binderClass = [[self class] _binderClassForBinding:CPValueBinding],
binding = [binderClass getBinding:CPValueBinding forObject:self];
return [binding _defaultSortDescriptorPrototype];
}
/*!
@@ -570,6 +576,30 @@ CPTableColumnUserResizingMask = 1 << 1;
[tableView reloadDataForRowIndexes:rowIndexes columnIndexes:columnIndexes];
}
- (CPSortDescriptor)_defaultSortDescriptorPrototype
{
if (![self createsSortDescriptor])
return nil;
var keyPath = [_info objectForKey:CPObservedKeyPathKey],
dotIndex = keyPath.indexOf(".");
if (dotIndex === CPNotFound)
return nil;
var firstPart = keyPath.substring(0, dotIndex),
key = keyPath.substring(dotIndex + 1);
return [CPSortDescriptor sortDescriptorWithKey:key ascending:YES];
}
- (BOOL)createsSortDescriptor
{
var options = [_info objectForKey:CPOptionsKey],
optionValue = [options objectForKey:CPCreatesSortDescriptorBindingOption];
return optionValue === nil ? YES : [optionValue boolValue];
}
@end
@implementation CPTableColumn (Bindings)
+62 -4
View File
@@ -39,8 +39,8 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], CGInsetMakeZero(), [CPNull null], [CPNull null], [CPNull null], CGSizeMakeZero()]
forKeys:[@"background-color", @"text-alignment", @"text-inset", @"text-color", @"font", @"text-shadow-color", @"text-shadow-offset"]];
return [CPDictionary dictionaryWithObjects:[[CPNull null], CPLeftTextAlignment, CPLineBreakByTruncatingTail, CGInsetMakeZero(), [CPNull null], [CPNull null], [CPNull null], CGSizeMakeZero()]
forKeys:[@"background-color", @"text-alignment", @"line-break-mode", @"text-inset", @"text-color", @"font", @"text-shadow-color", @"text-shadow-offset"]];
}
- (void)initWithFrame:(CGRect)frame
@@ -78,6 +78,7 @@
[_textField setTextShadowColor:[self currentValueForThemeAttribute:@"text-shadow-color"]];
[_textField setTextShadowOffset:[self currentValueForThemeAttribute:@"text-shadow-offset"]];
[_textField setAlignment:[self currentValueForThemeAttribute:@"text-alignment"]];
[_textField setLineBreakMode:[self currentValueForThemeAttribute:@"line-break-mode"]];
}
- (void)setStringValue:(CPString)string
@@ -102,7 +103,52 @@
- (void)setFont:(CPFont)aFont
{
[self setValue:aFont forThemeAttribute:"font"];
[self setValue:aFont forThemeAttribute:@"font"];
}
- (CPFont)font
{
return [self currentValueForThemeAttribute:@"font"]
}
- (void)setAlignment:(CPTextAlignment)alignment
{
[self setValue:alignment forThemeAttribute:@"text-alignment"];
}
- (CPTextAlignment)alignment
{
return [self currentValueForThemeAttribute:@"text-alignment"]
}
- (void)setLineBreakMode:(CPLineBreakMode)mode
{
[self setValue:mode forThemeAttribute:@"line-break-mode"];
}
- (CPLineBreakMode)lineBreakMode
{
return [self currentValueForThemeAttribute:@"line-break-mode"]
}
- (void)setTextColor:(CPColor)aColor
{
[self setValue:aColor forThemeAttribute:@"text-color"];
}
- (CPColor)textColor
{
return [self currentValueForThemeAttribute:@"text-color"]
}
- (void)setTextShadowColor:(CPColor)aColor
{
[self setValue:aColor forThemeAttribute:@"text-shadow-color"];
}
- (CPColor)textShadowColor
{
return [self currentValueForThemeAttribute:@"text-shadow-color"]
}
- (void)_setIndicatorImage:(CPImage)anImage
@@ -122,6 +168,10 @@
var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringValueKey",
_CPTableColumnHeaderViewFontKey = @"_CPTableColumnHeaderViewFontKey",
_CPTableColumnHeaderViewTextColorKey = @"_CPTableColumnHeaderViewTextColorKey",
_CPTableColumnHeaderViewTextShadowColorKey = @"_CPTableColumnHeaderViewTextShadowColorKey",
_CPTableColumnHeaderViewAlignmentKey = @"_CPTableColumnHeaderViewAlignmentKey",
_CPTableColumnHeaderViewLineBreakModeKey = @"_CPTableColumnHeaderViewLineBreakModeKey",
_CPTableColumnHeaderViewImageKey = @"_CPTableColumnHeaderViewImageKey";
@implementation _CPTableColumnHeaderView (CPCoding)
@@ -134,6 +184,10 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal
[self _setIndicatorImage:[aCoder decodeObjectForKey:_CPTableColumnHeaderViewImageKey]];
[self setStringValue:[aCoder decodeObjectForKey:_CPTableColumnHeaderViewStringValueKey]];
[self setFont:[aCoder decodeObjectForKey:_CPTableColumnHeaderViewFontKey]];
[self setTextColor:[aCoder decodeObjectForKey:_CPTableColumnHeaderViewTextColorKey]];
[self setTextShadowColor:[aCoder decodeObjectForKey:_CPTableColumnHeaderViewTextShadowColorKey]];
[self setAlignment:[aCoder decodeIntForKey:_CPTableColumnHeaderViewAlignmentKey]];
[self setLineBreakMode:[aCoder decodeIntForKey:_CPTableColumnHeaderViewLineBreakModeKey]];
}
return self;
@@ -145,7 +199,11 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal
[aCoder encodeObject:[_textField text] forKey:_CPTableColumnHeaderViewStringValueKey];
[aCoder encodeObject:[_textField image] forKey:_CPTableColumnHeaderViewImageKey];
[aCoder encodeObject:[_textField font] forKey:_CPTableColumnHeaderViewFontKey];
[aCoder encodeObject:[self font] forKey:_CPTableColumnHeaderViewFontKey];
[aCoder encodeObject:[self textColor] forKey:_CPTableColumnHeaderViewTextColorKey];
[aCoder encodeObject:[self textShadowColor] forKey:_CPTableColumnHeaderViewTextShadowColorKey];
[aCoder encodeInt:[self alignment] forKey:_CPTableColumnHeaderViewAlignmentKey];
[aCoder encodeInt:[self lineBreakMode] forKey:_CPTableColumnHeaderViewLineBreakModeKey];
}
@end
+8 -3
View File
@@ -4794,10 +4794,15 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
_contentBindingExpicitelySet = NO;
}
if ([[self infoForBinding:@"selectionIndexes"] objectForKey:CPObservedObjectKey] !== destination)
[self bind:@"selectionIndexes" toObject:destination withKeyPath:@"selectionIndexes" options:nil];
// If the content binding was set manually assume the user is taking manual control of establishing bindings.
if (!_contentBindingExpicitelySet)
{
if ([[self infoForBinding:@"selectionIndexes"] objectForKey:CPObservedObjectKey] !== destination)
[self bind:@"selectionIndexes" toObject:destination withKeyPath:@"selectionIndexes" options:nil];
//[self bind:@"sortDescriptors" toObject:destination withKeyPath:@"sortDescriptors" options:nil];
if ([[self infoForBinding:@"sortDescriptors"] objectForKey:CPObservedObjectKey] !== destination)
[self bind:@"sortDescriptors" toObject:destination withKeyPath:@"sortDescriptors" options:nil];
}
}
- (void)bind:(CPString)aBinding toObject:(id)anObject withKeyPath:(CPString)aKeyPath options:(CPDictionary)options
+4 -4
View File
@@ -613,10 +613,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
/* @ignore */
- (BOOL)resignFirstResponder
{
// When we are no longer the first responder we don't worry about the key status of our window anymore.
[[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidResignKeyNotification object:[self window]];
[[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidBecomeKeyNotification object:[self window]];
#if PLATFORM(DOM)
var element = [self _inputElement],
@@ -638,6 +634,10 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
#endif
// When we are no longer the first responder we don't worry about the key status of our window anymore.
[[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidResignKeyNotification object:[self window]];
[[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidBecomeKeyNotification object:[self window]];
[self _resignFirstKeyResponder];
_isEditing = NO;
+5 -53
View File
@@ -98,9 +98,6 @@ var CPViewFlags = { },
CPViewHasCustomDrawRect = 1 << 0,
CPViewHasCustomLayoutSubviews = 1 << 1;
var CPCurrentToolTip,
CPCurrentToolTipTimer,
CPToolTipDelay = 1.0;
/*!
@ingroup appkit
@@ -246,8 +243,8 @@ var CPCurrentToolTip,
- (void)_setupToolTipHandlers
{
_toolTipInstalled = NO;
_toolTipFunctionIn = function(e) { [self _fireToolTip]; }
_toolTipFunctionOut = function(e) { [self _invalidateToolTip]; };
_toolTipFunctionIn = function(e) { [_CPToolTip scheduleToolTipForView:self]; }
_toolTipFunctionOut = function(e) { [_CPToolTip invalidateCurrentToolTipIfNeeded]; };
}
+ (CPSet)keyPathsForValuesAffectingFrame
@@ -336,6 +333,9 @@ var CPCurrentToolTip,
if (_toolTip == aToolTip)
return;
if (aToolTip && ![aToolTip isKindOfClass:CPString])
aToolTip = [aToolTip description];
_toolTip = aToolTip;
if (_toolTip)
@@ -398,54 +398,6 @@ var CPCurrentToolTip,
_toolTipInstalled = NO;
}
/*! @ignore
Starts the tooltip timer.
*/
- (void)_fireToolTip
{
if (CPCurrentToolTipTimer)
{
[CPCurrentToolTipTimer invalidate];
if (CPCurrentToolTip)
[CPCurrentToolTip close];
CPCurrentToolTip = nil;
}
if (_toolTip)
CPCurrentToolTipTimer = [CPTimer scheduledTimerWithTimeInterval:CPToolTipDelay target:self selector:@selector(_showToolTip:) userInfo:nil repeats:NO];
}
/*! @ignore
Stop the tooltip timer if any
*/
- (void)_invalidateToolTip
{
if (CPCurrentToolTipTimer)
{
[CPCurrentToolTipTimer invalidate];
CPCurrentToolTipTimer = nil;
}
if (CPCurrentToolTip)
{
[CPCurrentToolTip close];
CPCurrentToolTip = nil;
}
}
/*! @ignore
Actually shows the tooltip if any
*/
- (void)_showToolTip:(CPTimer)aTimer
{
if (CPCurrentToolTip)
[CPCurrentToolTip close];
CPCurrentToolTip = [_CPToolTip toolTipWithString:_toolTip];
}
/*!
Returns the container view of the receiver
@return the receiver's containing view
+5
View File
@@ -1032,6 +1032,11 @@ CPWebViewAppKitScrollMaxPollCount = 3;
var documentURL = [CPURL URLWithString:window.location.href];
if ([documentURL isFileURL] && CPFeatureIsCompatible(CPSOPDisabledFromFileURLs))
return YES;
// Relative URLs always pass the SOP.
if (![self scheme] && ![self host] && ![self port])
return YES;
return ([documentURL scheme] == [self scheme] && [documentURL host] == [self host] && [documentURL port] == [self port]);
}
+46
View File
@@ -287,6 +287,9 @@ var CPWindowActionMessageKeys = [
unsigned _shadowStyle;
BOOL _showsResizeIndicator;
int _positioningMask;
CGRect _positioningScreenRect;
BOOL _isDocumentEdited;
BOOL _isDocumentSaving;
@@ -535,6 +538,49 @@ CPTexturedBackgroundWindowMask
// set up a default key view loop.
if (_keyViewLoopIsDirty && ![self autorecalculatesKeyViewLoop])
[self recalculateKeyViewLoop];
// At this time we know the final screen (or browser) size and can apply the positioning mask, if any, from the nib.
if (_positioningScreenRect)
{
var actualScreenRect = [CPPlatform isBrowser] ? [_platformWindow contentBounds] : [[self screen] visibleFrame],
frame = [self frame],
origin = frame.origin;
if (actualScreenRect)
{
if ((_positioningMask & CPWindowPositionFlexibleLeft) && (_positioningMask & CPWindowPositionFlexibleRight))
{
// Proportional Horizontal.
origin.x *= (actualScreenRect.size.width / _positioningScreenRect.size.width);
}
else if (_positioningMask & CPWindowPositionFlexibleLeft)
{
// Fixed from Right
origin.x += actualScreenRect.size.width - _positioningScreenRect.size.width;
}
else if (_positioningMask & CPWindowPositionFlexibleRight)
{
// Fixed from Left
}
if ((_positioningMask & CPWindowPositionFlexibleTop) && (_positioningMask & CPWindowPositionFlexibleBottom))
{
// Proportional Vertical.
origin.y *= (actualScreenRect.size.height / _positioningScreenRect.size.height);
}
else if (_positioningMask & CPWindowPositionFlexibleTop)
{
// Fixed from Bottom
origin.y += actualScreenRect.size.height - _positioningScreenRect.size.height;
}
else if (_positioningMask & CPWindowPositionFlexibleBottom)
{
// Fixed from Top
}
[self setFrameOrigin:origin];
}
}
}
- (void)_setWindowView:(CPView)aWindowView
+23 -12
View File
@@ -53,15 +53,20 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
*/
- (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
{
var contentRect = CGRectMakeCopy(aFrameRect);
var contentRect = CGRectMakeCopy(aFrameRect),
modifierX = 16,
modifierY = 19;
// @todo change border art and remove this pixel perfect adaptation
// return CGRectInset(contentRect, 20, 20);
//
// @comment: If we use this, each time we open the popover, the content
// view is reduced a little over and over
// return CGRectInset(contentRect, modifierX, modifierY);
contentRect.origin.x += 18;
contentRect.origin.y += 17;
contentRect.size.width -= 35;
contentRect.size.height -= 37;
contentRect.origin.x += modifierX;
contentRect.origin.y += modifierY;
contentRect.size.width -= modifierX * 2;
contentRect.size.height -= modifierY * 2;
return contentRect;
}
@@ -73,15 +78,21 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
*/
+ (CGRect)frameRectForContentRect:(CGRect)aContentRect
{
var frameRect = CGRectMakeCopy(aContentRect);
var frameRect = CGRectMakeCopy(aContentRect),
modifierX = 16,
modifierY = 19;
// @todo change border art and remove this pixel perfect adaptation
//return CGRectOffset(frameRect, 20, 20);
// @comment: If we use this, each time we open the popover, the content
//
// view is reduced a little over and over
// return CGRectOffset(frameRect, modifierX, modifierY);
frameRect.origin.x -= modifierX;
frameRect.origin.y -= modifierY;
frameRect.size.width += modifierX * 2;
frameRect.size.height += modifierY * 2;
frameRect.origin.x -= 18;
frameRect.origin.y -= 17;
frameRect.size.width += 35;
frameRect.size.height += 37;
return frameRect;
}
+86 -66
View File
@@ -4,29 +4,20 @@
@import "CGGeometry.j"
@import "CPWindow.j"
CPWindowPositionFlexibleRight = 1 << 19;
CPWindowPositionFlexibleLeft = 1 << 20;
CPWindowPositionFlexibleBottom = 1 << 21;
CPWindowPositionFlexibleTop = 1 << 22;
var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemplateMinSizeKey",
_CPCibWindowTemplateMaxSizeKey = @"_CPCibWindowTemplateMaxSizeKey",
_CPCibWindowTemplateViewClassKey = @"_CPCibWindowTemplateViewClassKey",
_CPCibWindowTemplateWindowClassKey = @"_CPCibWindowTemplateWindowClassKey",
_CPCibWindowTemplateWindowRectKey = @"_CPCibWindowTemplateWindowRectKey",
_CPCibWindowTemplateWindowStyleMaskKey = @"_CPCibWindowTempatStyleMaskKey",
_CPCibWindowTemplateWindowTitleKey = @"_CPCibWindowTemplateWindowTitleKey",
_CPCibWindowTemplateWindowViewKey = @"_CPCibWindowTemplateWindowViewKey",
_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop = @"_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop",
_CPCibWindowTemplateWindowIsFullPlatformWindowKey = @"_CPCibWindowTemplateWindowIsFullPlatformWindowKey";
@implementation _CPCibWindowTemplate : CPObject
{
CGSize _minSize;
CGSize _maxSize;
//CGSize _screenRect;
CGRect _screenRect;
id _viewClass;
//unsigned _wtFlags;
unsigned _wtFlags;
CPString _windowClass;
CGRect _windowRect;
unsigned _windowStyleMask;
@@ -52,67 +43,18 @@ var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemp
_windowView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 400.0, 200.0)];
_windowIsFullPlatformWindow = NO;
_wtFlags = CPPositionProportionalHorizontal | CPPositionProportionalVertical;
}
return self;
}
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super init];
if (self)
{
if ([aCoder containsValueForKey:_CPCibWindowTemplateMinSizeKey])
_minSize = [aCoder decodeSizeForKey:_CPCibWindowTemplateMinSizeKey];
if ([aCoder containsValueForKey:_CPCibWindowTemplateMaxSizeKey])
_maxSize = [aCoder decodeSizeForKey:_CPCibWindowTemplateMaxSizeKey];
_viewClass = [aCoder decodeObjectForKey:_CPCibWindowTemplateViewClassKey];
_windowClass = [aCoder decodeObjectForKey:_CPCibWindowTemplateWindowClassKey];
_windowRect = [aCoder decodeRectForKey:_CPCibWindowTemplateWindowRectKey];
_windowStyleMask = [aCoder decodeIntForKey:_CPCibWindowTemplateWindowStyleMaskKey];
_windowTitle = [aCoder decodeObjectForKey:_CPCibWindowTemplateWindowTitleKey];
_windowView = [aCoder decodeObjectForKey:_CPCibWindowTemplateWindowViewKey];
_windowAutorecalculatesKeyViewLoop = [aCoder decodeBoolForKey:_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop];
_windowIsFullPlatformWindow = [aCoder decodeBoolForKey:_CPCibWindowTemplateWindowIsFullPlatformWindowKey];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
if (_minSize)
[aCoder encodeSize:_minSize forKey:_CPCibWindowTemplateMinSizeKey];
if (_maxSize)
[aCoder encodeSize:_maxSize forKey:_CPCibWindowTemplateMaxSizeKey];
[aCoder encodeObject:_viewClass forKey:_CPCibWindowTemplateViewClassKey];
[aCoder encodeObject:_windowClass forKey:_CPCibWindowTemplateWindowClassKey];
[aCoder encodeRect:_windowRect forKey:_CPCibWindowTemplateWindowRectKey];
[aCoder encodeInt:_windowStyleMask forKey:_CPCibWindowTemplateWindowStyleMaskKey];
[aCoder encodeObject:_windowTitle forKey:_CPCibWindowTemplateWindowTitleKey];
[aCoder encodeObject:_windowView forKey:_CPCibWindowTemplateWindowViewKey];
if (_windowAutorecalculatesKeyViewLoop)
[aCoder encodeObject:_windowAutorecalculatesKeyViewLoop forKey:_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop];
if (_windowIsFullPlatformWindow)
[aCoder encodeObject:_windowIsFullPlatformWindow forKey:_CPCibWindowTemplateWindowIsFullPlatformWindowKey];
}
- (CPString)customClassName
{
return _windowClass;
}
- (void)setCustomClassName:(CPString)aClassName
{
_windowClass = aClassName;
@@ -155,7 +97,85 @@ var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemp
[theWindow setAutorecalculatesKeyViewLoop:_windowAutorecalculatesKeyViewLoop];
[theWindow setFullBridge:_windowIsFullPlatformWindow];
theWindow._positioningMask = _wtFlags;
theWindow._positioningScreenRect = _screenRect;
return theWindow;
}
@end
var _CPCibWindowTemplateMinSizeKey = @"_CPCibWindowTemplateMinSizeKey",
_CPCibWindowTemplateMaxSizeKey = @"_CPCibWindowTemplateMaxSizeKey",
_CPCibWindowTemplateViewClassKey = @"_CPCibWindowTemplateViewClassKey",
_CPCibWindowTemplateWTFlagsKey = @"_CPCibWindowTemplateWTFlagsKey",
_CPCibWindowTemplateWindowClassKey = @"_CPCibWindowTemplateWindowClassKey",
_CPCibWindowTemplateWindowRectKey = @"_CPCibWindowTemplateWindowRectKey",
_CPCibWindowTemplateScreenRectKey = @"_CPCibWindowTemplateScreenRectKey",
_CPCibWindowTemplateWindowStyleMaskKey = @"_CPCibWindowTempatStyleMaskKey",
_CPCibWindowTemplateWindowTitleKey = @"_CPCibWindowTemplateWindowTitleKey",
_CPCibWindowTemplateWindowViewKey = @"_CPCibWindowTemplateWindowViewKey",
_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop = @"_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop",
_CPCibWindowTemplateWindowIsFullPlatformWindowKey = @"_CPCibWindowTemplateWindowIsFullPlatformWindowKey";
@implementation _CPCibWindowTemplate (Coding)
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super init];
if (self)
{
if ([aCoder containsValueForKey:_CPCibWindowTemplateMinSizeKey])
_minSize = [aCoder decodeSizeForKey:_CPCibWindowTemplateMinSizeKey];
if ([aCoder containsValueForKey:_CPCibWindowTemplateMaxSizeKey])
_maxSize = [aCoder decodeSizeForKey:_CPCibWindowTemplateMaxSizeKey];
_viewClass = [aCoder decodeObjectForKey:_CPCibWindowTemplateViewClassKey];
_windowClass = [aCoder decodeObjectForKey:_CPCibWindowTemplateWindowClassKey];
_wtFlags = [aCoder decodeIntForKey:_CPCibWindowTemplateWTFlagsKey];
_windowRect = [aCoder decodeRectForKey:_CPCibWindowTemplateWindowRectKey];
_screenRect = [aCoder decodeRectForKey:_CPCibWindowTemplateScreenRectKey];
_windowStyleMask = [aCoder decodeIntForKey:_CPCibWindowTemplateWindowStyleMaskKey];
_windowTitle = [aCoder decodeObjectForKey:_CPCibWindowTemplateWindowTitleKey];
_windowView = [aCoder decodeObjectForKey:_CPCibWindowTemplateWindowViewKey];
_windowAutorecalculatesKeyViewLoop = [aCoder decodeBoolForKey:_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop];
_windowIsFullPlatformWindow = [aCoder decodeBoolForKey:_CPCibWindowTemplateWindowIsFullPlatformWindowKey];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
if (_minSize)
[aCoder encodeSize:_minSize forKey:_CPCibWindowTemplateMinSizeKey];
if (_maxSize)
[aCoder encodeSize:_maxSize forKey:_CPCibWindowTemplateMaxSizeKey];
[aCoder encodeObject:_viewClass forKey:_CPCibWindowTemplateViewClassKey];
[aCoder encodeObject:_windowClass forKey:_CPCibWindowTemplateWindowClassKey];
[aCoder encodeInt:_wtFlags forKey:_CPCibWindowTemplateWTFlagsKey];
[aCoder encodeRect:_windowRect forKey:_CPCibWindowTemplateWindowRectKey];
[aCoder encodeRect:_screenRect forKey:_CPCibWindowTemplateScreenRectKey];
[aCoder encodeInt:_windowStyleMask forKey:_CPCibWindowTemplateWindowStyleMaskKey];
[aCoder encodeObject:_windowTitle forKey:_CPCibWindowTemplateWindowTitleKey];
[aCoder encodeObject:_windowView forKey:_CPCibWindowTemplateWindowViewKey];
if (_windowAutorecalculatesKeyViewLoop)
[aCoder encodeObject:_windowAutorecalculatesKeyViewLoop forKey:_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop];
if (_windowIsFullPlatformWindow)
[aCoder encodeObject:_windowIsFullPlatformWindow forKey:_CPCibWindowTemplateWindowIsFullPlatformWindowKey];
}
@end
+10
View File
@@ -321,6 +321,16 @@ function CGContextClosePath(aContext)
CGPathCloseSubpath(aContext.path);
}
/*!
Return YES if the current path in the given context is empty.
@param aContext the CGContext to examine
@return BOOL
*/
function CGContextIsPathEmpty(aContext)
{
return (!aContext.path || CGPathIsEmpty(aContext.path));
}
/*!
Moves the current location of aContext to the given x and y coordinates
@param aContext the CGContext to move
+1 -1
View File
@@ -129,7 +129,7 @@ function CGContextAddPath(aContext, aPath)
break;
case kCGPathElementAddArc: _CGContextAddArcCanvas(aContext, element.x, element.y, element.radius, element.startAngle, element.endAngle, element.clockwise);
break;
case kCGPathElementAddArcTo: //_CGContextAddArcToPointCanvas(aContext, element.cp1x, element.cp1.y, element.cp2.x, element.cp2y, element.radius);
case kCGPathElementAddArcToPoint: _CGContextAddArcToPointCanvas(aContext, element.p1x, element.p1y, element.p2x, element.p2y, element.radius);
break;
}
}
+2 -2
View File
@@ -215,7 +215,7 @@ function CGContextDrawPath(aContext, aMode)
COORD(start.x), ',', COORD(start.y), " ",
COORD(end.x), ',', COORD(end.y));
break;
case kCGPathElementAddArcTo: break;
case kCGPathElementAddArcToPoint: break;
}
// TODO: Following is broken for curves due to
@@ -332,4 +332,4 @@ function CGContextDrawLinearGradient(aContext, aGradient, aStartPoint, anEndPoin
// aContext.buffer += vml.join("");
// else
// aContext.DOMElement.innerHTML = vml.join("");
}
}
+119
View File
@@ -118,6 +118,17 @@ function CGPathAddArc(aPath, aTransform, x, y, aRadius, aStartAngle, anEndAngle,
function CGPathAddArcToPoint(aPath, aTransform, x1, y1, x2, y2, aRadius)
{
var p1 = _CGPointMake(x1, y1),
p2 = _CGPointMake(x2, y2);
if (aTransform)
{
p1 = _CGPointApplyAffineTransform(p1, aTransform);
p2 = _CGPointApplyAffineTransform(p2, aTransform);
}
aPath.current = p2;
aPath.elements[aPath.count++] = { type:kCGPathElementAddArcToPoint, p1x:p1.x, p1y:p1.y, p2x:p2.x, p2y:p2.y, radius:aRadius };
}
function CGPathAddCurveToPoint(aPath, aTransform, cp1x, cp1y, cp2x, cp2y, x, y)
@@ -186,6 +197,12 @@ function CGPathAddPath(aPath, aTransform, anotherPath)
element.endAngle, element.isClockwise);
break;
case kCGPathElementAddArcToPoint: CGPathAddArcToPoint(aPath, aTransform,
element.p1x, element.p1y,
element.p2x, element.p2y,
element.radius);
break;
case kCGPathElementAddQuadCurveToPoint: CGPathAddQuadCurveToPoint(aPath, aTransform,
element.cpx, element.cpy,
element.x, element.y);
@@ -389,6 +406,108 @@ function CGPathIsEmpty(aPath)
return !aPath || aPath.count == 0;
}
/*!
Calculate the smallest rectangle to contain both the path of the receiver and all control points.
*/
function CGPathGetBoundingBox(aPath)
{
if (!aPath || !aPath.count)
return _CGRectMakeZero();
var ox = 0,
oy = 0,
rx = 0,
ry = 0,
movePoint = nil;
function addPoint(x, y)
{
ox = MIN(ox, x);
oy = MIN(oy, y);
rx = MAX(rx, x);
ry = MAX(ry, y);
}
for (var i = 0, count = aPath.count; i < count; ++i)
{
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.
switch (element.type)
{
case kCGPathElementAddLineToPoint:
if (movePoint)
{
addPoint(movePoint.x, movePoint.y);
movePoint = nil;
}
addPoint(element.x, element.y);
break;
case kCGPathElementAddCurveToPoint:
if (movePoint)
{
addPoint(movePoint.x, movePoint.y);
movePoint = nil;
}
addPoint(element.cp1x, element.cp1y);
addPoint(element.cp2x, element.cp2y);
addPoint(element.x, element.y);
break;
case kCGPathElementAddArc:
if (movePoint)
{
addPoint(movePoint.x, movePoint.y);
movePoint = nil;
}
addPoint(element.x, element.y);
break;
case kCGPathElementAddArcToPoint:
if (movePoint)
{
addPoint(movePoint.x, movePoint.y);
movePoint = nil;
}
addPoint(element.p1x, element.p1y);
addPoint(element.p2x, element.p2y);
break;
case kCGPathElementAddQuadCurveToPoint:
if (movePoint)
{
addPoint(movePoint.x, movePoint.y);
movePoint = nil;
}
addPoint(element.cpx, element.cpy);
addPoint(element.x, element.y);
break;
case kCGPathElementMoveToPoint:
movePoint = _CGPointMake(element.x, element.y);
break;
case kCGPathElementCloseSubpath:
if (movePoint)
{
addPoint(movePoint.x, movePoint.y);
movePoint = nil;
}
break;
}
}
return _CGRectMake(ox, oy, rx - ox, ry - oy);
}
/*!
@}
*/
+4 -2
View File
@@ -113,14 +113,12 @@
@import "CPEvent.j"
@import "CPText.j"
@import "CPCompatibility.j"
@import "CPDOMWindowLayer.j"
@import "CPPlatform.j"
@import "CPPlatformWindow.j"
@import "CPPlatformWindow+DOMKeys.j"
// List of all open native windows
var PlatformWindows = [CPSet set];
@@ -1242,6 +1240,10 @@ var resizeTimer = nil;
else if (type === "mousedown")
{
// If we receive a click event, then we invalidate any scheduled
// or visible tooltips
[_CPToolTip invalidateCurrentToolTipIfNeeded];
var button = aDOMEvent.button;
_mouseDownIsRightClick = button == 2 || (CPBrowserIsOperatingSystem(CPMacOperatingSystem) && button == 0 && modifierFlags & CPControlKeyMask);
+1
View File
@@ -1678,6 +1678,7 @@ var themedButtonValues = nil,
[@"text-shadow-color", [CPColor whiteColor]],
[@"text-shadow-offset", CGSizeMake(0.0, 1.0)],
[@"text-alignment", CPLeftTextAlignment],
[@"line-break-mode", CPLineBreakByTruncatingTail],
[@"background-color", pressed, CPThemeStateHighlighted],
[@"background-color", highlighted, CPThemeStateSelected],
+45 -27
View File
@@ -292,7 +292,7 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
{
[self layoutIfNeeded];
var textFrame = CGRectMakeZero();
var textFrame = _CGRectMakeZero();
if (_DOMTextElement)
{
@@ -681,38 +681,47 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
textRectWidth = _CGRectGetWidth(textRect),
textRectHeight = _CGRectGetHeight(textRect);
if (_verticalAlignment !== CPTopVerticalTextAlignment)
if (textRectWidth <= 0 || textRectHeight <= 0)
{
if (!_textSize)
// Don't bother trying to position the text in an empty rect.
textRectWidth = 0;
textRectHeight = 0;
}
else
{
if (_verticalAlignment !== CPTopVerticalTextAlignment)
{
if (_lineBreakMode === CPLineBreakByCharWrapping ||
_lineBreakMode === CPLineBreakByWordWrapping)
if (!_textSize)
{
_textSize = [_text sizeWithFont:_font inWidth:textRectWidth];
}
else
{
_textSize = [_text sizeWithFont:_font];
if (_lineBreakMode === CPLineBreakByCharWrapping ||
_lineBreakMode === CPLineBreakByWordWrapping)
{
_textSize = [_text sizeWithFont:_font inWidth:textRectWidth];
}
else
{
_textSize = [_text sizeWithFont:_font];
// Account for possible fractional pixels at right edge
_textSize.width += 1;
// Account for possible fractional pixels at right edge
_textSize.width += 1;
}
// Account for possible fractional pixels at bottom edge
_textSize.height += 1;
}
// Account for possible fractional pixels at bottom edge
_textSize.height += 1;
}
if (_verticalAlignment === CPCenterVerticalTextAlignment)
{
// Since we added +1 px height above to show fractional pixels on the bottom, we have to remove that when calculating vertical centre.
textRectY = textRectY + (textRectHeight - _textSize.height + 1.0) / 2.0;
textRectHeight = _textSize.height;
}
if (_verticalAlignment === CPCenterVerticalTextAlignment)
{
// Since we added +1 px height above to show fractional pixels on the bottom, we have to remove that when calculating vertical centre.
textRectY = textRectY + (textRectHeight - _textSize.height + 1.0) / 2.0;
textRectHeight = _textSize.height;
}
else //if (_verticalAlignment === CPBottomVerticalTextAlignment)
{
textRectY = textRectY + textRectHeight - _textSize.height;
textRectHeight = _textSize.height;
else //if (_verticalAlignment === CPBottomVerticalTextAlignment)
{
textRectY = textRectY + textRectHeight - _textSize.height;
textRectHeight = _textSize.height;
}
}
}
@@ -740,7 +749,7 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
- (void)sizeToFit
{
var size = CGSizeMakeZero();
var size = _CGSizeMakeZero();
if ((_imagePosition !== CPNoImage) && _image)
{
@@ -781,4 +790,13 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
[self setFrameSize:size];
}
- (void)setFrameSize:(CGSize)aSize
{
// If we're applying line breaks the height of the text size might change as a result of the bounds changing.
if ((_lineBreakMode === CPLineBreakByCharWrapping || _lineBreakMode === CPLineBreakByWordWrapping) && aSize.width !== [self frameSize].width)
_textSize = nil;
[super setFrameSize:aSize];
}
@end
+44 -1
View File
@@ -27,7 +27,10 @@
_CPToolTipWindowMask = 1 << 27;
var _CPToolTipHeight = 24.0,
_CPToolTipFontSize = 11.0;
_CPToolTipFontSize = 11.0,
_CPToolTipDelay = 1.0,
_CPToolTipCurrentToolTip,
_CPToolTipCurrentToolTipTimer;
/*! @ingroup appkit
This is a basic tooltip that behaves mostly like Cocoa ones.
@@ -41,6 +44,46 @@ var _CPToolTipHeight = 24.0,
#pragma mark -
#pragma mark Class Methods
/*! @ignore
Invalidate any scheduled tooltips, or hide any visible one
*/
+ (void)invalidateCurrentToolTipIfNeeded
{
if (_CPToolTipCurrentToolTipTimer)
{
[_CPToolTipCurrentToolTipTimer invalidate];
_CPToolTipCurrentToolTipTimer = nil;
}
if (_CPToolTipCurrentToolTip)
{
[_CPToolTipCurrentToolTip close];
_CPToolTipCurrentToolTip = nil;
}
}
/*! @ignore
Schedule a tooltip for the given view
@param aView the view that might display the tooltip
*/
+ (void)scheduleToolTipForView:(CPView)aView
{
if (![aView toolTip] || ![[aView toolTip] length])
return;
[_CPToolTip invalidateCurrentToolTipIfNeeded];
var callbackFunction = function() {
[_CPToolTip invalidateCurrentToolTipIfNeeded];
_CPToolTipCurrentToolTip = [_CPToolTip toolTipWithString:[aView toolTip]];
};
_CPToolTipCurrentToolTipTimer = [CPTimer scheduledTimerWithTimeInterval:_CPToolTipDelay
callback:callbackFunction
repeats:NO];
}
/*! Returns an initialized _CPToolTip with the given text and attach it to given view.
@param aString the content of the tooltip
*/
+12
View File
@@ -74,6 +74,18 @@ CPPointCreateCopy = CGPointMakeCopy;
*/
CPPointEqualToPoint = CGPointEqualToPoint;
/*!
Tests whether the CGPoint is contained by the CGRect.
@group CGPoint
@param aPoint the CGPoint to check
@param aRect the CGRect to check
@return BOOL \c YES if the rect contains the point.
*/
CPPointInRect = function(aPoint, aRect)
{
return CGRectContainsPoint(aRect, aPoint)
};
/*!
Test whether the two CGRects have the same origin and size
@group CGRect
+11 -13
View File
@@ -26,11 +26,9 @@ CPLogRegister(CPLogConsole);
- (void)awakeFromCib
{
var contentView = [theWindow contentView];
var contentView = [theWindow contentView],
notWrongItem = [Item new];
//create our non ui objects
var notWrongItem = [Item new];
[notWrongItem setRightOrWrong:"also right"];
itemsArray = [[Item new], notWrongItem];
@@ -104,8 +102,7 @@ CPLogRegister(CPLogConsole);
{
// bind array controller to self's itemsArray
[arrayController bind:@"contentArray" toObject:self
withKeyPath:@"itemsArray" options:nil];
[arrayController bind:@"contentArray" toObject:self withKeyPath:@"itemsArray" options:nil];
// bind the total field -- no options on this one
[totalCountField bind:CPValueBinding toObject:arrayController
@@ -113,13 +110,14 @@ CPLogRegister(CPLogConsole);
var bindingOptions = [CPDictionary dictionary];
//[bindingOptions setObject:@"No Name" forKey:@"NSNullPlaceholder"];
[selectedNameField bind: @"value" toObject:arrayController
withKeyPath:@"selection.name" options:bindingOptions];
[selectedNameField bind:CPValueBinding toObject:arrayController
withKeyPath:@"selection.name" options:bindingOptions];
// binding for "name" column
var tableColumn = [tableView tableColumnWithIdentifier:@"name"],
bindingOptions = [CPDictionary dictionary];
[tableColumn bind:@"value" toObject: arrayController
bindingOptions = [CPDictionary dictionary];
[tableColumn bind:CPValueBinding toObject:arrayController
withKeyPath:@"arrangedObjects.name" options:bindingOptions];
@@ -129,13 +127,13 @@ CPLogRegister(CPLogConsole);
//[bindingOptions removeObjectForKey:@"NSNullPlaceholder"];
//[bindingOptions setObject:YES
// forKey:CPValidatesImmediatelyBindingOption];
[selectedPriceField bind:@"value" toObject: arrayController
[selectedPriceField bind:CPValueBinding toObject: arrayController
withKeyPath:@"selection.price" options:bindingOptions];
// binding for "price" column
tableColumn = [tableView tableColumnWithIdentifier:@"price"];
bindingOptions = [CPDictionary dictionary];
[tableColumn bind:@"value" toObject: arrayController
[tableColumn bind:CPValueBinding toObject:arrayController
withKeyPath:@"arrangedObjects.price" options:bindingOptions];
tableColumn = [tableView tableColumnWithIdentifier:@"all right"];
@@ -215,4 +213,4 @@ CPLogRegister(CPLogConsole);
return aValue == "wrong" ? "right" : aValue;
}
@end
@end
File diff suppressed because one or more lines are too long
+91 -113
View File
@@ -1,26 +1,26 @@
<?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">11D50d</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">568.00</string>
<int key="IBDocument.SystemTarget">1080</int>
<string key="IBDocument.SystemVersion">12C60</string>
<string key="IBDocument.InterfaceBuilderVersion">2844</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">2844</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSTextField</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
<string>NSTextFieldCell</string>
<string>NSSliderCell</string>
<string>NSButton</string>
<string>NSButtonCell</string>
<string>NSCustomObject</string>
<string>NSMatrix</string>
<string>NSSlider</string>
<string>NSButtonCell</string>
<string>NSButton</string>
<string>NSCustomObject</string>
<string>NSSliderCell</string>
<string>NSTextField</string>
<string>NSTextFieldCell</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -61,7 +61,7 @@
<reference key="NSNextKeyView" ref="225469319"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSliderCell" key="NSCell" id="1024364993">
<int key="NSCellFlags">-2079981824</int>
<int key="NSCellFlags">-2080112384</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport">
@@ -79,6 +79,7 @@
<bool key="NSAllowsTickMarkValuesOnly">NO</bool>
<bool key="NSVertical">NO</bool>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSTextField" id="225469319">
<reference key="NSNextResponder" ref="161598483"/>
@@ -89,7 +90,7 @@
<reference key="NSNextKeyView" ref="244990043"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="771311359">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags">-1804599231</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport" id="394344788">
@@ -118,6 +119,7 @@
</object>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="917693159">
<reference key="NSNextResponder" ref="161598483"/>
@@ -125,23 +127,23 @@
<string key="NSFrame">{{381, 12}, {80, 32}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="193918884">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Close</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="917693159"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="503115995">
<reference key="NSNextResponder" ref="161598483"/>
@@ -153,19 +155,20 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="387916657">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Modal Window</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="503115995"/>
<int key="NSButtonFlags">-2038284033</int>
<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="368830815">
<reference key="NSNextResponder" ref="161598483"/>
@@ -177,19 +180,20 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="17045191">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Sheet</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="368830815"/>
<int key="NSButtonFlags">-2038284033</int>
<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="666980504">
<reference key="NSNextResponder" ref="161598483"/>
@@ -201,19 +205,20 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="549512143">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Window</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="666980504"/>
<int key="NSButtonFlags">-2038284033</int>
<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="223206700">
<reference key="NSNextResponder" ref="161598483"/>
@@ -225,19 +230,20 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="202127501">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Modal Sheet</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="223206700"/>
<int key="NSButtonFlags">-2038284033</int>
<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="968632972">
<reference key="NSNextResponder" ref="161598483"/>
@@ -249,19 +255,20 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="895163260">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Alert Sheet</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="968632972"/>
<int key="NSButtonFlags">-2038284033</int>
<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="821769865">
<reference key="NSNextResponder" ref="161598483"/>
@@ -273,19 +280,20 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="119441282">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Close Parent Too</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="821769865"/>
<int key="NSButtonFlags">-2038284033</int>
<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="244990043">
<reference key="NSNextResponder" ref="161598483"/>
@@ -297,19 +305,20 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="280494721">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Chain Sheets</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="244990043"/>
<int key="NSButtonFlags">-2038284033</int>
<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="133258452">
<reference key="NSNextResponder" ref="161598483"/>
@@ -321,13 +330,13 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="220534627">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">orderOut: after endSheet:</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="133258452"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage" id="757628530">
<string key="NSClassName">NSImage</string>
@@ -341,6 +350,7 @@
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="1070361803">
<reference key="NSNextResponder" ref="161598483"/>
@@ -352,13 +362,13 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="858583142">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Shade Window View of Non-CIB Windows</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="1070361803"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="757628530"/>
<reference key="NSAlternateImage" ref="375806730"/>
@@ -367,6 +377,7 @@
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="945251289">
<reference key="NSNextResponder" ref="161598483"/>
@@ -378,13 +389,13 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1032816">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Shade Content View of Non-CIB Window</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="945251289"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="757628530"/>
<reference key="NSAlternateImage" ref="375806730"/>
@@ -393,6 +404,7 @@
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="671904505">
<reference key="NSNextResponder" ref="161598483"/>
@@ -404,13 +416,13 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="885506522">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Shade Parent Window on windowWillBeginSheet:</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="671904505"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="757628530"/>
<reference key="NSAlternateImage" ref="375806730"/>
@@ -419,6 +431,7 @@
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="816373959">
<reference key="NSNextResponder" ref="161598483"/>
@@ -426,17 +439,16 @@
<string key="NSFrame">{{193, 268}, {174, 18}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="26730683">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPTitledWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="816373959"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="757628530"/>
<reference key="NSAlternateImage" ref="375806730"/>
@@ -445,6 +457,7 @@
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="893839534">
<reference key="NSNextResponder" ref="161598483"/>
@@ -456,13 +469,13 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="497880742">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPClosableWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="893839534"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="757628530"/>
<reference key="NSAlternateImage" ref="375806730"/>
@@ -471,6 +484,7 @@
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSMatrix" id="531109111">
<reference key="NSNextResponder" ref="161598483"/>
@@ -481,17 +495,18 @@
<reference key="NSNextKeyView" ref="968632972"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSNumRows">5</int>
<int key="NSNumCols">1</int>
<array class="NSMutableArray" key="NSCells">
<object class="NSButtonCell" id="552182731">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CIB Window</string>
<reference key="NSSupport" ref="394344788"/>
<reference key="NSControlView" ref="531109111"/>
<int key="NSTag">1</int>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">0</int>
<object class="NSButtonImageSource" key="NSAlternateImage" id="680600750">
<string key="NSImageName">NSRadioButton</string>
@@ -502,13 +517,13 @@
<int key="NSPeriodicInterval">25</int>
</object>
<object class="NSButtonCell" id="268094245">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPHUDBackgroundWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<reference key="NSControlView" ref="531109111"/>
<int key="NSTag">2</int>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">0</int>
<object class="NSImage" key="NSNormalImage">
<int key="NSImageFlags">549453824</int>
@@ -557,39 +572,39 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSPeriodicInterval">75</int>
</object>
<object class="NSButtonCell" id="569365394">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPBorderlessWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<reference key="NSControlView" ref="531109111"/>
<int key="NSTag">3</int>
<int key="NSButtonFlags">1211912703</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>
<object class="NSButtonCell" id="755250605">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPTexturedBackgroundWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<reference key="NSControlView" ref="531109111"/>
<int key="NSTag">4</int>
<int key="NSButtonFlags">1211912703</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>
<object class="NSButtonCell" id="830766462">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPDocModalWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<reference key="NSControlView" ref="531109111"/>
<int key="NSTag">5</int>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">0</int>
<reference key="NSAlternateImage" ref="680600750"/>
<int key="NSPeriodicDelay">400</int>
@@ -601,11 +616,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSMatrixFlags">1151868928</int>
<string key="NSCellClass">NSActionCell</string>
<object class="NSButtonCell" key="NSProtoCell" id="510263560">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Radio</string>
<reference key="NSSupport" ref="394344788"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">0</int>
<object class="NSImage" key="NSNormalImage">
<int key="NSImageFlags">549453824</int>
@@ -669,17 +684,16 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSFrame">{{192, 228}, {210, 18}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="920567219">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPMiniaturizableWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="583986702"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="757628530"/>
<reference key="NSAlternateImage" ref="375806730"/>
@@ -688,6 +702,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="132928531">
<reference key="NSNextResponder" ref="161598483"/>
@@ -695,17 +710,16 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSFrame">{{192, 208}, {180, 18}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="479229106">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPResizableWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="132928531"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="757628530"/>
<reference key="NSAlternateImage" ref="375806730"/>
@@ -714,6 +728,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSTextField" id="772963208">
<reference key="NSNextResponder" ref="161598483"/>
@@ -726,7 +741,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSAntiCompressionPriority">{250, 750}</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="612486558">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">272629760</int>
<string key="NSContents">It is not specified if endSheet: or orderOut: on sheet should be called first. However, cannot call orderOut: after endSheet: when chaining.</string>
<object class="NSFont" key="NSSupport">
@@ -744,6 +759,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="NSColor" ref="170726192"/>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
<string key="NSFrameSize">{468, 425}</string>
@@ -762,13 +778,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="725655611">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">CPTitledWindowMask</string>
<reference key="NSSupport" ref="394344788"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="147975559"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="757628530"/>
<reference key="NSAlternateImage" ref="375806730"/>
@@ -777,6 +793,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -1377,50 +1394,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="IBPartialClassDescription">
<string key="className">SheetWindowController</string>
<string key="superclassName">NSWindowController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="newAlertSheet:">id</string>
<string key="newColorPanelSheet:">id</string>
<string key="newModalSheet:">id</string>
<string key="newModalWindow:">id</string>
<string key="newOpenPanelSheet:">id</string>
<string key="newSavePanelSheet:">id</string>
<string key="newSheet:">id</string>
<string key="newWindow:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="newAlertSheet:">
<string key="name">newAlertSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="newColorPanelSheet:">
<string key="name">newColorPanelSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="newModalSheet:">
<string key="name">newModalSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="newModalWindow:">
<string key="name">newModalWindow:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="newOpenPanelSheet:">
<string key="name">newOpenPanelSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="newSavePanelSheet:">
<string key="name">newSavePanelSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="newSheet:">
<string key="name">newSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="newWindow:">
<string key="name">newWindow:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="_altCloseButton">NSButton</string>
<string key="_closableMaskButton">NSButton</string>
@@ -1432,8 +1405,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="_shadeContentView">NSButton</string>
<string key="_shadeParentWindow">NSButton</string>
<string key="_shadeWindowView">NSButton</string>
<string key="_sheetWindowHackCheckbox">NSButton</string>
<string key="_titledMaskButton">NSButton</string>
<string key="_windowTypeMatrix">NSMatrix</string>
<string key="_windowTypeMatrix">CPRadioGroup</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="_altCloseButton">
@@ -1476,13 +1450,17 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="name">_shadeWindowView</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo" key="_sheetWindowHackCheckbox">
<string key="name">_sheetWindowHackCheckbox</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo" key="_titledMaskButton">
<string key="name">_titledMaskButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo" key="_windowTypeMatrix">
<string key="name">_windowTypeMatrix</string>
<string key="candidateClassName">NSMatrix</string>
<string key="candidateClassName">CPRadioGroup</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -126,11 +126,11 @@
- (SheetWindowController)allocController
{
CPLog.debug("[%@ %@] groupClass=%@", [self class], _cmd,
[[[[[_windowTypeMatrix subviews] objectAtIndex:0] radioGroup] selectedRadio] tag]);
[[_windowTypeMatrix selectedRadio] tag]);
var type = 1;
if (_windowTypeMatrix)
type = [[[[[_windowTypeMatrix subviews] objectAtIndex:0] radioGroup] selectedRadio] tag];
type = [[_windowTypeMatrix selectedRadio] tag];
var styleMask = 0;
if ([_titledMaskButton state])
File diff suppressed because one or more lines are too long
@@ -46,7 +46,7 @@
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">7</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{100, 541}, {380, 253}}</string>
<string key="NSWindowRect">{{200, 500}, {380, 253}}</string>
<int key="NSWTFlags">1954021376</int>
<string key="NSWindowTitle">CPButton Image Test</string>
<string key="NSWindowClass">NSWindow</string>
@@ -487,7 +487,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="65589413"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
@@ -497,7 +497,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="NSWindowTemplate" id="82286685">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{100, 400}, {318, 85}}</string>
<string key="NSWindowRect">{{200, 1000}, {318, 85}}</string>
<int key="NSWTFlags">611844096</int>
<string key="NSWindowTitle">Continuous Button Test</string>
<string key="NSWindowClass">NSWindow</string>
@@ -578,6 +578,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSFrame">{{126, 20}, {175, 17}}</string>
<reference key="NSSuperview" ref="104258291"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="327559063">
<int key="NSCellFlags">68157504</int>
@@ -596,14 +597,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="443079749"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSWindowTemplate" id="1058741522">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{500, 639}, {271, 156}}</string>
<string key="NSWindowRect">{{1000, 1000}, {271, 156}}</string>
<int key="NSWTFlags">611845120</int>
<string key="NSWindowTitle">CPButton Button Type Test</string>
<string key="NSWindowClass">NSWindow</string>
@@ -694,6 +695,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSFrame">{{25, 12}, {220, 32}}</string>
<reference key="NSSuperview" ref="491587447"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="723211816">
@@ -719,21 +721,21 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="NSNextKeyView" ref="996741385"/>
<string key="NSReuseIdentifierKey">_NS:20</string>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSWindowTemplate" id="740013081">
<int key="NSWindowStyleMask">7</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{500, 380}, {480, 225}}</string>
<string key="NSWindowRect">{{1000, 500}, {480, 220}}</string>
<int key="NSWTFlags">611845120</int>
<string key="NSWindowTitle">Monkey Button Test</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="925694185">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSButton" id="348249275">
@@ -741,6 +743,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{147, 142}, {186, 32}}</string>
<reference key="NSSuperview" ref="925694185"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="663776152"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -781,6 +784,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{16, 72}, {137, 18}}</string>
<reference key="NSSuperview" ref="1061622133"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="429511406"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">2</int>
@@ -812,6 +816,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{16, 52}, {152, 18}}</string>
<reference key="NSSuperview" ref="1061622133"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="309079776"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">1</int>
@@ -839,6 +844,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{16, 32}, {172, 18}}</string>
<reference key="NSSuperview" ref="1061622133"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="192218825"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">4</int>
@@ -866,6 +872,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{16, 12}, {218, 18}}</string>
<reference key="NSSuperview" ref="1061622133"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="764599791"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">8</int>
@@ -891,12 +898,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</array>
<string key="NSFrame">{{1, 1}, {220, 98}}</string>
<reference key="NSSuperview" ref="329397599"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="938552675"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
</object>
</array>
<string key="NSFrame">{{17, 16}, {222, 114}}</string>
<reference key="NSSuperview" ref="925694185"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1061622133"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSOffsets">{0, 0}</string>
@@ -935,6 +944,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{16, 72}, {137, 18}}</string>
<reference key="NSSuperview" ref="523602551"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="333498466"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">2</int>
@@ -962,6 +972,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{16, 52}, {152, 18}}</string>
<reference key="NSSuperview" ref="523602551"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="563784272"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">1</int>
@@ -989,6 +1000,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{16, 32}, {172, 18}}</string>
<reference key="NSSuperview" ref="523602551"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="972837708"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">4</int>
@@ -1016,6 +1028,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{16, 12}, {218, 18}}</string>
<reference key="NSSuperview" ref="523602551"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">8</int>
<bool key="NSEnabled">YES</bool>
@@ -1040,12 +1054,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</array>
<string key="NSFrame">{{1, 1}, {220, 98}}</string>
<reference key="NSSuperview" ref="764599791"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="142854558"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
</object>
</array>
<string key="NSFrame">{{241, 16}, {222, 114}}</string>
<reference key="NSSuperview" ref="925694185"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="523602551"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSOffsets">{0, 0}</string>
@@ -1071,6 +1087,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{332, 152}, {131, 17}}</string>
<reference key="NSSuperview" ref="925694185"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="329397599"/>
<string key="NSReuseIdentifierKey">_NS:1505</string>
<bool key="NSEnabled">YES</bool>
@@ -1091,6 +1108,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 181}, {138, 32}}</string>
<reference key="NSSuperview" ref="925694185"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="790581019"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -1117,6 +1135,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{307, 189}, {131, 17}}</string>
<reference key="NSSuperview" ref="925694185"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="348249275"/>
<string key="NSReuseIdentifierKey">_NS:1505</string>
<bool key="NSEnabled">YES</bool>
@@ -1133,11 +1152,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
<string key="NSFrameSize">{480, 225}</string>
<string key="NSFrameSize">{480, 220}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="51017561"/>
<string key="NSReuseIdentifierKey">_NS:20</string>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
@@ -2044,6 +2065,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="1197.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1207.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1208.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="1210.IBNSWindowAutoPositionCentersHorizontal"/>
<boolean value="NO" key="1210.IBNSWindowAutoPositionCentersVertical"/>
<string key="1210.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1210.IBWindowTemplateEditedContentRect">{{502, 1195}, {271, 156}}</string>
<boolean value="YES" key="1210.NSWindowTemplate.visibleAtLaunch"/>
@@ -2056,6 +2079,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="1217.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1218.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1219.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="1224.IBNSWindowAutoPositionCentersHorizontal"/>
<boolean value="NO" key="1224.IBNSWindowAutoPositionCentersVertical"/>
<string key="1224.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1224.IBWindowTemplateEditedContentRect">{{502, 943}, {480, 210}}</string>
<boolean value="YES" key="1224.NSWindowTemplate.visibleAtLaunch"/>
@@ -2098,7 +2123,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">1269</int>
<int key="maxID">1271</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
File diff suppressed because one or more lines are too long
@@ -2,39 +2,36 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10J3210</string>
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<string key="IBDocument.SystemVersion">12C60</string>
<string key="IBDocument.InterfaceBuilderVersion">2843</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">1306</string>
<string key="NS.object.0">2843</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSScroller</string>
<string>NSTableHeaderView</string>
<string>NSScrollView</string>
<string>NSTextFieldCell</string>
<string>NSButtonCell</string>
<string>NSImageCell</string>
<string>NSTableView</string>
<string>NSCustomObject</string>
<string>NSImageCell</string>
<string>NSLevelIndicatorCell</string>
<string>NSScrollView</string>
<string>NSScroller</string>
<string>NSTableColumn</string>
<string>NSTableHeaderView</string>
<string>NSTableView</string>
<string>NSTextFieldCell</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
<string>NSLevelIndicatorCell</string>
<string>NSTableColumn</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -55,6 +52,7 @@
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
@@ -78,21 +76,21 @@
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="347610108"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<bool key="NSControlAllowsExpansionToolTips">YES</bool>
<object class="NSTableHeaderView" key="NSHeaderView" id="393525317">
<reference key="NSNextResponder" ref="471528550"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{644, 17}</string>
<reference key="NSSuperview" ref="471528550"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="167646100"/>
<reference key="NSNextKeyView" ref="331394667"/>
<reference key="NSTableView" ref="86489736"/>
</object>
<object class="_NSCornerView" key="NSCornerView" id="167646100">
<reference key="NSNextResponder" ref="1048514227"/>
<object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{502, 0}, {16, 17}}</string>
<reference key="NSSuperview" ref="1048514227"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="331394667"/>
</object>
<object class="NSMutableArray" key="NSTableColumns">
@@ -103,13 +101,13 @@
<double key="NSMinWidth">10</double>
<double key="NSMaxWidth">3.0282346638528862e+53</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags2">2048</int>
<string key="NSContents">ImageView</string>
<object class="NSFont" key="NSSupport" id="26">
<string key="NSName">LucidaGrande</string>
<int key="NSCellFlags">75497536</int>
<int key="NSCellFlags2">134219776</int>
<string key="NSContents">Image</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">Georgia</string>
<double key="NSSize">11</double>
<int key="NSfFlags">3100</int>
<int key="NSfFlags">16</int>
</object>
<object class="NSColor" key="NSBackgroundColor" id="676350359">
<int key="NSColorSpace">6</int>
@@ -131,13 +129,8 @@
</object>
</object>
<object class="NSImageCell" key="NSDataCell" id="1016771331">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">134217728</int>
<int key="NSCellFlags2">33554432</int>
<object class="NSFont" key="NSSupport" id="390959245">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<int key="NSAlign">0</int>
<int key="NSScale">0</int>
<int key="NSStyle">0</int>
@@ -154,10 +147,14 @@
<double key="NSMinWidth">40</double>
<double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags">75497536</int>
<int key="NSCellFlags2">2048</int>
<string key="NSContents">Column 1</string>
<reference key="NSSupport" ref="26"/>
<object class="NSFont" key="NSSupport" id="26">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">11</double>
<int key="NSfFlags">3100</int>
</object>
<object class="NSColor" key="NSBackgroundColor" id="1073356944">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
@@ -165,10 +162,14 @@
<reference key="NSTextColor" ref="678139720"/>
</object>
<object class="NSTextFieldCell" key="NSDataCell" id="279840144">
<int key="NSCellFlags">337772096</int>
<int key="NSCellFlags">337641536</int>
<int key="NSCellFlags2">2048</int>
<string key="NSContents">Text Cell</string>
<reference key="NSSupport" ref="390959245"/>
<object class="NSFont" key="NSSupport" id="390959245">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="86489736"/>
<object class="NSColor" key="NSBackgroundColor" id="979654510">
<int key="NSColorSpace">6</int>
@@ -195,19 +196,23 @@
<double key="NSMinWidth">40</double>
<double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags2">2048</int>
<int key="NSCellFlags">75497536</int>
<int key="NSCellFlags2">67110912</int>
<string key="NSContents">Two</string>
<reference key="NSSupport" ref="26"/>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande-Bold</string>
<double key="NSSize">20</double>
<int key="NSfFlags">16</int>
</object>
<reference key="NSBackgroundColor" ref="1073356944"/>
<reference key="NSTextColor" ref="678139720"/>
</object>
<object class="NSTextFieldCell" key="NSDataCell" id="642682655">
<int key="NSCellFlags">337772096</int>
<int key="NSCellFlags2">2048</int>
<int key="NSCellFlags">337641536</int>
<int key="NSCellFlags2">67110912</int>
<string key="NSContents">Text Cell</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande</string>
<string key="NSName">TimesNewRomanPSMT</string>
<double key="NSSize">20</double>
<int key="NSfFlags">16</int>
</object>
@@ -226,24 +231,24 @@
<reference key="NSTableView" ref="86489736"/>
</object>
<object class="NSTableColumn" id="467346610">
<double key="NSWidth">81</double>
<double key="NSWidth">94.078125</double>
<double key="NSMinWidth">10</double>
<double key="NSMaxWidth">3.4028234663852885e+54</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags">75497536</int>
<int key="NSCellFlags2">2048</int>
<string key="NSContents">Checkbox</string>
<string key="NSContents">Checkbox really long</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSBackgroundColor" ref="676350359"/>
<reference key="NSTextColor" ref="678139720"/>
</object>
<object class="NSButtonCell" key="NSDataCell" id="271362548">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Check</string>
<reference key="NSSupport" ref="390959245"/>
<reference key="NSControlView" ref="86489736"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
@@ -263,11 +268,11 @@
<reference key="NSTableView" ref="86489736"/>
</object>
<object class="NSTableColumn" id="991776537">
<double key="NSWidth">105</double>
<double key="NSWidth">92</double>
<double key="NSMinWidth">10</double>
<double key="NSMaxWidth">3.4028234663852885e+54</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags">75497536</int>
<int key="NSCellFlags2">2048</int>
<string key="NSContents">Level Indicator</string>
<reference key="NSSupport" ref="26"/>
@@ -275,7 +280,7 @@
<reference key="NSTextColor" ref="678139720"/>
</object>
<object class="NSLevelIndicatorCell" key="NSDataCell" id="801202458">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">0</int>
<reference key="NSSupport" ref="390959245"/>
<reference key="NSControlView" ref="86489736"/>
@@ -313,6 +318,7 @@
<int key="NSDraggingSourceMaskForNonLocal">0</int>
<bool key="NSAllowsTypeSelect">YES</bool>
<int key="NSTableViewDraggingDestinationStyle">0</int>
<int key="NSTableViewGroupRowStyle">1</int>
</object>
</object>
<string key="NSFrame">{{1, 17}, {644, 290}}</string>
@@ -330,6 +336,7 @@
<reference key="NSSuperview" ref="1048514227"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="480583225"/>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<reference key="NSTarget" ref="1048514227"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.94827586206896552</double>
@@ -337,14 +344,15 @@
<object class="NSScroller" id="480583225">
<reference key="NSNextResponder" ref="1048514227"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, 292}, {516, 15}}</string>
<string key="NSFrame">{{1, 291}, {644, 16}}</string>
<reference key="NSSuperview" ref="1048514227"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="1048514227"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.99382716049382713</double>
<double key="NSPercent">0.94152046783625731</double>
</object>
<object class="NSClipView" id="471528550">
<reference key="NSNextResponder" ref="1048514227"/>
@@ -361,28 +369,30 @@
<reference key="NSBGColor" ref="979654510"/>
<int key="NScvFlags">4</int>
</object>
<reference ref="167646100"/>
</object>
<string key="NSFrame">{{20, 20}, {646, 308}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="471528550"/>
<int key="NSsFlags">562</int>
<int key="NSsFlags">133682</int>
<reference key="NSVScroller" ref="347610108"/>
<reference key="NSHScroller" ref="480583225"/>
<reference key="NSContentView" ref="331394667"/>
<reference key="NSHeaderClipView" ref="471528550"/>
<reference key="NSCornerView" ref="167646100"/>
<bytes key="NSScrollAmts">QSAAAEEgAABCNAAAQjQAAA</bytes>
<double key="NSMinMagnification">0.25</double>
<double key="NSMaxMagnification">4</double>
<double key="NSMagnification">1</double>
</object>
</object>
<string key="NSFrame">{{7, 11}, {686, 348}}</string>
<string key="NSFrameSize">{686, 348}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1048514227"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMaxSize">{1e+13, 1e+13}</string>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
<object class="NSCustomObject" id="635946545">
<string key="NSClassName">AppController</string>
@@ -421,7 +431,9 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<object class="NSArray" key="object" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
@@ -582,13 +594,14 @@
<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.IBWindowTemplateEditedContentRect</string>
<string>371.NSWindowTemplate.visibleAtLaunch</string>
<string>371.editorWindowContentRectSynchronizationRect</string>
<string>372.IBPluginDependency</string>
<string>450.IBPluginDependency</string>
<string>489.IBPluginDependency</string>
<string>490.IBPluginDependency</string>
<string>491.IBPluginDependency</string>
@@ -598,18 +611,25 @@
<string>495.IBPluginDependency</string>
<string>496.IBPluginDependency</string>
<string>497.IBPluginDependency</string>
<string>501.IBPluginDependency</string>
<string>503.IBPluginDependency</string>
<string>504.IBPluginDependency</string>
<string>506.IBPluginDependency</string>
<string>508.IBPluginDependency</string>
<string>510.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>{{370, 244}, {558, 348}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{370, 244}, {558, 348}}</string>
<integer value="1"/>
<string>{{33, 99}, {480, 360}}</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>
+9 -2
View File
@@ -136,10 +136,10 @@ function NSCompatibleClassName(aClassName, asPointer)
if (aClassName === "var" || aClassName === "id")
return "id";
var suffix = aClassName.substr(0, 2),
var prefix = aClassName.substr(0, 2),
asterisk = asPointer ? "*" : "";
if (suffix !== "CP")
if (prefix !== "CP")
return aClassName + asterisk;
var NSClassName = "NS" + aClassName.substr(2);
@@ -147,9 +147,16 @@ function NSCompatibleClassName(aClassName, asPointer)
if (NSClasses[NSClassName])
return NSClassName + asterisk;
if (ReplacementClasses[aClassName])
return ReplacementClasses[aClassName] + asterisk;
return aClassName + asterisk;
}
var ReplacementClasses = {
"CPWebView": "WebView"
};
var NSClasses = {
"NSAffineTransform" : YES,
"NSAppleEventDescriptor" : YES,
+1
View File
@@ -82,6 +82,7 @@ var NSMatrixRadioModeMask = 0x40000000,
[self setBackgroundColor:backgroundColor];
self.isa = [CPView class];
NIB_CONNECTION_EQUIVALENCY_TABLE[[self UID]] = radioGroup;
}
else
{
+2 -1
View File
@@ -90,7 +90,8 @@
headerView = [[_CPTableColumnHeaderView alloc] initWithFrame:CPRectMakeZero()];
[headerView setStringValue:[headerCell objectValue]];
[headerView setValue:[dataViewCell alignment] forThemeAttribute:@"text-alignment"];
[headerView setFont:[headerCell font]];
[headerView setAlignment:[headerCell alignment]];
[self setHeaderView:headerView];
+14 -9
View File
@@ -23,15 +23,20 @@
@import <AppKit/_CPCibWindowTemplate.j>
var NSBorderlessWindowMask = 0x00,
NSTitledWindowMask = 0x01,
NSClosableWindowMask = 0x02,
NSMiniaturizableWindowMask = 0x04,
NSResizableWindowMask = 0x08,
NSUtilityWindowMask = 0x10,
NSDocModalWindowMask = 0x40,
NSTexturedBackgroundWindowMask = 0x100,
NSHUDBackgroundWindowMask = 0x2000,
var NSBorderlessWindowMask = 0x00,
NSTitledWindowMask = 0x01,
NSClosableWindowMask = 0x02,
NSMiniaturizableWindowMask = 0x04,
NSResizableWindowMask = 0x08,
NSUtilityWindowMask = 0x10,
NSDocModalWindowMask = 0x40,
NSTexturedBackgroundWindowMask = 0x100,
NSHUDBackgroundWindowMask = 0x2000,
NSPositionFlexibleRight = 1 << 19,
NSPositionFlexibleLeft = 1 << 20,
NSPositionFlexibleBottom = 1 << 21,
NSPositionFlexibleTop = 1 << 22,
NSAutorecalculatesKeyViewLoopWTFlag = 0x800;
+11 -1
View File
@@ -466,8 +466,18 @@ global.sudo = function(/*Array or String*/ command)
// First try without sudo
command = normalizeCommand(command);
if (OS.system(command + " >/dev/null 2>&1"))
var returnCode = OS.system(command + " >/dev/null 2>&1")
if (returnCode)
{
// if this is set, then disable the use of sudo.
// This is very usefull for CI scripts and stuff like that
if (SYSTEM.env["CAPP_NOSUDO"] == 1)
return returnCode;
return OS.system("sudo -p '\nEnter your admin password: ' " + command);
}
return 0;
};