mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-01 22:56:17 +00:00
Merge branch 'master' of git://github.com/cappuccino/cappuccino into CPAnimationContext
This commit is contained in:
@@ -445,6 +445,9 @@ var CPMainCibFile = @"CPMainCibFile",
|
||||
|
||||
- (void)activateIgnoringOtherApps:(BOOL)shouldIgnoreOtherApps
|
||||
{
|
||||
if (_isActive)
|
||||
return;
|
||||
|
||||
[self _willBecomeActive];
|
||||
|
||||
[CPPlatform activateIgnoringOtherApps:shouldIgnoreOtherApps];
|
||||
@@ -455,6 +458,9 @@ var CPMainCibFile = @"CPMainCibFile",
|
||||
|
||||
- (void)deactivate
|
||||
{
|
||||
if (!_isActive)
|
||||
return;
|
||||
|
||||
[self _willResignActive];
|
||||
|
||||
[CPPlatform deactivate];
|
||||
@@ -480,6 +486,15 @@ var CPMainCibFile = @"CPMainCibFile",
|
||||
- (void)run
|
||||
{
|
||||
[self finishLaunching];
|
||||
[self sendEvent:[CPEvent otherEventWithType:CPAppKitDefined
|
||||
location:CGPointMakeZero()
|
||||
modifierFlags:0
|
||||
timestamp:[CPEvent currentTimestamp]
|
||||
windowNumber:[_keyWindow windowNumber]
|
||||
context:nil
|
||||
subtype:nil
|
||||
data1:nil
|
||||
data2:nil]];
|
||||
}
|
||||
|
||||
// Managing the Event Loop
|
||||
|
||||
+11
-2
@@ -74,7 +74,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
BOOL _usesDataSource;
|
||||
CGSize _intercellSpacing;
|
||||
CPArray _items;
|
||||
id<CPComboBoxDataSource> _dataSource;
|
||||
id <CPComboBoxDataSource> _dataSource;
|
||||
CPInteger _implementedDelegateComboBoxMethods;
|
||||
CPString _selectedStringValue;
|
||||
float _itemHeight;
|
||||
@@ -843,7 +843,16 @@ var CPComboBoxTextSubview = @"text",
|
||||
// In FireFox this needs to be done in setTimeout, otherwise there is no caret
|
||||
// We have to save the input element now, when we lose focus it will change.
|
||||
var element = [self _inputElement];
|
||||
window.setTimeout(function() { element.focus(); }, 0);
|
||||
window.setTimeout(function() {
|
||||
|
||||
// This will prevent to jump to the focused element
|
||||
var previousScrollingOrigin = [self _scrollToVisibleRectAndReturnPreviousOrigin];
|
||||
|
||||
element.focus();
|
||||
|
||||
[self _restorePreviousScrollingOrigin:previousScrollingOrigin];
|
||||
|
||||
}, 0);
|
||||
#endif
|
||||
|
||||
return NO;
|
||||
|
||||
+1
-1
@@ -240,7 +240,7 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
*/
|
||||
- (ThemeState)_controlSizeThemeState
|
||||
{
|
||||
switch(_controlSize)
|
||||
switch (_controlSize)
|
||||
{
|
||||
case CPSmallControlSize:
|
||||
return CPThemeStateControlSizeSmall;
|
||||
|
||||
@@ -236,6 +236,7 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
_subtype = aSubtype;
|
||||
_data1 = aData1;
|
||||
_data2 = aData2;
|
||||
_windowNumber = aWindowNumber;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -182,7 +182,7 @@ var CPBindingOperationAnd = 0,
|
||||
allBindings = [bindingsForObject allKeys],
|
||||
count = [allBindings count];
|
||||
|
||||
while(count--)
|
||||
while (count--)
|
||||
{
|
||||
if ([[anObject class] isBindingExclusive:allBindings[count]])
|
||||
return NO;
|
||||
|
||||
+3
-3
@@ -269,9 +269,9 @@ var CPRadioRadioGroupKey = @"CPRadioRadioGroupKey";
|
||||
- (BOOL)selectRadioWithTag:(int)tag
|
||||
{
|
||||
var index = [_radios indexOfObjectPassingTest:function(radio)
|
||||
{
|
||||
return [radio tag] === tag;
|
||||
}];
|
||||
{
|
||||
return [radio tag] === tag;
|
||||
}];
|
||||
|
||||
if (index !== CPNotFound)
|
||||
{
|
||||
|
||||
@@ -487,9 +487,9 @@ CPTransformableAttributeType = 1800;
|
||||
|
||||
- (id)copy
|
||||
{
|
||||
var views = [CPArray array];
|
||||
var views = [CPArray array],
|
||||
copy = [[[self class] alloc] init];
|
||||
|
||||
var copy = [[[self class] alloc] init];
|
||||
[copy _setTemplateType:_templateType];
|
||||
[copy _setOptions:_predicateOptions];
|
||||
[copy _setModifier:_predicateModifier];
|
||||
|
||||
@@ -34,9 +34,8 @@ CPSearchFieldRecentsMenuItemTag = 1001;
|
||||
CPSearchFieldClearRecentsMenuItemTag = 1002;
|
||||
CPSearchFieldNoRecentsMenuItemTag = 1003;
|
||||
|
||||
var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotification";
|
||||
|
||||
var RECENT_SEARCH_PREFIX = @" ";
|
||||
var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotification",
|
||||
RECENT_SEARCH_PREFIX = @" ";
|
||||
|
||||
/*!
|
||||
@ingroup appkit
|
||||
|
||||
+18
-18
@@ -504,7 +504,7 @@ CPSegmentSwitchTrackingMomentary = 2;
|
||||
*/
|
||||
- (void)drawSegmentBezel:(int)aSegment highlight:(BOOL)shouldHighlight
|
||||
{
|
||||
if(aSegment < _themeStates.length)
|
||||
if (aSegment < _themeStates.length)
|
||||
{
|
||||
if (shouldHighlight)
|
||||
_themeStates[aSegment] = _themeStates[aSegment].and(CPThemeStateHighlighted);
|
||||
@@ -733,29 +733,23 @@ CPSegmentSwitchTrackingMomentary = 2;
|
||||
if (aSegment < 0 || (segmentCount > 0 && aSegment >= segmentCount))
|
||||
return;
|
||||
|
||||
// Invalidate frames for segments on the right. They will be lazily computed by -frameForSegment:.
|
||||
for (var i = aSegment; i < segmentCount; i++)
|
||||
[_segments[i] setFrame:CGRectMakeZero()];
|
||||
var width = 0;
|
||||
|
||||
[self setFrameSize:[self intrinsicContentSize]];
|
||||
if (segmentCount > 0)
|
||||
{
|
||||
// Invalidate frames for segments on the right. They will be lazily computed by -frameForSegment:.
|
||||
for (var i = aSegment; i < segmentCount; i++)
|
||||
[_segments[i] setFrame:CGRectMakeZero()];
|
||||
|
||||
width = CGRectGetMaxX([self frameForSegment:(segmentCount - 1)]);
|
||||
}
|
||||
|
||||
[self setFrameSize:CGSizeMake(width, CGRectGetHeight([self frame]))];
|
||||
|
||||
[self setNeedsLayout];
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (CGSize)intrinsicContentSize
|
||||
{
|
||||
// frameForSegment is recursively called backwards. All previously invalidated frames will be recomputed.
|
||||
var segmentCount = [self segmentCount],
|
||||
width = 0;
|
||||
|
||||
if (segmentCount > 0)
|
||||
width = CGRectGetMaxX([self frameForSegment:(segmentCount - 1)]);
|
||||
|
||||
return CGSizeMake(width, [self valueForThemeAttribute:@"min-size"].height);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the bounding rectangle for the specified segment.
|
||||
@param aSegment the segment to get the rectangle for
|
||||
@@ -807,6 +801,12 @@ CPSegmentSwitchTrackingMomentary = 2;
|
||||
return CGRectMake(left + contentInset.left, contentInset.top, width - contentInset.left - contentInset.right, height - contentInset.top - contentInset.bottom);
|
||||
}
|
||||
|
||||
- (CGSize)_minimumFrameSize
|
||||
{
|
||||
// The current width is always the minimum width.
|
||||
return CGSizeMake(CGRectGetWidth([self frame]), [self currentValueForThemeAttribute:@"min-size"].height);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the segment that is hit by the specified point.
|
||||
@param aPoint the point to test for a segment hit
|
||||
|
||||
+44
-35
@@ -55,7 +55,9 @@ var CPSplitViewDelegate_splitView_canCollapseSubview_
|
||||
CPSplitViewDelegate_splitView_constrainMaxCoordinate_ofSubviewAt_ = 1 << 5,
|
||||
CPSplitViewDelegate_splitView_constrainMinCoordinate_ofSubviewAt_ = 1 << 6,
|
||||
CPSplitViewDelegate_splitView_constrainSplitPosition_ofSubviewAt_ = 1 << 7,
|
||||
CPSplitViewDelegate_splitView_resizeSubviewsWithOldSize_ = 1 << 8;
|
||||
CPSplitViewDelegate_splitView_resizeSubviewsWithOldSize_ = 1 << 8,
|
||||
CPSplitViewDelegate_splitViewDidResizeSubviews_ = 1 << 9,
|
||||
CPSplitViewDelegate_splitViewWillResizeSubviews_ = 1 << 10;
|
||||
|
||||
#define SPLIT_VIEW_MAYBE_POST_WILL_RESIZE() \
|
||||
if ((_suppressResizeNotificationsMask & DidPostWillResizeNotification) === 0) \
|
||||
@@ -967,26 +969,14 @@ The sum of the views and the sum of the dividers should be equal to the size of
|
||||
if (_delegate === aDelegate)
|
||||
return;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(splitViewDidResizeSubviews:)])
|
||||
[[CPNotificationCenter defaultCenter] removeObserver:_delegate name:CPSplitViewDidResizeSubviewsNotification object:self];
|
||||
_delegate = aDelegate;
|
||||
_implementedDelegateMethods = 0;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(splitViewWillResizeSubviews:)])
|
||||
[[CPNotificationCenter defaultCenter] removeObserver:_delegate name:CPSplitViewWillResizeSubviewsNotification object:self];
|
||||
_implementedDelegateMethods |= CPSplitViewDelegate_splitViewWillResizeSubviews_;
|
||||
|
||||
_delegate = aDelegate;
|
||||
_implementedDelegateMethods = 0;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(splitViewDidResizeSubviews:)])
|
||||
[[CPNotificationCenter defaultCenter] addObserver:_delegate
|
||||
selector:@selector(splitViewDidResizeSubviews:)
|
||||
name:CPSplitViewDidResizeSubviewsNotification
|
||||
object:self];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(splitViewWillResizeSubviews:)])
|
||||
[[CPNotificationCenter defaultCenter] addObserver:_delegate
|
||||
selector:@selector(splitViewWillResizeSubviews:)
|
||||
name:CPSplitViewWillResizeSubviewsNotification
|
||||
object:self];
|
||||
if ([_delegate respondsToSelector:@selector(splitViewDidResizeSubviews:)])
|
||||
_implementedDelegateMethods |= CPSplitViewDelegate_splitViewDidResizeSubviews_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(splitView:canCollapseSubview:)])
|
||||
_implementedDelegateMethods |= CPSplitViewDelegate_splitView_canCollapseSubview_;
|
||||
@@ -1064,27 +1054,12 @@ The sum of the views and the sum of the dividers should be equal to the size of
|
||||
|
||||
- (void)_postNotificationWillResize
|
||||
{
|
||||
var userInfo = nil;
|
||||
|
||||
if (_currentDivider !== CPNotFound)
|
||||
userInfo = @{ @"CPSplitViewDividerIndex": _currentDivider };
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewWillResizeSubviewsNotification
|
||||
object:self
|
||||
userInfo:userInfo];
|
||||
[self _sendDelegateSplitViewWillResizeSubviews];
|
||||
}
|
||||
|
||||
- (void)_postNotificationDidResize
|
||||
{
|
||||
var userInfo = nil;
|
||||
|
||||
if (_currentDivider !== CPNotFound)
|
||||
userInfo = @{ @"CPSplitViewDividerIndex": _currentDivider };
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewDidResizeSubviewsNotification
|
||||
object:self
|
||||
userInfo:userInfo];
|
||||
|
||||
[self _sendDelegateSplitViewDidResizeSubviews];
|
||||
|
||||
// TODO Cocoa always autosaves on "viewDidEndLiveResize". If Cappuccino adds support for this we
|
||||
// should do the same.
|
||||
@@ -1369,6 +1344,40 @@ The sum of the views and the sum of the dividers should be equal to the size of
|
||||
[_delegate splitView:self resizeSubviewsWithOldSize:oldSize];
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
Call the delegate splitViewWillResizeSubviews:
|
||||
*/
|
||||
- (void)_sendDelegateSplitViewWillResizeSubviews
|
||||
{
|
||||
var userInfo = nil;
|
||||
|
||||
if (_currentDivider !== CPNotFound)
|
||||
userInfo = @{ @"CPSplitViewDividerIndex": _currentDivider };
|
||||
|
||||
if (_implementedDelegateMethods & CPSplitViewDelegate_splitViewWillResizeSubviews_)
|
||||
[_delegate splitViewWillResizeSubviews:[[CPNotification alloc] initWithName:CPSplitViewWillResizeSubviewsNotification object:self userInfo:userInfo]];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewWillResizeSubviewsNotification object:self userInfo:userInfo];
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
Call the delegate splitViewDidResizeSubviews:
|
||||
*/
|
||||
- (void)_sendDelegateSplitViewDidResizeSubviews
|
||||
{
|
||||
var userInfo = nil;
|
||||
|
||||
if (_currentDivider !== CPNotFound)
|
||||
userInfo = @{ @"CPSplitViewDividerIndex": _currentDivider };
|
||||
|
||||
if (_implementedDelegateMethods & CPSplitViewDelegate_splitViewDidResizeSubviews_)
|
||||
[_delegate splitViewDidResizeSubviews:[[CPNotification alloc] initWithName:CPSplitViewDidResizeSubviewsNotification object:self userInfo:userInfo]];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPSplitViewDidResizeSubviewsNotification object:self userInfo:userInfo];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
_textField = [[_CPImageAndTextView alloc] initWithFrame:
|
||||
CGRectMake(5.0, 0.0, CGRectGetWidth([self bounds]) - 10.0, CGRectGetHeight([self bounds]))];
|
||||
|
||||
[_textField setAutoresizingMask:CPViewWidthSizable|CPViewHeightSizable];
|
||||
[_textField setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
||||
|
||||
[_textField setLineBreakMode:CPLineBreakByTruncatingTail];
|
||||
[_textField setTextColor:[CPColor colorWithRed:51.0 / 255.0 green:51.0 / 255.0 blue:51.0 / 255.0 alpha:1.0]];
|
||||
@@ -196,7 +196,7 @@
|
||||
maxX = CGRectGetMaxX(bounds) - 0.5;
|
||||
|
||||
CGContextSetLineWidth(context, 1);
|
||||
CGContextSetStrokeColor(context, [CPColor colorWithWhite:192.0/255.0 alpha:1.0]);
|
||||
CGContextSetStrokeColor(context, [CPColor colorWithWhite:192.0 / 255.0 alpha:1.0]);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
|
||||
|
||||
+15
-15
@@ -2100,26 +2100,26 @@ NOT YET IMPLEMENTED
|
||||
found = NO,
|
||||
max_rec = 100;
|
||||
|
||||
while (max_rec--)
|
||||
while (max_rec--)
|
||||
{
|
||||
if (!cellView || cellView === contentView)
|
||||
{
|
||||
if (!cellView || cellView === contentView)
|
||||
found = NO;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
var superview = [cellView superview];
|
||||
|
||||
if ([superview isKindOfClass:[CPTableView class]])
|
||||
{
|
||||
found = NO;
|
||||
found = YES;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
var superview = [cellView superview];
|
||||
|
||||
if ([superview isKindOfClass:[CPTableView class]])
|
||||
{
|
||||
found = YES;
|
||||
break;
|
||||
}
|
||||
|
||||
cellView = superview;
|
||||
}
|
||||
cellView = superview;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
@@ -5091,7 +5091,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
_editingColumn = column;
|
||||
_editingRow = row;
|
||||
|
||||
[aView addObserver:self forKeyPath:@"objectValue" options:CPKeyValueObservingOptionOld|CPKeyValueObservingOptionNew context:"editing"];
|
||||
[aView addObserver:self forKeyPath:@"objectValue" options:CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew context:"editing"];
|
||||
}
|
||||
|
||||
return aView;
|
||||
|
||||
+61
-3
@@ -28,6 +28,7 @@
|
||||
@import "_CPImageAndTextView.j"
|
||||
|
||||
@class CPPasteboard
|
||||
@class CPScrollView
|
||||
|
||||
@global CPApp
|
||||
@global CPStringPboardType
|
||||
@@ -88,7 +89,12 @@ function CPTextFieldBlurFunction(anEvent, owner, domElement, inputElement, resig
|
||||
{
|
||||
window.setTimeout(function()
|
||||
{
|
||||
// This will prevent to jump to the focused element
|
||||
var previousScrollingOrigin = [owner _scrollToVisibleRectAndReturnPreviousOrigin];
|
||||
|
||||
inputElement.focus();
|
||||
|
||||
[owner _restorePreviousScrollingOrigin:previousScrollingOrigin];
|
||||
}, 0.0);
|
||||
}
|
||||
}
|
||||
@@ -643,6 +649,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
|
||||
_stringValue = [self stringValue];
|
||||
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
|
||||
[self _setCSSStyleForInputElement];
|
||||
@@ -672,8 +679,13 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
if (CPTextFieldInputOwner !== self)
|
||||
return;
|
||||
|
||||
// This will prevent to jump to the focused element
|
||||
var previousScrollingOrigin = [self _scrollToVisibleRectAndReturnPreviousOrigin];
|
||||
|
||||
element.focus();
|
||||
|
||||
[self _restorePreviousScrollingOrigin:previousScrollingOrigin];
|
||||
|
||||
// Select the text if the textfield became first responder through keyboard interaction
|
||||
if (!_willBecomeFirstResponderByClick)
|
||||
[self _selectText:self immediately:YES];
|
||||
@@ -783,7 +795,13 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
// even if the value has not changed.
|
||||
if ([self _valueIsValid:newValue] === NO)
|
||||
{
|
||||
// This will prevent to jump to the focused element
|
||||
var previousScrollingOrigin = [self _scrollToVisibleRectAndReturnPreviousOrigin];
|
||||
|
||||
element.focus();
|
||||
|
||||
[self _restorePreviousScrollingOrigin:previousScrollingOrigin];
|
||||
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
@@ -792,7 +810,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
// 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];
|
||||
if ([[self window] isKeyWindow])
|
||||
[self _resignFirstKeyResponder];
|
||||
|
||||
_isEditing = NO;
|
||||
if ([self isEditable])
|
||||
@@ -1950,17 +1969,55 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
if (!wind)
|
||||
return NO;
|
||||
|
||||
var scrollView = [self enclosingScrollView],
|
||||
previousContentViewBoundsOrigin;
|
||||
|
||||
// Here we scroll to the textField, otherwise the textField could not be in the usable platformRect
|
||||
var previousScrollingOrigin = [self _scrollToVisibleRectAndReturnPreviousOrigin];
|
||||
|
||||
var frame = [self convertRectToBase:[self contentRectForBounds:[self bounds]]],
|
||||
usableRect = [[wind platformWindow] usableContentFrame];
|
||||
|
||||
frame.origin = [wind convertBaseToGlobal:frame.origin];
|
||||
|
||||
// Here we restore the the previous scrolling posiition
|
||||
[self _restorePreviousScrollingOrigin:previousScrollingOrigin];
|
||||
|
||||
return (CGRectGetMinX(frame) >= CGRectGetMinX(usableRect) &&
|
||||
CGRectGetMaxX(frame) <= CGRectGetMaxX(usableRect) &&
|
||||
CGRectGetMinY(frame) >= CGRectGetMinY(usableRect) &&
|
||||
CGRectGetMaxY(frame) <= CGRectGetMaxY(usableRect));
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (CGPoint)_scrollToVisibleRectAndReturnPreviousOrigin
|
||||
{
|
||||
var scrollView = [self enclosingScrollView],
|
||||
previousContentViewBoundsOrigin;
|
||||
|
||||
// Here we scroll to the textField, otherwise the textField could not be in the usable platformRect
|
||||
if ([scrollView isKindOfClass:[CPScrollView class]])
|
||||
{
|
||||
previousContentViewBoundsOrigin = CGPointMakeCopy([[scrollView contentView] boundsOrigin]);
|
||||
|
||||
if (![[self superview] scrollRectToVisible:[self frame]])
|
||||
previousContentViewBoundsOrigin = nil;
|
||||
}
|
||||
|
||||
return previousContentViewBoundsOrigin;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)_restorePreviousScrollingOrigin:(CGPoint)scrollingOrigin
|
||||
{
|
||||
if (scrollingOrigin)
|
||||
[[[self enclosingScrollView] contentView] setBoundsOrigin:scrollingOrigin];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var secureStringForString = function(aString)
|
||||
@@ -2082,7 +2139,8 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
|
||||
newValue = [self valueForBinding:aBinding],
|
||||
value = [destination valueForKeyPath:keyPath];
|
||||
|
||||
if (CPIsControllerMarker(value) && newValue === nil) return;
|
||||
if (CPIsControllerMarker(value) && newValue === nil)
|
||||
return;
|
||||
|
||||
newValue = [self reverseTransformValue:newValue withOptions:options];
|
||||
|
||||
@@ -2109,4 +2167,4 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
|
||||
[_source setObjectValue:aValue];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
@@ -457,7 +457,13 @@ CPTokenFieldDeleteButtonType = 1;
|
||||
|
||||
window.setTimeout(function()
|
||||
{
|
||||
// This will prevent to jump to the focused element
|
||||
var previousScrollingOrigin = [self _scrollToVisibleRectAndReturnPreviousOrigin];
|
||||
|
||||
element.focus();
|
||||
|
||||
[self _restorePreviousScrollingOrigin:previousScrollingOrigin];
|
||||
|
||||
CPTokenFieldInputOwner = self;
|
||||
}, 0.0);
|
||||
|
||||
|
||||
+38
-9
@@ -2737,18 +2737,47 @@ setBoundsOrigin:
|
||||
if (CGRectContainsRect(documentViewVisibleRect, rectInDocumentView))
|
||||
return NO;
|
||||
|
||||
var scrollPoint = CGPointMakeCopy(documentViewVisibleRect.origin);
|
||||
var currentScrollPoint = documentViewVisibleRect.origin,
|
||||
scrollPoint = CGPointMakeCopy(currentScrollPoint),
|
||||
rectInDocumentViewMinX = CGRectGetMinX(rectInDocumentView),
|
||||
documentViewVisibleRectMinX = CGRectGetMinX(documentViewVisibleRect),
|
||||
doesItFitForWidth = documentViewVisibleRect.size.width >= rectInDocumentView.size.width;
|
||||
|
||||
// One of the following has to be true since our current visible rect didn't contain aRect.
|
||||
if (CGRectGetMinX(rectInDocumentView) < CGRectGetMinX(documentViewVisibleRect))
|
||||
scrollPoint.x = CGRectGetMinX(rectInDocumentView);
|
||||
else if (CGRectGetMaxX(rectInDocumentView) > CGRectGetMaxX(documentViewVisibleRect))
|
||||
scrollPoint.x += CGRectGetMaxX(rectInDocumentView) - CGRectGetMaxX(documentViewVisibleRect);
|
||||
if (rectInDocumentViewMinX < documentViewVisibleRectMinX && doesItFitForWidth)
|
||||
// Scroll to left edge of aRect as it is to the left of the visible rect and it fit inside
|
||||
scrollPoint.x = rectInDocumentViewMinX;
|
||||
else if (CGRectGetMaxX(rectInDocumentView) > CGRectGetMaxX(documentViewVisibleRect) && doesItFitForWidth)
|
||||
// Scroll to right edge of aRect as it is to the right of the visible rect and it fit inside
|
||||
scrollPoint.x = CGRectGetMaxX(rectInDocumentView) - documentViewVisibleRect.size.width;
|
||||
else if (rectInDocumentViewMinX > documentViewVisibleRectMinX)
|
||||
// Scroll to left edge of aRect as it is to the right of the visible rect and it doesn't fit inside
|
||||
scrollPoint.x = rectInDocumentViewMinX;
|
||||
else if (CGRectGetMaxX(rectInDocumentView) < CGRectGetMaxX(documentViewVisibleRect))
|
||||
// Scroll to right edge of aRect as it is to the left of the visible rect and it doesn't fit inside
|
||||
scrollPoint.x = CGRectGetMaxX(rectInDocumentView) - documentViewVisibleRect.size.width;
|
||||
|
||||
if (CGRectGetMinY(rectInDocumentView) < CGRectGetMinY(documentViewVisibleRect))
|
||||
scrollPoint.y = CGRectGetMinY(rectInDocumentView);
|
||||
else if (CGRectGetMaxY(rectInDocumentView) > CGRectGetMaxY(documentViewVisibleRect))
|
||||
scrollPoint.y += CGRectGetMaxY(rectInDocumentView) - CGRectGetMaxY(documentViewVisibleRect);
|
||||
var rectInDocumentViewMinY = CGRectGetMinY(rectInDocumentView),
|
||||
documentViewVisibleRectMinY = CGRectGetMinY(documentViewVisibleRect),
|
||||
doesItFitForHeight = documentViewVisibleRect.size.height >= rectInDocumentView.size.height;
|
||||
|
||||
if (rectInDocumentViewMinY < documentViewVisibleRectMinY && doesItFitForHeight)
|
||||
// Scroll to top edge of aRect as it is above the visible rect and it fit inside
|
||||
scrollPoint.y = rectInDocumentViewMinY;
|
||||
else if (CGRectGetMaxY(rectInDocumentView) > CGRectGetMaxY(documentViewVisibleRect) && doesItFitForHeight)
|
||||
// Scroll to bottom edge of aRect as it is below the visible rect and it fit inside
|
||||
scrollPoint.y = CGRectGetMaxY(rectInDocumentView) - documentViewVisibleRect.size.height;
|
||||
else if (rectInDocumentViewMinY > documentViewVisibleRectMinY)
|
||||
// Scroll to top edge of aRect as it is below the visible rect and it doesn't fit inside
|
||||
scrollPoint.y = rectInDocumentViewMinY;
|
||||
else if (CGRectGetMaxY(rectInDocumentView) < CGRectGetMaxY(documentViewVisibleRect))
|
||||
// Scroll to bottom edge of aRect as it is above the visible rect and it doesn't fit inside
|
||||
scrollPoint.y = CGRectGetMaxY(rectInDocumentView) - documentViewVisibleRect.size.height;
|
||||
|
||||
// Don't scroll if aRect contains the whole visible rect as it is already as visible as possible.
|
||||
// We check this by comparing to new scrollPoint to the current.
|
||||
if (CGPointEqualToPoint(scrollPoint, currentScrollPoint))
|
||||
return NO;
|
||||
|
||||
[enclosingClipView scrollToPoint:scrollPoint];
|
||||
|
||||
|
||||
@@ -63,22 +63,28 @@
|
||||
|
||||
@optional
|
||||
- (BOOL)windowShouldClose:(CPWindow)aWindow;
|
||||
- (CGSize)windowWillResize:(CPWindow)sender toSize:(CGSize)aSize;
|
||||
- (CPUndoManager)windowWillReturnUndoManager:(CPWindow)window;
|
||||
- (void)windowDidBecomeKey:(CPNotification)aNotification;
|
||||
- (void)windowDidBecomeMain:(CPNotification)aNotification;
|
||||
- (void)windowDidDeminiaturize:(CPNotification)notification;
|
||||
- (void)windowDidEndSheet:(CPNotification)aNotification;
|
||||
- (void)windowDidMiniaturize:(CPNotification)notification;
|
||||
- (void)windowDidMove:(CPNotification)aNotification;
|
||||
- (void)windowDidResignKey:(CPNotification)aNotification;
|
||||
- (void)windowDidResignMain:(CPNotification)aNotification;
|
||||
- (void)windowDidResize:(CPNotification)aNotification;
|
||||
- (void)windowWillMiniaturize:(CPNotification)notification;
|
||||
- (void)windowWillBeginSheet:(CPNotification)aNotification;
|
||||
- (void)windowWillClose:(CPWindow)aWindow;
|
||||
|
||||
@end
|
||||
|
||||
var CPWindowDelegate_windowShouldClose_ = 1 << 1
|
||||
var CPWindowDelegate_windowShouldClose_ = 1 << 1,
|
||||
CPWindowDelegate_windowWillReturnUndoManager_ = 1 << 2,
|
||||
CPWindowDelegate_windowWillClose_ = 1 << 3;
|
||||
CPWindowDelegate_windowWillClose_ = 1 << 3,
|
||||
CPWindowDelegate_windowWillResize_toSize_ = 1 << 4;
|
||||
|
||||
|
||||
var CPWindowSaveImage = nil,
|
||||
|
||||
@@ -747,6 +753,9 @@ CPTexturedBackgroundWindowMask
|
||||
size.width = newSize.width;
|
||||
size.height = newSize.height;
|
||||
|
||||
if (!_isAnimating)
|
||||
size = [self _sendDelegateWindowWillResizeToSize:size];
|
||||
|
||||
[_windowView setFrameSize:size];
|
||||
|
||||
if (_hasShadow)
|
||||
@@ -975,6 +984,7 @@ CPTexturedBackgroundWindowMask
|
||||
[[CPNotificationCenter defaultCenter] removeObserver:self name:_CPPlatformWindowWillCloseNotification object:nil];
|
||||
|
||||
[[self contentView] _removeObservers];
|
||||
_hasBecomeKeyWindow = NO;
|
||||
}
|
||||
|
||||
|
||||
@@ -1429,6 +1439,9 @@ CPTexturedBackgroundWindowMask
|
||||
[defaultCenter removeObserver:_delegate name:CPWindowDidResizeNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPWindowWillBeginSheetNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPWindowDidEndSheetNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPWindowDidMiniaturizeNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPWindowDidDeminiaturizeNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPWindowWillMiniaturizeNotification object:self];
|
||||
|
||||
_delegate = aDelegate;
|
||||
_implementedDelegateMethods = 0;
|
||||
@@ -1442,6 +1455,9 @@ CPTexturedBackgroundWindowMask
|
||||
if ([_delegate respondsToSelector:@selector(windowWillClose:)])
|
||||
_implementedDelegateMethods |= CPWindowDelegate_windowWillClose_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(windowWillResize:toSize:)])
|
||||
_implementedDelegateMethods |= CPWindowDelegate_windowWillResize_toSize_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(windowDidResignKey:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
@@ -1497,6 +1513,27 @@ CPTexturedBackgroundWindowMask
|
||||
selector:@selector(windowDidEndSheet:)
|
||||
name:CPWindowDidEndSheetNotification
|
||||
object:self];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(windowDidMiniaturize:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(windowDidMiniaturize:)
|
||||
name:CPWindowDidMiniaturizeNotification
|
||||
object:self];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(windowWillMiniaturize:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(windowWillMiniaturize:)
|
||||
name:CPWindowWillMiniaturizeNotification
|
||||
object:self];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(windowDidDeminiaturize:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(windowDidDeminiaturize:)
|
||||
name:CPWindowDidDeminiaturizeNotification
|
||||
object:self];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1809,6 +1846,9 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case CPAppKitDefined:
|
||||
return [CPApp activateIgnoringOtherApps:YES];
|
||||
|
||||
case CPFlagsChanged:
|
||||
return [[self firstResponder] flagsChanged:anEvent];
|
||||
|
||||
@@ -2023,6 +2063,7 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
[self _setupFirstResponder];
|
||||
_hasBecomeKeyWindow = YES;
|
||||
_platformWindow._currentKeyWindow = self;
|
||||
|
||||
[_windowView noteKeyWindowStateChanged];
|
||||
[_contentView _notifyWindowDidBecomeKey];
|
||||
@@ -2093,6 +2134,7 @@ CPTexturedBackgroundWindowMask
|
||||
if (CPApp._keyWindow === self)
|
||||
CPApp._keyWindow = nil;
|
||||
|
||||
_platformWindow._currentKeyWindow = nil;
|
||||
[_windowView noteKeyWindowStateChanged];
|
||||
[_contentView _notifyWindowDidResignKey];
|
||||
|
||||
@@ -2476,6 +2518,7 @@ CPTexturedBackgroundWindowMask
|
||||
- (void)becomeMainWindow
|
||||
{
|
||||
CPApp._mainWindow = self;
|
||||
_platformWindow._currentMainWindow = self;
|
||||
|
||||
[self _synchronizeSaveMenuWithDocumentSaving];
|
||||
|
||||
@@ -2498,6 +2541,7 @@ CPTexturedBackgroundWindowMask
|
||||
if (CPApp._mainWindow === self)
|
||||
CPApp._mainWindow = nil;
|
||||
|
||||
_platformWindow._currentMainWindow = nil;
|
||||
[_windowView noteMainWindowStateChanged];
|
||||
}
|
||||
|
||||
@@ -2736,7 +2780,7 @@ CPTexturedBackgroundWindowMask
|
||||
[[CPNotificationCenter defaultCenter] removeObserver:self name:CPWindowDidEndSheetNotification object:self];
|
||||
|
||||
var sheet = _sheetContext[@"nextSheet"],
|
||||
modalDelegate =_sheetContext[@"nextModalDelegate"],
|
||||
modalDelegate = _sheetContext[@"nextModalDelegate"],
|
||||
endSelector = _sheetContext[@"nextEndSelector"],
|
||||
contextInfo = _sheetContext[@"nextContextInfo"];
|
||||
|
||||
@@ -3473,6 +3517,18 @@ var keyViewComparator = function(lhs, rhs, context)
|
||||
[_delegate windowWillClose:self];
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
Call the delegate windowWillResize:toSize:
|
||||
*/
|
||||
- (CGSize)_sendDelegateWindowWillResizeToSize:(CGSize)aSize
|
||||
{
|
||||
if (!(_implementedDelegateMethods & CPWindowDelegate_windowWillResize_toSize_))
|
||||
return aSize;
|
||||
|
||||
return [_delegate windowWillResize:self toSize:aSize];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -75,6 +75,12 @@ var PrimaryPlatformWindow = NULL;
|
||||
CPPlatformPasteboard _platformPasteboard;
|
||||
|
||||
CPString _overriddenEventType;
|
||||
|
||||
CPWindow _currentKeyWindow;
|
||||
CPWindow _previousKeyWindow;
|
||||
|
||||
CPWindow _currentMainWindow;
|
||||
CPWindow _previousMainWindow;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -127,6 +127,7 @@
|
||||
@import "CPText.j"
|
||||
@import "CPWindow_Constants.j"
|
||||
|
||||
@class CPApplication
|
||||
@class CPDragServer
|
||||
@class _CPToolTip
|
||||
|
||||
@@ -202,6 +203,7 @@ var ModifierKeyCodes = [
|
||||
|
||||
var resizeTimer = nil;
|
||||
var PreventScroll = true;
|
||||
var blurTimer = nil;
|
||||
|
||||
_CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotification";
|
||||
|
||||
@@ -396,7 +398,15 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
|
||||
touchEventSelector = @selector(touchEvent:),
|
||||
touchEventImplementation = class_getMethodImplementation(theClass, touchEventSelector),
|
||||
touchEventCallback = function (anEvent) { touchEventImplementation(self, nil, anEvent); };
|
||||
touchEventCallback = function (anEvent) { touchEventImplementation(self, nil, anEvent); },
|
||||
|
||||
onFocusEventSelector = @selector(focusEvent:),
|
||||
onFocusEventImplementation = class_getMethodImplementation(theClass, onFocusEventSelector),
|
||||
onFocusEventCallback = function (anEvent) { onFocusEventImplementation(self, nil, anEvent); },
|
||||
|
||||
onBlurEventSelector = @selector(blurEvent:),
|
||||
onBlurEventImplementation = class_getMethodImplementation(theClass, onBlurEventSelector),
|
||||
onBlurEventCallback = function (anEvent) { onBlurEventImplementation(self, nil, anEvent); };
|
||||
|
||||
if (theDocument.addEventListener)
|
||||
{
|
||||
@@ -430,10 +440,14 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
|
||||
_DOMWindow.addEventListener("resize", resizeEventCallback, NO);
|
||||
|
||||
_DOMWindow.addEventListener("blur", onBlurEventCallback, NO);
|
||||
_DOMWindow.addEventListener("focus", onFocusEventCallback, NO);
|
||||
|
||||
_DOMWindow.addEventListener("unload", function()
|
||||
{
|
||||
_DOMWindow.removeEventListener("unload", arguments.callee, NO);
|
||||
|
||||
[self blurEvent:nil];
|
||||
[self _notifyPlatformWindowWillClose];
|
||||
[self updateFromNativeContentRect];
|
||||
[self _removeLayers];
|
||||
@@ -453,6 +467,9 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
|
||||
_DOMWindow.removeEventListener("resize", resizeEventCallback, NO);
|
||||
|
||||
_DOMWindow.removeEventListener("blur", onBlurEventCallback, NO);
|
||||
_DOMWindow.removeEventListener("focus", onFocusEventCallback, NO);
|
||||
|
||||
//FIXME: does firefox really need a different value?
|
||||
_DOMWindow.removeEventListener("DOMMouseScroll", scrollEventCallback, NO);
|
||||
_DOMWindow.removeEventListener("wheel", scrollEventCallback, NO);
|
||||
@@ -479,6 +496,9 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
|
||||
_DOMWindow.attachEvent("onresize", resizeEventCallback);
|
||||
|
||||
_DOMWindow.attachEvent("onfocus", onFocusEventCallback);
|
||||
_DOMWindow.attachEvent("onblur", onBlurEventCallback);
|
||||
|
||||
_DOMWindow.onmousewheel = scrollEventCallback;
|
||||
theDocument.onmousewheel = scrollEventCallback;
|
||||
|
||||
@@ -489,6 +509,7 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
{
|
||||
_DOMWindow.detachEvent("unload", arguments.callee);
|
||||
|
||||
[self blurEvent:nil];
|
||||
[self _notifyPlatformWindowWillClose];
|
||||
[self updateFromNativeContentRect];
|
||||
[self _removeLayers];
|
||||
@@ -505,7 +526,11 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
|
||||
_DOMWindow.detachEvent("onresize", resizeEventCallback);
|
||||
|
||||
_DOMWindow.detachEvent("onfocus", onBlurEventCallback);
|
||||
_DOMWindow.detachEvent("onblur", onFocusEventCallback);
|
||||
|
||||
_DOMWindow.onmousewheel = NULL;
|
||||
|
||||
theDocument.onmousewheel = NULL;
|
||||
|
||||
_DOMBodyElement.ondrag = NULL;
|
||||
@@ -545,7 +570,7 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
[PlatformWindows addObject:self];
|
||||
|
||||
// FIXME: cpSetFrame?
|
||||
_DOMWindow.document.write('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body style="background-color:transparent;"></body></html>');
|
||||
_DOMWindow.document.write('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body style="background-color:transparent; overflow:hidden"></body></html>');
|
||||
_DOMWindow.document.close();
|
||||
|
||||
if (self != [CPPlatformWindow primaryPlatformWindow])
|
||||
@@ -1031,6 +1056,96 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio
|
||||
_shouldUpdateContentRect = YES;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)blurEvent:(DOMEvent)aDOMEvent
|
||||
{
|
||||
if ([CPApp keyWindow] == _currentKeyWindow)
|
||||
[_currentKeyWindow resignKeyWindow];
|
||||
|
||||
if ([CPApp mainWindow] == _currentMainWindow)
|
||||
[_currentMainWindow resignMainWindow];
|
||||
|
||||
_previousKeyWindow = aDOMEvent ? _currentKeyWindow : nil;
|
||||
_previousMainWindow = aDOMEvent ? _currentMainWindow : nil;
|
||||
|
||||
[blurTimer invalidate];
|
||||
blurTimer = [CPTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(_blurEventTimer:) userInfo:nil repeats:NO];
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)_blurEventTimer:(CPTimer)aTimer
|
||||
{
|
||||
if (![CPApp mainWindow])
|
||||
[[CPApplication sharedApplication] deactivate];
|
||||
|
||||
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)focusEvent:(DOMEvent)aDOMEvent
|
||||
{
|
||||
[blurTimer invalidate];
|
||||
[CPApp activateIgnoringOtherApps:YES];
|
||||
|
||||
var keyWindow = _previousKeyWindow;
|
||||
|
||||
if (!keyWindow)
|
||||
keyWindow = [[[_windowLayers objectForKey:[_windowLevels firstObject]] orderedWindows] firstObject];
|
||||
|
||||
if (!keyWindow)
|
||||
return;
|
||||
|
||||
[self _makeKeyWindow:keyWindow];
|
||||
|
||||
if ([keyWindow isKeyWindow] && ([keyWindow firstResponder] === keyWindow || ![keyWindow firstResponder]))
|
||||
[keyWindow makeFirstResponder:[keyWindow initialFirstResponder]];
|
||||
|
||||
[self _makeMainWindow:keyWindow];
|
||||
|
||||
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
||||
|
||||
_previousKeyWindow = nil;
|
||||
_previousMainWindow = nil;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)_makeKeyWindow:(CPWindow)aWindow
|
||||
{
|
||||
if ([CPApp keyWindow] === aWindow || ![aWindow canBecomeKeyWindow])
|
||||
return;
|
||||
|
||||
[[CPApp keyWindow] resignKeyWindow];
|
||||
[aWindow becomeKeyWindow];
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)_makeMainWindow:(CPWindow)aWindow
|
||||
{
|
||||
// Sheets cannot be main. Their parent window becomes main.
|
||||
if (aWindow._isSheet)
|
||||
{
|
||||
[self _makeMainWindow:aWindow._parentView];
|
||||
return;
|
||||
}
|
||||
|
||||
if ([CPApp mainWindow] === aWindow || ![aWindow canBecomeMainWindow])
|
||||
return;
|
||||
|
||||
[[CPApp mainWindow] resignMainWindow];
|
||||
[aWindow becomeMainWindow];
|
||||
}
|
||||
|
||||
|
||||
- (void)touchEvent:(DOMEvent)aDOMEvent
|
||||
{
|
||||
if (aDOMEvent.touches && (aDOMEvent.touches.length == 1 || (aDOMEvent.touches.length == 0 && aDOMEvent.changedTouches.length == 1)))
|
||||
|
||||
@@ -668,6 +668,17 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
[_delegate _popoverWindowDidClose];
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
Needed to be ignored to close a popover when a platform is closed.
|
||||
Because the animation, the popover is not properly closed.
|
||||
*/
|
||||
- (void)_didReceivePlatformWindowWillCloseNotification:(CPNotification)aNotification
|
||||
{
|
||||
[super _didReceivePlatformWindowWillCloseNotification:aNotification];
|
||||
[self _orderOutRecursively:YES];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Private
|
||||
@@ -715,7 +726,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
|
||||
// Consider clicks in child windows to be "inside". This keeps a transient popover from
|
||||
// closing if e.g. the window containing the menu of a token field is clicked.
|
||||
if (mouseWindow === self || [mouseWindow _hasAncestorWindow:self] || ![self _hasOnlyTransientChild:self])
|
||||
if (mouseWindow === self || [mouseWindow _hasAncestorWindow:self] || ![self _hasOnlyTransientChild:self] || [mouseWindow platformWindow] != [self platformWindow])
|
||||
{
|
||||
[self _trapNextMouseDown];
|
||||
}
|
||||
|
||||
@@ -208,6 +208,14 @@ var concat = Array.prototype.concat,
|
||||
_CPRaiseInvalidAbstractInvocation(self, _cmd);
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a hash for the object. Unlike Cocoa, the hash value does not take content into account, so two arrays with the same content (\c isEqual: === YES) will not generate the same hash.
|
||||
*/
|
||||
- (unsigned)hash
|
||||
{
|
||||
return [self UID];
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the first object in the array. If the array is empty, returns \c nil
|
||||
*/
|
||||
|
||||
@@ -196,7 +196,8 @@ var concat = Array.prototype.concat,
|
||||
}
|
||||
|
||||
else
|
||||
for (; index < count; ++index) {
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
var receiver = self[index];
|
||||
receiver == nil ? nil : receiver.isa.objj_msgSend0(receiver, aSelector);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
@import "CPString.j"
|
||||
|
||||
// The default global behavior class, created lazily
|
||||
var CPDefaultDcmHandler = nil;
|
||||
var CPDefaultDcmHandler = nil,
|
||||
CPDecimalNumberUIDs = new CFMutableDictionary();
|
||||
|
||||
/*!
|
||||
@class CPDecimalNumberHandler
|
||||
@@ -531,6 +532,20 @@ var CPDecimalNumberHandlerRoundingModeKey = @"CPDecimalNumberHandlerRoundi
|
||||
}
|
||||
|
||||
// instance methods
|
||||
|
||||
- (CPString)UID
|
||||
{
|
||||
var UID = CPDecimalNumberUIDs.valueForKey(self);
|
||||
|
||||
if (!UID)
|
||||
{
|
||||
UID = objj_generateObjectUID();
|
||||
CPDecimalNumberUIDs.setValueForKey(self, UID);
|
||||
}
|
||||
|
||||
return UID + "";
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a new CPDecimalNumber object with the result of the summation of
|
||||
the receiver object and \c decimalNumber. If overflow occurs then the
|
||||
|
||||
@@ -266,7 +266,7 @@ var abbreviationDictionary,
|
||||
@"MST" : [@"Mountain Standard Time", @"MST", @"Mountain Daylight Time", @"MDT", @"Mountain Time", @"MT"],
|
||||
@"PHT" : [@"Philippine Standard Time", @"GMT+08:00", @"Philippine Summer Time", @"GMT+08:00", @"Philippine Standard Time", @"Philippines Time"],
|
||||
@"WET" : [@"Western European Standard Time", @"GMT", @"Western European Summer Time", @"GMT+01:00", @"Western European Time", @"Portugal Time (Lisbon)"]
|
||||
};
|
||||
};
|
||||
|
||||
var date = [CPDate date],
|
||||
abbreviation = String(String(date).split("(")[1]).split(")")[0];
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
anEvent = [CPEvent otherEventWithType:CPApplicationDefined location:CGPointMakeZero() modifierFlags:0 timestamp:500.5 windowNumber:2 context:nil subtype:5 data1:15 data2:25];
|
||||
|
||||
[self assert:@"CPEvent: type=15 loc={0, 0} time=500.5 flags=0x0 win=null winNum=0 ctxt=null subtype=5 data1=15 data2=25" equals:[anEvent description]];
|
||||
[self assert:@"CPEvent: type=15 loc={0, 0} time=500.5 flags=0x0 win=null winNum=2 ctxt=null subtype=5 data1=15 data2=25" equals:[anEvent description]];
|
||||
}
|
||||
|
||||
- (void)testModifierFlags
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
|
||||
[scrollView setDocumentView:documentView];
|
||||
|
||||
[textField1 setFrameOrigin:CGPointMake(0, 0)];
|
||||
[textField1 setFrameOrigin:CGPointMake(10, 10)];
|
||||
[textField2 setFrameOrigin:CGPointMake(500, 500)];
|
||||
|
||||
[documentView addSubview:textField1];
|
||||
@@ -242,9 +242,11 @@
|
||||
[self assertPoint:CGPointMake(0, 0) equals:visibleRect.origin message:@"VisibleRect origin not at top left corner"];
|
||||
|
||||
// Make the second text field visible
|
||||
[textField2 scrollRectToVisible:[textField2 bounds]];
|
||||
var hasScrolled = [textField2 scrollRectToVisible:[textField2 bounds]];
|
||||
|
||||
var visibleRectOriginShouldBeAt = CGPointMake(500 - originalVisibleSize.width + textField2Size.width, 500 -originalVisibleSize.height + textField2Size.height);
|
||||
[self assertTrue:hasScrolled];
|
||||
|
||||
var visibleRectOriginShouldBeAt = CGPointMake(500 - originalVisibleSize.width + textField2Size.width, 500 - originalVisibleSize.height + textField2Size.height);
|
||||
|
||||
visibleRect = [documentView visibleRect];
|
||||
|
||||
@@ -252,12 +254,66 @@
|
||||
[self assertPoint:visibleRectOriginShouldBeAt equals:visibleRect.origin message:@"Second text field not at lower right corner in visible rect"];
|
||||
|
||||
// Make the first text field visible again
|
||||
[textField1 scrollRectToVisible:[textField2 bounds]];
|
||||
hasScrolled = [textField1 scrollRectToVisible:[textField1 bounds]];
|
||||
[self assertTrue:hasScrolled];
|
||||
|
||||
visibleRect = [documentView visibleRect];
|
||||
|
||||
// We should now be back at top left corner
|
||||
[self assertPoint:CGPointMake(0, 0) equals:visibleRect.origin message:@"VisibleRect origin not at top left corner again"];
|
||||
[self assertPoint:CGPointMake(10, 10) equals:visibleRect.origin message:@"VisibleRect origin not at top left corner again"];
|
||||
|
||||
// Try to scroll again and it should not scroll
|
||||
hasScrolled = [textField1 scrollRectToVisible:[textField1 bounds]];
|
||||
[self assertFalse:hasScrolled];
|
||||
}
|
||||
|
||||
- (void)testScrollRectToVisibleWithLargeRect
|
||||
{
|
||||
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)],
|
||||
documentView = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 1000, 1000)],
|
||||
view1 = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)],
|
||||
view2 = [[CPView alloc] initWithFrame:CGRectMake(500, 500, 200, 200)],
|
||||
view1Size = CGSizeMakeCopy([view1 bounds].size),
|
||||
view2Size = CGSizeMakeCopy([view2 bounds].size);
|
||||
|
||||
[scrollView setDocumentView:documentView];
|
||||
|
||||
[view1 setFrameOrigin:CGPointMake(0, 0)];
|
||||
[view2 setFrameOrigin:CGPointMake(500, 500)];
|
||||
|
||||
[documentView addSubview:view1];
|
||||
[documentView addSubview:view2];
|
||||
|
||||
var visibleRect = [documentView visibleRect],
|
||||
originalVisibleSize = CGSizeMakeCopy(visibleRect.size);
|
||||
|
||||
// Make sure we are at the top left corner
|
||||
[self assertPoint:CGPointMake(0, 0) equals:visibleRect.origin message:@"VisibleRect origin not at top left corner"];
|
||||
|
||||
// Make the second view visible
|
||||
var hasScrolled = [view2 scrollRectToVisible:[view2 bounds]];
|
||||
|
||||
[self assertTrue:hasScrolled];
|
||||
|
||||
visibleRect = [documentView visibleRect];
|
||||
|
||||
// We should now have the origin of view2 in the upper left corner
|
||||
[self assertPoint:CGPointMake(500, 500) equals:visibleRect.origin message:@"Origin of second view not at upper left corner in visible rect"];
|
||||
|
||||
// Make the first view visible again
|
||||
hasScrolled = [view1 scrollRectToVisible:[view1 bounds]];
|
||||
[self assertTrue:hasScrolled];
|
||||
|
||||
visibleRect = [documentView visibleRect];
|
||||
|
||||
var visibleRectOriginShouldBeAt = CGPointMake(200 - visibleRect.size.width, 200 - visibleRect.size.height);
|
||||
|
||||
// We should now be back almost at top left corner except that the lower right corner of the rect should be at the lower right corner of the visible rect.
|
||||
[self assertPoint:visibleRectOriginShouldBeAt equals:visibleRect.origin message:@"VisibleRect origin not at top left corner again"];
|
||||
|
||||
// Try to scroll again and it should not scroll even as some parts are outside the visible rect
|
||||
hasScrolled = [view1 scrollRectToVisible:[view1 bounds]];
|
||||
[self assertFalse:hasScrolled];
|
||||
}
|
||||
|
||||
-(void)testNotificationsRegistered
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
[numberFormatter setNumberStyle:CPNumberFormatterDecimalStyle];
|
||||
[numberFormatter setMaximumFractionDigits:3];
|
||||
[numberFormatter setGeneratesDecimalNumbers:NO];
|
||||
|
||||
[control setFormatter:numberFormatter];
|
||||
[control setStringValue:@"12.3456"];
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
|
||||
[numberFormatter setMinimum:10];
|
||||
[numberFormatter setMaximum:20];
|
||||
[numberFormatter setGeneratesDecimalNumbers:NO];
|
||||
|
||||
[self assertTrue:[numberFormatter getObjectValue:objectValueRef forString:@"10" errorDescription:nil]
|
||||
message:@"MinMax T1: Expected True."];
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
// This is called when the application is done loading.
|
||||
[[CPPlatformWindow alloc] initWithWindow:externalWindow];
|
||||
[externalWindow setDelegate:self];
|
||||
[theWindow setDelegate:self];
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
@@ -43,7 +44,7 @@
|
||||
|
||||
- (IBAction)closeWindow:(id)sender
|
||||
{
|
||||
[externalWindow orderOut:sender];
|
||||
[externalWindow close];
|
||||
}
|
||||
|
||||
- (IBAction)changeFrame:(id)sender
|
||||
@@ -96,9 +97,36 @@
|
||||
CPLog.debug("windowDidResize:");
|
||||
}
|
||||
|
||||
- (CPSize)windowWillResize:(CPWindow)sender toSize:(CPSize)aSize
|
||||
{
|
||||
CPLog.debug("windowWillResize:toSize");
|
||||
return aSize;
|
||||
}
|
||||
|
||||
- (void)windowWillClose:(CPWindow)aWindow
|
||||
{
|
||||
CPLog.debug("windowWillClose:");
|
||||
}
|
||||
|
||||
- (void)applicationDidResignActive:(CPNotification)aNotification
|
||||
{
|
||||
CPLog.debug(@"applicationDidResignActive");
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(CPNotification)aNotification
|
||||
{
|
||||
CPLog.debug(@"applicationDidBecomeActive");
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(CPNotification)aNotification
|
||||
{
|
||||
CPLog.debug(@"applicationWillResignActive");
|
||||
}
|
||||
|
||||
- (void)applicationWillBecomeActive:(CPNotification)aNotification
|
||||
{
|
||||
CPLog.debug(@"applicationWillBecomeActive");
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,20 +2,23 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">14D87h</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">6751</string>
|
||||
<string key="IBDocument.AppKitVersion">1347.23</string>
|
||||
<string key="IBDocument.HIToolboxVersion">758.40</string>
|
||||
<string key="IBDocument.SystemVersion">14D72i</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">6254</string>
|
||||
<string key="IBDocument.AppKitVersion">1347.13</string>
|
||||
<string key="IBDocument.HIToolboxVersion">758.30</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">6751</string>
|
||||
<string key="NS.object.0">6254</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSButton</string>
|
||||
<string>NSButtonCell</string>
|
||||
<string>NSCustomObject</string>
|
||||
<string>NSCustomView</string>
|
||||
<string>NSMenu</string>
|
||||
<string>NSMenuItem</string>
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSView</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
</array>
|
||||
@@ -704,6 +707,7 @@
|
||||
<string key="NSFrame">{{25, 215}, {131, 32}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1009050623"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="791299498">
|
||||
@@ -722,13 +726,74 @@
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="1009050623">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{31, 192}, {119, 22}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="914431212">
|
||||
<int key="NSCellFlags">-1804599231</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents"/>
|
||||
<reference key="NSSupport" ref="1015351812"/>
|
||||
<string key="NSCellIdentifier">_NS:9</string>
|
||||
<reference key="NSControlView" ref="1009050623"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="726780499">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">textBackgroundColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor" id="1023782663">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">textColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<int key="NSTextFieldAlignmentRectInsetsVersion">1</int>
|
||||
</object>
|
||||
<object class="NSTextField" id="165235743">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{31, 160}, {119, 22}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="952810071">
|
||||
<int key="NSCellFlags">-1804599231</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents"/>
|
||||
<reference key="NSSupport" ref="1015351812"/>
|
||||
<string key="NSCellIdentifier">_NS:9</string>
|
||||
<reference key="NSControlView" ref="165235743"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<reference key="NSBackgroundColor" ref="726780499"/>
|
||||
<reference key="NSTextColor" ref="1023782663"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<int key="NSTextFieldAlignmentRectInsetsVersion">1</int>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{480, 360}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1038331095"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
@@ -804,6 +869,7 @@
|
||||
<string key="NSFrame">{{353, 199}, {107, 32}}</string>
|
||||
<reference key="NSSuperview" ref="989016706"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="920098883"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="82365316">
|
||||
@@ -822,13 +888,69 @@
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSTextField" id="920098883">
|
||||
<reference key="NSNextResponder" ref="989016706"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{228, 176}, {119, 22}}</string>
|
||||
<reference key="NSSuperview" ref="989016706"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="32712188"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="341267771">
|
||||
<int key="NSCellFlags">-1804599231</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents"/>
|
||||
<reference key="NSSupport" ref="1015351812"/>
|
||||
<string key="NSCellIdentifier">_NS:9</string>
|
||||
<reference key="NSControlView" ref="920098883"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<reference key="NSBackgroundColor" ref="726780499"/>
|
||||
<reference key="NSTextColor" ref="1023782663"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<int key="NSTextFieldAlignmentRectInsetsVersion">1</int>
|
||||
</object>
|
||||
<object class="NSTextField" id="100542543">
|
||||
<reference key="NSNextResponder" ref="989016706"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{228, 144}, {119, 22}}</string>
|
||||
<reference key="NSSuperview" ref="989016706"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="827322042">
|
||||
<int key="NSCellFlags">-1804599231</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents"/>
|
||||
<reference key="NSSupport" ref="1015351812"/>
|
||||
<string key="NSCellIdentifier">_NS:9</string>
|
||||
<reference key="NSControlView" ref="100542543"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<reference key="NSBackgroundColor" ref="726780499"/>
|
||||
<reference key="NSTextColor" ref="1023782663"/>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<int key="NSTextFieldAlignmentRectInsetsVersion">1</int>
|
||||
</object>
|
||||
<object class="NSCustomView" id="32712188">
|
||||
<reference key="NSNextResponder" ref="989016706"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrameSize">{562, 29}</string>
|
||||
<reference key="NSSuperview" ref="989016706"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<nil key="NSClassName"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{562, 270}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="917631978"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:20</string>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
@@ -1655,6 +1777,8 @@
|
||||
<reference ref="1038331095"/>
|
||||
<reference ref="252080479"/>
|
||||
<reference ref="1042479063"/>
|
||||
<reference ref="1009050623"/>
|
||||
<reference ref="165235743"/>
|
||||
</array>
|
||||
<reference key="parent" ref="972006081"/>
|
||||
</object>
|
||||
@@ -1717,6 +1841,9 @@
|
||||
<reference ref="917631978"/>
|
||||
<reference ref="1021847828"/>
|
||||
<reference ref="149576490"/>
|
||||
<reference ref="920098883"/>
|
||||
<reference ref="32712188"/>
|
||||
<reference ref="100542543"/>
|
||||
</array>
|
||||
<reference key="parent" ref="223875758"/>
|
||||
</object>
|
||||
@@ -1759,6 +1886,63 @@
|
||||
<reference key="object" ref="82365316"/>
|
||||
<reference key="parent" ref="149576490"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">487</int>
|
||||
<reference key="object" ref="1009050623"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="914431212"/>
|
||||
</array>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">488</int>
|
||||
<reference key="object" ref="914431212"/>
|
||||
<reference key="parent" ref="1009050623"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">489</int>
|
||||
<reference key="object" ref="920098883"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="341267771"/>
|
||||
</array>
|
||||
<reference key="parent" ref="989016706"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">490</int>
|
||||
<reference key="object" ref="341267771"/>
|
||||
<reference key="parent" ref="920098883"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">491</int>
|
||||
<reference key="object" ref="32712188"/>
|
||||
<reference key="parent" ref="989016706"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">492</int>
|
||||
<reference key="object" ref="165235743"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="952810071"/>
|
||||
</array>
|
||||
<reference key="parent" ref="439893737"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">493</int>
|
||||
<reference key="object" ref="952810071"/>
|
||||
<reference key="parent" ref="165235743"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">494</int>
|
||||
<reference key="object" ref="100542543"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="827322042"/>
|
||||
</array>
|
||||
<reference key="parent" ref="989016706"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">495</int>
|
||||
<reference key="object" ref="827322042"/>
|
||||
<reference key="parent" ref="100542543"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -1841,6 +2025,32 @@
|
||||
<string key="475.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="481.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="482.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="487.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="488.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="489.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="490.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSMutableDictionary" key="491.IBAttributePlaceholdersKey">
|
||||
<string key="NS.key.0">IBUserDefinedRuntimeAttributesPlaceholderName</string>
|
||||
<object class="IBUserDefinedRuntimeAttributesPlaceholder" key="NS.object.0">
|
||||
<string key="name">IBUserDefinedRuntimeAttributesPlaceholderName</string>
|
||||
<reference key="object" ref="32712188"/>
|
||||
<array key="userDefinedRuntimeAttributes">
|
||||
<object class="IBUserDefinedRuntimeAttribute">
|
||||
<string key="typeIdentifier">com.apple.InterfaceBuilder.userDefinedRuntimeAttributeType.color</string>
|
||||
<string key="keyPath">backgroundColor</string>
|
||||
<object class="NSColor" key="value">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
</object>
|
||||
<string key="491.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="492.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="493.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="494.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="495.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1859,7 +2069,7 @@
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">486</int>
|
||||
<int key="maxID">495</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,12 +3,12 @@
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">14C109</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">6250</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">6751</string>
|
||||
<string key="IBDocument.AppKitVersion">1344.72</string>
|
||||
<string key="IBDocument.HIToolboxVersion">757.30</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">6250</string>
|
||||
<string key="NS.object.0">6751</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSButton</string>
|
||||
@@ -134,7 +134,7 @@
|
||||
<object class="NSButton" id="123071631">
|
||||
<reference key="NSNextResponder" ref="439893737"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{122, 258}, {237, 32}}</string>
|
||||
<string key="NSFrame">{{125, 258}, {237, 32}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="472933256"/>
|
||||
@@ -623,7 +623,6 @@
|
||||
<string key="NSFrame">{{125, 79}, {288, 32}}</string>
|
||||
<reference key="NSSuperview" ref="439893737"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="250338297">
|
||||
@@ -847,7 +846,6 @@
|
||||
<int key="objectID">372</int>
|
||||
<reference key="object" ref="439893737"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="123071631"/>
|
||||
<reference ref="472933256"/>
|
||||
<reference ref="731226501"/>
|
||||
<reference ref="980825207"/>
|
||||
@@ -868,6 +866,7 @@
|
||||
<reference ref="63209018"/>
|
||||
<reference ref="193468607"/>
|
||||
<reference ref="131033007"/>
|
||||
<reference ref="123071631"/>
|
||||
</array>
|
||||
<reference key="parent" ref="972006081"/>
|
||||
</object>
|
||||
@@ -1324,176 +1323,6 @@
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSActionCell</string>
|
||||
<string key="superclassName">NSCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSApplication</string>
|
||||
<string key="superclassName">NSResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSButton</string>
|
||||
<string key="superclassName">NSControl</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSButtonCell</string>
|
||||
<string key="superclassName">NSActionCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSCell</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSControl</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSFormatter</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSMenu</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSMenuItem</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSMenuItemCell</string>
|
||||
<string key="superclassName">NSButtonCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSMenuItemCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSPopUpButton</string>
|
||||
<string key="superclassName">NSButton</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSPopUpButton.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSPopUpButtonCell</string>
|
||||
<string key="superclassName">NSMenuItemCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSPopUpButtonCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSResponder</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSSegmentedCell</string>
|
||||
<string key="superclassName">NSActionCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSSegmentedCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSSegmentedControl</string>
|
||||
<string key="superclassName">NSControl</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSSegmentedControl.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSStepper</string>
|
||||
<string key="superclassName">NSControl</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSStepper.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSStepperCell</string>
|
||||
<string key="superclassName">NSActionCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSStepperCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSTextField</string>
|
||||
<string key="superclassName">NSControl</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSTextFieldCell</string>
|
||||
<string key="superclassName">NSActionCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSView</string>
|
||||
<string key="superclassName">NSResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSWindow</string>
|
||||
<string key="superclassName">NSResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
@@ -25,6 +26,8 @@
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
[splitViewA setDelegate:self];
|
||||
|
||||
// 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.
|
||||
@@ -67,4 +70,19 @@
|
||||
[self setAutosaveName:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation AppController (Delegate)
|
||||
|
||||
- (void)splitViewDidResizeSubviews:(CPNotification)aNotification
|
||||
{
|
||||
console.error(@"splitViewDidResizeSubviews")
|
||||
}
|
||||
|
||||
- (void)splitViewWillResizeSubviews:(CPNotification)aNotification
|
||||
{
|
||||
console.error(@"splitViewWillResizeSubviews")
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user