Merge branch 'master' into scroll_before_focus_text_field

Conflicts:
	AppKit/CPTokenField.j
This commit is contained in:
Martin Carlberg
2012-11-30 14:43:46 +01:00
72 changed files with 5325 additions and 2683 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
+8 -1
View File
@@ -131,7 +131,7 @@ var CPBindingOperationAnd = 0,
if (options)
[_info setObject:options forKey:CPOptionsKey];
[self _updatePlaceholdersWithOptions:options];
[self _updatePlaceholdersWithOptions:options forBinding:aName];
[aDestination addObserver:self forKeyPath:aKeyPath options:CPKeyValueObservingOptionNew context:aBinding];
@@ -321,6 +321,11 @@ var CPBindingOperationAnd = 0,
}
}
- (void)_updatePlaceholdersWithOptions:(CPDictionary)options forBinding:(CPString)aBinding
{
[self _updatePlaceholdersWithOptions:options];
}
- (void)_placeholderForMarker:aMarker
{
var placeholder = _placeholderForMarker[aMarker];
@@ -564,6 +569,8 @@ CPFontNameBinding = @"fontName";
CPFontBoldBinding = @"fontBold";
CPHiddenBinding = @"hidden";
CPFilterPredicateBinding = @"filterPredicate";
CPMaxValueBinding = @"maxValue";
CPMinValueBinding = @"minValue";
CPPredicateBinding = @"predicate";
CPSelectedIndexBinding = @"selectedIndex";
CPSelectedLabelBinding = @"selectedLabel";
+1 -2
View File
@@ -976,8 +976,7 @@ var _CPMenuBarVisible = NO,
for (; index < count; ++index)
{
var item = _items[index],
modifierMask = [item keyEquivalentModifierMask];
var item = _items[index];
if ([anEvent _triggersKeyEquivalent:[item keyEquivalent] withModifierMask:[item keyEquivalentModifierMask]])
{
+8 -1
View File
@@ -234,7 +234,7 @@ Set the behavior of the CPPopover. It can be:
[_attachedWindow setContentView:[_contentViewController view]];
[_attachedWindow positionRelativeToRect:positioningRect ofView:positioningView preferredEdge:preferredEdge];
if (_implementedDelegateMethods & CPPopoverDelegate_popover_didShow_)
if (!_animates && _implementedDelegateMethods & CPPopoverDelegate_popover_didShow_)
[_delegate popoverDidShow:self];
}
@@ -311,6 +311,13 @@ Set the behavior of the CPPopover. It can be:
[_delegate popoverDidClose:self];
}
/*! @ignore */
- (void)attachedWindowDidShow:(_CPAttachedWindow)anAttachedWindow
{
if (_implementedDelegateMethods & CPPopoverDelegate_popover_didShow_)
[_delegate popoverDidShow:self];
}
#pragma mark -
#pragma mark Notifications
+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];
}
+35 -2
View File
@@ -76,6 +76,22 @@
return [CPStepper stepperWithInitialValue:0.0 minValue:0.0 maxValue:59.0];
}
+ (Class)_binderClassForBinding:(CPString)theBinding
{
if (theBinding == CPValueBinding || theBinding == CPMinValueBinding || theBinding == CPMaxValueBinding)
return [_CPStepperValueBinder class];
return [super _binderClassForBinding:theBinding];
}
- (id)_replacementKeyPathForBinding:(CPString)aBinding
{
if (aBinding == CPValueBinding)
return @"doubleValue";
return [super _replacementKeyPathForBinding:aBinding];
}
/*!
Initializes a CPStepper.
@param aFrame the frame of the control
@@ -211,8 +227,7 @@
else
[self setDoubleValue:([self doubleValue] - _increment)];
if (_target && _action && [_target respondsToSelector:_action])
[self sendAction:_action to:_target];
[self sendAction:[self action] to:[self target]];
}
/*!
@@ -250,6 +265,24 @@
@end
@implementation _CPStepperValueBinder : CPBinder
{
}
- (void)_updatePlaceholdersWithOptions:(CPDictionary)options forBinding:(CPString)aBinding
{
var placeholder = (aBinding == CPMaxValueBinding) ? [_source maxValue] : [_source minValue];
[super _updatePlaceholdersWithOptions:options];
[self _setPlaceholder:placeholder forMarker:CPMultipleValuesMarker isDefault:YES];
[self _setPlaceholder:placeholder forMarker:CPNoSelectionMarker isDefault:YES];
[self _setPlaceholder:placeholder forMarker:CPNotApplicableMarker isDefault:YES];
[self _setPlaceholder:placeholder forMarker:CPNullMarker isDefault:YES];
}
@end
var CPStepperMinValue = @"CPStepperMinValue",
CPStepperMaxValue = @"CPStepperMaxValue",
CPStepperValueWraps = @"CPStepperValueWraps",
+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
+23 -7
View File
@@ -222,6 +222,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
SEL _doubleAction;
CPInteger _clickedRow;
CPInteger _clickedColumn;
unsigned _columnAutoResizingStyle;
int _lastTrackedRowIndex;
@@ -324,7 +325,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
*/
- (void)_init
{
_lastSelectedRow = -1;
_lastSelectedRow = _clickedColumn = _clickedRow = -1;
_selectedColumnIndexes = [CPIndexSet indexSet];
_selectedRowIndexes = [CPIndexSet indexSet];
@@ -542,8 +543,12 @@ NOT YET IMPLEMENTED
}
/*
* - clickedColumn
Returns the index of the the column the user clicked to trigger an action, or -1 if no column was clicked.
*/
- (CPInteger)clickedColumn
{
return _clickedColumn;
}
/*!
Returns the index of the the row the user clicked to trigger an action, or -1 if no row was clicked.
@@ -3376,7 +3381,8 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
rowIndex = 0,
rowsCount = rowArray.length;
if (dataViewsForTableColumn) {
if (dataViewsForTableColumn)
{
for (; rowIndex < rowsCount; ++rowIndex)
{
var row = rowArray[rowIndex],
@@ -4190,7 +4196,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
_isSelectingSession = NO;
var CLICK_TIME_DELTA = 1000,
columnIndex,
columnIndex = -1,
column,
rowIndex,
shouldEdit = YES;
@@ -4198,6 +4204,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
if (_implementedDataSourceMethods & CPTableViewDataSource_tableView_writeRowsWithIndexes_toPasteboard_)
{
rowIndex = [self rowAtPoint:aPoint];
if (rowIndex !== -1)
{
if ([_draggedRowIndexes count] > 0)
@@ -4219,12 +4226,15 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|| [self infoForBinding:@"content"]))
{
columnIndex = [self columnAtPoint:lastPoint];
if (columnIndex !== -1)
{
column = _tableColumns[columnIndex];
if ([column isEditable])
{
rowIndex = [self rowAtPoint:aPoint];
if (rowIndex !== -1)
{
if (_implementedDelegateMethods & CPTableViewDelegate_tableView_shouldEditTableColumn_row_)
@@ -4244,6 +4254,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
if ([[CPApp currentEvent] clickCount] === 2 && _doubleAction)
{
_clickedRow = [self rowAtPoint:aPoint];
_clickedColumn = [self columnAtPoint:lastPoint];
[self sendAction:_doubleAction to:_target];
}
}
@@ -4783,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
+19 -7
View File
@@ -490,13 +490,13 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
- (BOOL)becomeFirstResponder
{
#if PLATFORM(DOM)
// FIXME Why do we care about who's the first responder in a different window?
if (CPTextFieldInputOwner && [CPTextFieldInputOwner window] !== [self window])
[[CPTextFieldInputOwner window] makeFirstResponder:nil];
#endif
// As long as we are the first responder we need to monitor the key status of our window.
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidResignKey:) name:CPWindowDidResignKeyNotification object:[self window]];
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidBecomeKey:) name:CPWindowDidBecomeKeyNotification object:[self window]];
[self _setObserveWindowKeyNotifications:YES];
_isEditing = NO;
@@ -616,10 +616,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],
@@ -641,6 +637,9 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
#endif
// When we are no longer the first responder we don't worry about the key status of our window anymore.
[self _setObserveWindowKeyNotifications:NO];
[self _resignFirstKeyResponder];
_isEditing = NO;
@@ -664,7 +663,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
_willBecomeFirstResponderByClick = NO;
[self _updatePlaceholderState];
[self setNeedsLayout];
#if PLATFORM(DOM)
@@ -699,6 +697,20 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
#endif
}
- (void)_setObserveWindowKeyNotifications:(BOOL)shouldObserve
{
if (shouldObserve)
{
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidResignKey:) name:CPWindowDidResignKeyNotification object:[self window]];
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidBecomeKey:) name:CPWindowDidBecomeKeyNotification object:[self window]];
}
else
{
[[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidResignKeyNotification object:[self window]];
[[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidBecomeKeyNotification object:[self window]];
}
}
- (void)_windowDidResignKey:(CPNotification)aNotification
{
if (![[self window] isKeyWindow])
+52 -24
View File
@@ -138,6 +138,11 @@ var CPScrollDestinationNone = 0,
return _autocompleteMenu;
}
- (void)_complete:(_CPAutocompleteMenu)anAutocompleteMenu
{
[self _autocompleteWithEvent:nil];
}
- (void)_autocompleteWithEvent:(CPEvent)anEvent
{
if (![self _inputElement].value && (![_autocompleteMenu contentArray] || ![self hasThemeState:CPThemeStateAutocompleting]))
@@ -307,11 +312,24 @@ var CPScrollDestinationNone = 0,
- (BOOL)becomeFirstResponder
{
#if PLATFORM(DOM)
if (CPTokenFieldInputOwner && [CPTokenFieldInputOwner window] !== [self window])
[[CPTokenFieldInputOwner window] makeFirstResponder:nil];
#endif
// As long as we are the first responder we need to monitor the key status of our window.
[self _setObserveWindowKeyNotifications:YES];
[self scrollRectToVisible:[self bounds]];
if ([[self window] isKeyWindow])
[self _becomeFirstKeyResponder];
return YES;
}
- (void)_becomeFirstKeyResponder
{
[self setThemeState:CPThemeStateEditing];
[self _updatePlaceholderState];
@@ -373,8 +391,6 @@ var CPScrollDestinationNone = 0,
}
#endif
return YES;
}
- (BOOL)resignFirstResponder
@@ -382,9 +398,31 @@ var CPScrollDestinationNone = 0,
if (_preventResign)
return NO;
[self _autocomplete];
// From CPTextField superclass.
[self _setObserveWindowKeyNotifications:NO];
[self _resignFirstKeyResponder];
if (_shouldNotifyTarget)
{
_shouldNotifyTarget = NO;
[self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:nil]];
if ([self sendsActionOnEndEditing])
[self sendAction:[self action] to:[self target]];
}
return YES;
}
- (void)_resignFirstKeyResponder
{
[self unsetThemeState:CPThemeStateEditing];
[self _autocomplete];
[self _updatePlaceholderState];
[self setNeedsLayout];
#if PLATFORM(DOM)
@@ -414,21 +452,6 @@ var CPScrollDestinationNone = 0,
}
#endif
[self _updatePlaceholderState];
[self setNeedsLayout];
if (_shouldNotifyTarget)
{
_shouldNotifyTarget = NO;
[self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:nil]];
if ([self sendsActionOnEndEditing])
[self sendAction:[self action] to:[self target]];
}
return YES;
}
- (void)mouseDown:(CPEvent)anEvent
@@ -634,10 +657,13 @@ var CPScrollDestinationNone = 0,
if (CPTokenFieldInputOwner && CPTokenFieldInputOwner._preventResign)
return false;
if (!CPTokenFieldInputResigning && !CPTokenFieldFocusInput)
if (!CPTokenFieldInputResigning && [[CPTokenFieldInputOwner window] isKeyWindow])
{
[[CPTokenFieldInputOwner window] makeFirstResponder:nil];
return;
// If we lost focus somehow but we're not resigning and we're still in the key window, we'll need to take it back.
window.setTimeout(function()
{
CPTokenFieldDOMInputElement.focus();
}, 0.0);
}
CPTokenFieldHandleBlur(anEvent, CPTokenFieldDOMInputElement);
@@ -975,8 +1001,7 @@ var CPScrollDestinationNone = 0,
var frame = [self frame],
contentView = [_tokenScrollView documentView],
tokens = [self _tokens],
shouldShowAutoComplete = [self hasThemeState:CPThemeStateAutocompleting];
tokens = [self _tokens];
// Hack to make sure we are handling an array
if (![tokens isKindOfClass:[CPArray class]])
@@ -994,6 +1019,9 @@ var CPScrollDestinationNone = 0,
lineHeight = [font defaultLineHeightForFont],
editorInset = [self currentValueForThemeAttribute:@"editor-inset"];
// Put half a spacing above the tokens.
offset.y += CEIL(spaceBetweenTokens.height / 2.0);
// Get the height of a typical token, or a token token if you will.
[tokenToken sizeToFit];
@@ -1093,7 +1121,7 @@ var CPScrollDestinationNone = 0,
}
// Trim off any excess height downwards (in case we shrank).
var scrollHeight = offset.y + tokenHeight + CEIL(spaceBetweenTokens.height / 2.0);
var scrollHeight = offset.y + tokenHeight;
if (_CGRectGetHeight([contentView bounds]) > scrollHeight)
[contentView setFrameSize:_CGSizeMake(_CGRectGetWidth([_tokenScrollView bounds]), scrollHeight)];
+9 -8
View File
@@ -247,7 +247,7 @@ var CPToolbarsByIdentifier = nil,
_window = aWindow;
if (_window)
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_autovalidate) name:_CPWindowDidChangeFirstResponderNotification object:aWindow];
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_autoValidateVisibleItems) name:_CPWindowDidChangeFirstResponderNotification object:aWindow];
}
/*!
@@ -400,14 +400,15 @@ var CPToolbarsByIdentifier = nil,
*/
- (void)validateVisibleItems
{
var toolbarItems = [self visibleItems],
count = [toolbarItems count];
while (count--)
[toolbarItems[count] validate];
[self _validateVisibleItems:NO]
}
- (void)_autovalidate
- (void)_autoValidateVisibleItems
{
[self _validateVisibleItems:YES]
}
- (void)_validateVisibleItems:(BOOL)isAutovalidation
{
var toolbarItems = [self visibleItems],
count = [toolbarItems count];
@@ -415,7 +416,7 @@ var CPToolbarsByIdentifier = nil,
while (count--)
{
var item = [toolbarItems objectAtIndex:count];
if ([item autovalidates])
if (!isAutovalidation || [item autovalidates])
[item validate];
}
}
+6 -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
@@ -3072,6 +3024,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
[self _setupToolTipHandlers];
_toolTip = [aCoder decodeObjectForKey:CPViewToolTipKey];
if (_toolTip)
[self _installToolTipEventHandlers];
+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]);
}
+69 -3
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
@@ -1627,11 +1673,29 @@ CPTexturedBackgroundWindowMask
[self selectPreviousKeyView:self];
else
[self selectNextKeyView:self];
#if PLATFORM(DOM)
// Make sure the browser doesn't try to do its own tab handling.
// This is important or the browser might blur the shared text field or token field input field,
// even that we just moved it to a new first responder.
[[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]
#endif
return;
}
else if ([anEvent charactersIgnoringModifiers] === CPBackTabCharacter)
return [self selectPreviousKeyView:self];
{
var didTabBack = [self selectPreviousKeyView:self];
if (didTabBack)
{
#if PLATFORM(DOM)
// Make sure the browser doesn't try to do its own tab handling.
// This is important or the browser might blur the shared text field or token field input field,
// even that we just moved it to a new first responder.
[[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]
#endif
}
return didTabBack;
}
[[self firstResponder] keyDown:anEvent];
@@ -1792,7 +1856,9 @@ CPTexturedBackgroundWindowMask
*/
- (BOOL)canBecomeKeyWindow
{
return YES;
// In Cocoa only resizable or titled windows return YES here by default. But the main browser window in Cappuccino
// doesn't have these masks even that it's both titled and resizable, so we return YES when isFullPlatformWindow too.
return (_styleMask & CPResizableWindowMask) || (_styleMask & CPResizableWindowMask) || [self isFullPlatformWindow];
}
/*!
+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;
}
-32
View File
@@ -152,38 +152,6 @@ var STANDARD_GRADIENT_HEIGHT = 41.0;
return _CPStandardWindowViewDividerBackgroundColor;
}
- (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
{
var contentRect = [[self class] contentRectForFrameRect:aFrameRect],
theToolbar = [[self window] toolbar];
if ([theToolbar isVisible])
{
var toolbarHeight = CGRectGetHeight([[theToolbar _toolbarView] frame]);
contentRect.origin.y += toolbarHeight;
contentRect.size.height -= toolbarHeight;
}
return contentRect;
}
- (CGRect)frameRectForContentRect:(CGRect)aContentRect
{
var frameRect = [[self class] frameRectForContentRect:aContentRect],
theToolbar = [[self window] toolbar];
if ([theToolbar isVisible])
{
var toolbarHeight = CGRectGetHeight([[theToolbar _toolbarView] frame]);
frameRect.origin.y -= toolbarHeight;
frameRect.size.height += toolbarHeight;
}
return frameRect;
}
- (id)initWithFrame:(CPRect)aFrame styleMask:(unsigned)aStyleMask
{
self = [super initWithFrame:aFrame styleMask:aStyleMask];
+24 -2
View File
@@ -76,12 +76,34 @@ var _CPWindowViewResizeIndicatorImage = nil;
- (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
{
return [[self class] contentRectForFrameRect:aFrameRect];
var contentRect = [[self class] contentRectForFrameRect:aFrameRect],
theToolbar = [[self window] toolbar];
if ([theToolbar isVisible])
{
var toolbarHeight = CGRectGetHeight([[theToolbar _toolbarView] frame]);
contentRect.origin.y += toolbarHeight;
contentRect.size.height -= toolbarHeight;
}
return contentRect;
}
- (CGRect)frameRectForContentRect:(CGRect)aContentRect
{
return [[self class] frameRectForContentRect:aContentRect];
var frameRect = [[self class] frameRectForContentRect:aContentRect],
theToolbar = [[self window] toolbar];
if ([theToolbar isVisible])
{
var toolbarHeight = CGRectGetHeight([[theToolbar _toolbarView] frame]);
frameRect.origin.y -= toolbarHeight;
frameRect.size.height += toolbarHeight;
}
return frameRect;
}
- (id)initWithFrame:(CPRect)aFrame styleMask:(unsigned)aStyleMask
+1 -1
View File
@@ -285,7 +285,7 @@
// Change of document means toolbar items may no longer make sense.
// FIXME: DOCUMENT ARCHITECTURE Should we setToolbar: as well?
[[[self window] toolbar] validateVisibleItems];
[[[self window] toolbar] _autoValidateVisibleItems];
}
- (void)setSupportsMultipleDocuments:(BOOL)shouldSupportMultipleDocuments
+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);
+3 -2
View File
@@ -1028,7 +1028,7 @@ var themedButtonValues = nil,
overrides =
[
[@"bezel-inset", CGInsetMakeZero()],
[@"editor-inset", CGInsetMake(2.0, 0.0, 0.0, 0.0)],
[@"editor-inset", CGInsetMake(3.0, 0.0, 0.0, 0.0)],
// Non-bezeled token field with tokens
[@"content-inset", CGInsetMake(6.0, 8.0, 4.0, 8.0)],
@@ -1037,7 +1037,7 @@ var themedButtonValues = nil,
[@"content-inset", CGInsetMake(7.0, 8.0, 6.0, 8.0), CPTextFieldStatePlaceholder],
// Bezeled token field with tokens
[@"content-inset", CGInsetMake(6.0, 5.0, 4.0, 5.0), CPThemeStateBezeled],
[@"content-inset", CGInsetMake(5.0, 5.0, 4.0, 5.0), CPThemeStateBezeled],
// Bezeled token field with no tokens
[@"content-inset", CGInsetMake(8.0, 8.0, 7.0, 8.0), CPThemeStateBezeled | CPTextFieldStatePlaceholder]
@@ -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],
+14 -1
View File
@@ -31,7 +31,8 @@ CPPopoverAppearanceMinimal = 0;
CPPopoverAppearanceHUD = 1;
var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
_CPAttachedWindow_attachedWindowDidClose_ = 1 << 1;
_CPAttachedWindow_attachedWindowDidClose_ = 1 << 1,
_CPAttachedWindow_attachedWindowDidShow_ = 1 << 2;
/*!
@@ -170,6 +171,9 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
if ([_delegate respondsToSelector:@selector(attachedWindowDidClose:)])
_implementedDelegateMethods |= _CPAttachedWindow_attachedWindowDidClose_;
if ([_delegate respondsToSelector:@selector(attachedWindowDidShow:)])
_implementedDelegateMethods |= _CPAttachedWindow_attachedWindowDidShow_;
}
#pragma mark -
@@ -458,6 +462,15 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
// Because we are watching the -webkit-transform, it will occur now.
[self setCSS3Property:@"Transform" value:@"scale(1)"];
[self setCSS3Property:@"Transition" value:@"-webkit-transform 50ms linear"];
var transitionCompleteFunction = function()
{
_DOMElement.removeEventListener("webkitTransitionEnd", transitionCompleteFunction, YES);
if (_implementedDelegateMethods & _CPAttachedWindow_attachedWindowDidShow_)
[_delegate attachedWindowDidShow:self];
}
_DOMElement.addEventListener("webkitTransitionEnd", transitionCompleteFunction, YES);
};
_DOMElement.addEventListener("webkitTransitionEnd", transitionEndFunction, YES);
+8 -1
View File
@@ -73,6 +73,8 @@ var _CPAutocompleteMenuMaximumHeight = 307;
[tableView setDataSource:self];
[tableView setDelegate:self];
[tableView setTarget:self];
[tableView setAction:@selector(complete:)];
[tableView setAllowsMultipleSelection:NO];
[tableView setHeaderView:nil];
[tableView setCornerView:nil];
@@ -161,7 +163,7 @@ var _CPAutocompleteMenuMaximumHeight = 307;
// TODO Track down why mystery constant is needed to allocate enough width. Scroll view insets?
}
var frameOrigin = [textField convertPoint:origin toView:nil],
var frameOrigin = [[textField window] convertBaseToGlobal:[textField convertPointToBase:origin]],
screenSize = [([CPPlatform isBrowser] ? [_menuWindow platformWindow] : [_menuWindow screen]) visibleFrame].size,
availableWidth = screenSize.width - frameOrigin.x,
availableHeight = screenSize.height - frameOrigin.y,
@@ -251,6 +253,11 @@ var _CPAutocompleteMenuMaximumHeight = 307;
return [contentArray objectAtIndex:row];
}
- (@action)complete:(id)sender
{
[textField _complete:self];
}
@end
+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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+158 -120
View File
@@ -1,26 +1,28 @@
<?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>NSTokenField</string>
<string>NSTokenFieldCell</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -55,13 +57,13 @@
<object class="NSSlider" id="626349312">
<reference key="NSNextResponder" ref="161598483"/>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{116, 54}, {96, 21}}</string>
<string key="NSFrame">{{59, 52}, {96, 21}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<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,17 +81,18 @@
<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"/>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{234, 51}, {96, 22}}</string>
<string key="NSFrame">{{166, 51}, {96, 22}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="244990043"/>
<reference key="NSNextKeyView" ref="393836098"/>
<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">
@@ -97,9 +100,10 @@
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<string key="NSPlaceholderString">CPTextField</string>
<reference key="NSControlView" ref="225469319"/>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSColor" key="NSBackgroundColor">
<object class="NSColor" key="NSBackgroundColor" id="539867213">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textBackgroundColor</string>
@@ -118,6 +122,7 @@
</object>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="917693159">
<reference key="NSNextResponder" ref="161598483"/>
@@ -129,19 +134,20 @@
<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 +159,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 +184,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 +209,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 +234,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 +259,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 +284,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 +309,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 +334,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 +354,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 +366,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 +381,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 +393,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 +408,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 +420,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 +435,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 +443,17 @@
<string key="NSFrame">{{193, 268}, {174, 18}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="893839534"/>
<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 +462,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 +474,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 +489,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 +500,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 +522,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 +577,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 +621,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 +689,17 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSFrame">{{192, 228}, {210, 18}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="132928531"/>
<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 +708,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 +716,17 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSFrame">{{192, 208}, {180, 18}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="133258452"/>
<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 +735,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 +748,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">
@@ -737,13 +759,43 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="772963208"/>
<reference key="NSBackgroundColor" ref="567491004"/>
<object class="NSColor" key="NSTextColor">
<object class="NSColor" key="NSTextColor" id="879929027">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<reference key="NSColor" ref="170726192"/>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSTokenField" id="393836098">
<reference key="NSNextResponder" ref="161598483"/>
<int key="NSvFlags">268</int>
<set class="NSMutableSet" key="NSDragTypes">
<string>NSStringPboardType</string>
</set>
<string key="NSFrame">{{275, 51}, {96, 22}}</string>
<reference key="NSSuperview" ref="161598483"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="244990043"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTokenFieldCell" key="NSCell" id="437001198">
<int key="NSCellFlags">341835776</int>
<int key="NSCellFlags2">0</int>
<reference key="NSSupport" ref="394344788"/>
<string key="NSPlaceholderString">CPTokenField</string>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="393836098"/>
<bool key="NSDrawsBackground">YES</bool>
<reference key="NSBackgroundColor" ref="539867213"/>
<reference key="NSTextColor" ref="879929027"/>
<reference key="NSDelegate" ref="393836098"/>
<double key="NSCompletionDelay">0.0</double>
<int key="NSTokenStyle">0</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSTokenFieldVersion">2</int>
</object>
</array>
<string key="NSFrameSize">{468, 425}</string>
@@ -751,7 +803,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="666980504"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
@@ -762,13 +814,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 +829,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">
@@ -941,6 +994,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">33</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="393836098"/>
<reference key="destination" ref="1001"/>
</object>
<int key="connectionID">226</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -998,8 +1059,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference ref="244990043"/>
<reference ref="917693159"/>
<reference ref="821769865"/>
<reference ref="626349312"/>
<reference ref="225469319"/>
<reference ref="393836098"/>
<reference ref="626349312"/>
</array>
<reference key="parent" ref="1056085528"/>
</object>
@@ -1306,6 +1368,19 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="object" ref="885506522"/>
<reference key="parent" ref="671904505"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">224</int>
<reference key="object" ref="393836098"/>
<array class="NSMutableArray" key="children">
<reference ref="437001198"/>
</array>
<reference key="parent" ref="161598483"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">225</int>
<reference key="object" ref="437001198"/>
<reference key="parent" ref="393836098"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -1354,6 +1429,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="220.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="221.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="224.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="225.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="25.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1370,57 +1447,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">223</int>
<int key="maxID">226</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<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 +1465,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 +1510,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])
@@ -481,4 +481,20 @@
[[_parentWindow contentView] setBackgroundColor:_savedColor];
}
- (CPArray)tokenField:(CPTokenField)aTokenField completionsForSubstring:(CPString)substring indexOfToken:(int)tokenIndex indexOfSelectedItem:(int)selectedIndex
{
var choices = ["aardvark", "baa", "caaing whale"],
r = [];
// Don't complete 'blank' - this would show all available matches which is excessive.
if (!substring)
return r;
for (var i = 0; i < choices.length; i++)
if (choices[i].toLowerCase().indexOf(substring.toLowerCase()) == 0)
r.push(choices[i]);
return r;
}
@end
File diff suppressed because one or more lines are too long
@@ -69,11 +69,6 @@ CPLogRegister(CPLogConsole);
[[radio1 radioGroup] setAction:@selector(radioGroupClicked:)];
[multiCheckbox setState:CPMixedState];
[pushInButton setButtonType:CPMomentaryLightButton];
[pushOnOffButton setButtonType:CPPushOnPushOffButton];
[toggleButton setButtonType:CPToggleButton];
[momentaryChangeButton setButtonType:CPMomentaryChangeButton];
[pushInButton setAlternateTitle:@"Should Not See Me"];
[toggleButton setAlternateTitle:@"Alternate Title For Toggle"];
[momentaryChangeButton setAlternateTitle:@"Changed!"];
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,33 @@
/*
* AppController.j
* CPStepperBindings
*
* Created by You on November 27, 2012.
* Copyright 2012, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
@outlet CPStepper stepper @accessors;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
}
@end
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>CPStepperBindings</string>
</dict>
</plist>
+94
View File
@@ -0,0 +1,94 @@
/*
* Jakefile
* CPStepperBindings
*
* Created by You on November 27, 2012.
* Copyright 2012, Your Company All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("CPStepperBindings", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "CPStepperBindings.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("CPStepperBindings");
task.setIdentifier("com.yourcompany.CPStepperBindings");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("CPStepperBindings");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["CPStepperBindings"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "CPStepperBindings", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "CPStepperBindings", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "CPStepperBindings"));
OS.system(["press", "-f", FILE.join("Build", "Release", "CPStepperBindings"), FILE.join("Build", "Deployment", "CPStepperBindings")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "CPStepperBindings"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPStepperBindings"), FILE.join("Build", "Desktop", "CPStepperBindings", "CPStepperBindings.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "CPStepperBindings", "CPStepperBindings.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPStepperBindings"));
print("----------------------------");
}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,107 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index-debug.html
CPStepperBindings
Created by You on November 27, 2012.
Copyright 2012, Your Company All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>CPStepperBindings</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
// the class name of the view that created them. Comment this or set to false to disable.
appkit_tag_dom_elements = true;
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading CPStepperBindings...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+77
View File
@@ -0,0 +1,77 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
index.html
CPStepperBindings
Created by You on November 27, 2012.
Copyright 2012, Your Company All rights reserved.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="Resources/icon.png" />
<link rel="apple-touch-startup-image" href="Resources/default.png" />
<title>CPStepperBindings</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading CPStepperBindings...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* CPStepperBindings
*
* Created by You on November 27, 2012.
* Copyright 2012, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
+33 -2
View File
@@ -12,6 +12,7 @@
@implementation AppController : CPObject
{
CPWindow aWindow;
CPTextField bezelToggleField;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
@@ -83,6 +84,33 @@
y = CGRectGetMaxY([textField frame]) + 6;
}
label = [[CPTextField alloc] initWithFrame:CGRectMake(15, 420, 600, 30)];
[label setLineBreakMode:CPLineBreakByWordWrapping];
[label setStringValue:"This text field has been configured to show its text at a fixed location both with and without bezel."];
[contentView addSubview:label];
bezelToggleField = [CPTextField textFieldWithStringValue:"" placeholder:"Placeholder" width:200],
[bezelToggleField setEditable:YES];
[bezelToggleField setFrameOrigin:CGPointMake(15, 445)];
console.log("" + bezelToggleField._themeAttributes['content-inset']._parentAttribute._values);
console.log("" + bezelToggleField._themeAttributes['content-inset']._values);
[bezelToggleField setValue:[bezelToggleField valueForThemeAttribute:@"content-inset" inState:CPThemeStateBezeled] forThemeAttribute:@"content-inset" inState:CPThemeStateNormal];
console.log("" + bezelToggleField._themeAttributes['content-inset']._parentAttribute._values);
console.log("" + bezelToggleField._themeAttributes['content-inset']._values);
[contentView addSubview:bezelToggleField];
var bezelToggleButton = [CPButton buttonWithTitle:"Show Bezel"];
[bezelToggleButton setButtonType:CPPushOnPushOffButton];
[bezelToggleButton setAction:@selector(toggleBezel:)];
[bezelToggleButton setTarget:self];
[bezelToggleButton setState:CPOnState];
[bezelToggleButton sizeToFit];
[bezelToggleButton setFrameOrigin:CGPointMake(CGRectGetMaxX([bezelToggleField frame]) + 15, 448)];
[contentView addSubview:bezelToggleButton];
[theWindow orderFront:self];
aWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(150, 300, 400, 150) styleMask:CPTitledWindowMask | CPClosableWindowMask | CPDocModalWindowMask];
@@ -98,9 +126,7 @@
[contentView addSubview:label];
[textField setFrame:CGRectMake(15, CGRectGetMaxY([label frame]) + 10, 300, 30)];
[textField setEditable:YES];
[textField setTarget:self];
[textField setAction:@selector(modalAction:)];
@@ -109,6 +135,11 @@
[CPApp beginSheet:aWindow modalForWindow:theWindow modalDelegate:self didEndSelector:nil contextInfo:nil];
}
- (@action)toggleBezel:(id)sender
{
[bezelToggleField setBezeled:([sender state] == CPOnState)];
}
- (void)modalAction:(id)sender
{
[CPApp endSheet:aWindow returnCode:0];
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>
@@ -271,6 +271,7 @@
runOnlyForDeploymentPostprocessing = 0;
shellPath = /usr/bin/perl;
shellScript = "#!/usr/bin/perl\n\nwhile (<>) {\n s/\\s+$//;\n print \"$_\\n\";\n}";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
+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,
+2 -4
View File
@@ -220,8 +220,8 @@ var NSButtonIsBorderedMask = 0x00800000,
- If there is no max height either, don't do any height adjustments.
*/
var theme = [[Converter sharedConverter] themes][0],
minSize = [theme valueForAttributeWithName:@"min-size" forClass:[CPButton class]],
maxSize = [theme valueForAttributeWithName:@"max-size" forClass:[CPButton class]],
minSize = [theme valueForAttributeWithName:@"min-size" forClass:[self class]],
maxSize = [theme valueForAttributeWithName:@"max-size" forClass:[self class]],
adjustHeight = NO;
if (minSize.height > 0 && maxSize.height > 0 && minSize.height === maxSize.height)
@@ -269,8 +269,6 @@ var NSButtonIsBorderedMask = 0x00800000,
_highlightsBy = [cell highlightsBy];
_showsStateBy = [cell showsStateBy];
[self setTag:[cell tag]];
return self;
}
+5
View File
@@ -56,6 +56,11 @@
[self setLineBreakMode:[cell lineBreakMode]];
[self setFormatter:[cell formatter]];
// In IB, both cells and controls can have tags.
// If the control has a tag, that takes precedence.
if ([aCoder containsValueForKey:@"NSTag"])
[self setTag:[aCoder decodeIntForKey:@"NSTag"]];
}
return self;
+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;
};