diff --git a/AppKit/CPMenu/_CPMenuManager.j b/AppKit/CPMenu/_CPMenuManager.j index a95bc5fba..15af786fb 100644 --- a/AppKit/CPMenu/_CPMenuManager.j +++ b/AppKit/CPMenu/_CPMenuManager.j @@ -243,9 +243,15 @@ var STICKY_TIME_INTERVAL = 500, // Close the current menu item because we are going to select a new one after a short delay [self showMenu:nil fromMenu:activeMenu atPoint:CGPointMakeZero()]; - _showTimerID = setTimeout(function() { + + if (![activeMenuContainer isMenuBar]) + { + _showTimerID = setTimeout(function() { + [self showMenu:[activeItem submenu] fromMenu:[activeItem menu] atPoint:newMenuOrigin]; + }, 250); + } + else [self showMenu:[activeItem submenu] fromMenu:[activeItem menu] atPoint:newMenuOrigin]; - }, 250); } } diff --git a/AppKit/CPSplitView.j b/AppKit/CPSplitView.j index 16e58d422..f47f1e4b7 100644 --- a/AppKit/CPSplitView.j +++ b/AppKit/CPSplitView.j @@ -739,41 +739,59 @@ var CPSplitViewHorizontalImage = nil, Sets the delegate of the receiver. Possible delegate methods to implement are listed below. -
- - (void)splitViewDidResizeSubviews:(CPSplitView)aSplitView; - Notifies the delegate when the subviews have resized. +Notifies the delegate when the subviews have resized. +@code +- (void)splitViewDidResizeSubviews:(CPNotification)aNotification; +@endcode - - (void)splitViewWillResizeSubviews:(CPSplitView)aSplitView; - Notifies the delegate when the subviews will be resized. +Notifies the delegate when the subviews will be resized. +@code +- (void)splitViewWillResizeSubviews:(CPNotification)aNotification; +@endcode - - (CGRect)splitView:(CPSplitView)aSplitView effectiveRect:(CGRect)aRect forDrawnRect:(CGRect)aDrawnRect ofDividerAtIndex:(int)aDividerIndex; - Lets the delegate specify a different rect for which the user can drag the splitView divider. +Lets the delegate specify a different rect for which the user can drag the splitView divider. +@code +- (CGRect)splitView:(CPSplitView)aSplitView effectiveRect:(CGRect)aRect forDrawnRect:(CGRect)aDrawnRect ofDividerAtIndex:(int)aDividerIndex; +@endcode - - (CGRect)splitView:(CPSplitView)aSplitView additionalEffectiveRectOfDividerAtIndex:(int)indexOfDivider; - Lets the delegate specify an additional rect for which the user can drag the splitview divider. +Lets the delegate specify an additional rect for which the user can drag the splitview divider. +@code +- (CGRect)splitView:(CPSplitView)aSplitView additionalEffectiveRectOfDividerAtIndex:(int)indexOfDivider; +@endcode - - (BOOL)splitView:(CPSplitView)aSplitView canCollapseSubview:(CPView)aSubview; - Notifies the delegate that the splitview is about to be collapsed. This usually happens when the user - Double clicks on the divider. Return YES if the subview can be collapsed, otherwise NO. +Notifies the delegate that the splitview is about to be collapsed. This usually happens when the user +Double clicks on the divider. Return YES if the subview can be collapsed, otherwise NO. +@code +- (BOOL)splitView:(CPSplitView)aSplitView canCollapseSubview:(CPView)aSubview; +@endcode - - (BOOL)splitView:(CPSplitView)aSplitView shouldCollapseSubview:(CPView)aSubview forDoubleClickOnDividerAtIndex:(int)indexOfDivider; - Notifies the delegate that the subview at indexOfDivider is about to be collapsed. This usually happens when the user - Double clicks on the divider. Return YES if the subview should be collapsed, otherwise NO. +Notifies the delegate that the subview at indexOfDivider is about to be collapsed. This usually happens when the user +Double clicks on the divider. Return YES if the subview should be collapsed, otherwise NO. +@code + - (BOOL)splitView:(CPSplitView)aSplitView shouldCollapseSubview:(CPView)aSubview forDoubleClickOnDividerAtIndex:(int)indexOfDivider; +@endcode - - (float)splitView:(CPSplitView)aSpiltView constrainSplitPosition:(float)proposedPosition ofSubviewAt:(int)subviewIndex; - Allows the delegate to constrain the subview beings resized. This method is called continuously as the user resizes the divider. - For example if the subview needs to have a width which is a multiple of a certain number you could return that multiple with this method. +Allows the delegate to constrain the subview beings resized. This method is called continuously as the user resizes the divider. +For example if the subview needs to have a width which is a multiple of a certain number you could return that multiple with this method. +@code +- (float)splitView:(CPSplitView)aSpiltView constrainSplitPosition:(float)proposedPosition ofSubviewAt:(int)subviewIndex; +@endcode - - (float)splitView:(CPSplitView)aSplitView constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)subviewIndex; - Allows the delegate to constrain the minimum position of a subview. +Allows the delegate to constrain the minimum position of a subview. +@code +- (float)splitView:(CPSplitView)aSplitView constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)subviewIndex; +@endcode - - (float)splitView:(CPSplitView)aSplitView constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)subviewIndex; - Allows the delegate to constrain the maximum position of a subview. +Allows the delegate to constrain the maximum position of a subview. +@code +- (float)splitView:(CPSplitView)aSplitView constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)subviewIndex; +@endcode - - (void)splitView:(CPSplitView)aSplitView resizeSubviewsWithOldSize:(CGSize)oldSize; - Allows the splitview to specify a custom resizing behavior. This is called when the splitview is resized. - The sum of the views and the sum of the dividers should be equal to the size of the splitview. -+Allows the splitview to specify a custom resizing behavior. This is called when the splitview is resized. +The sum of the views and the sum of the dividers should be equal to the size of the splitview. +@code +- (void)splitView:(CPSplitView)aSplitView resizeSubviewsWithOldSize:(CGSize)oldSize; +@endcode @param delegate - The delegate of the splitview. */ diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index dcdc9e727..8a2f6e43f 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -193,24 +193,24 @@ var SHADOW_MARGIN_LEFT = 20.0, _CPWindowShadowColor = nil; var CPWindowSaveImage = nil, - CPWindowSavingImage = nil; + CPWindowSavingImage = nil, -var CPWindowResizeTime = 0.2; + CPWindowResizeTime = 0.2; /* Keys for which action messages will be sent by default when unhandled, e.g. complete:. */ var CPWindowActionMessageKeys = [ - CPLeftArrowFunctionKey, - CPRightArrowFunctionKey, - CPUpArrowFunctionKey, - CPDownArrowFunctionKey, - CPPageUpFunctionKey, - CPPageDownFunctionKey, - CPHomeFunctionKey, - CPEndFunctionKey, - CPEscapeFunctionKey -]; + CPLeftArrowFunctionKey, + CPRightArrowFunctionKey, + CPUpArrowFunctionKey, + CPDownArrowFunctionKey, + CPPageUpFunctionKey, + CPPageDownFunctionKey, + CPHomeFunctionKey, + CPEndFunctionKey, + CPEscapeFunctionKey + ]; /*! @ingroup appkit @@ -2377,7 +2377,9 @@ CPTexturedBackgroundWindowMask // an event going of the responder chain is passed to the input system as a last resort. // However, the only methods I could get Cocoa to call automatically are // moveUp: moveDown: moveLeft: moveRight: pageUp: pageDown: and complete: - [self _processKeyboardUIKey:anEvent]; + // Unhandled events just travel further up the responder chain _past_ the window. + if (![self _processKeyboardUIKey:anEvent]) + [super keyDown:anEvent]; } /* @@ -2412,6 +2414,8 @@ CPTexturedBackgroundWindowMask // The difference is that doCommandBySelector: will also send the action to the window and application delegates. [[self firstResponder] doCommandBySelector:@selector(complete:)]; } + + return NO; } - (void)_dirtyKeyViewLoop diff --git a/AppKit/CoreGraphics/CGContext.j b/AppKit/CoreGraphics/CGContext.j index 34eb0c603..88de992c1 100644 --- a/AppKit/CoreGraphics/CGContext.j +++ b/AppKit/CoreGraphics/CGContext.j @@ -606,7 +606,7 @@ function CGContextStrokeLineSegments(aContext, points, count) { var i = 0; - if (arguments["count"] == NULL) + if (count === NULL) var count = points.length; CGContextBeginPath(aContext); diff --git a/AppKit/CoreGraphics/CGContextCanvas.j b/AppKit/CoreGraphics/CGContextCanvas.j index 5a12aae01..288ab147f 100644 --- a/AppKit/CoreGraphics/CGContextCanvas.j +++ b/AppKit/CoreGraphics/CGContextCanvas.j @@ -144,7 +144,7 @@ function CGContextAddRects(aContext, rects, count) { var i = 0; - if (arguments["count"] == NULL) + if (count === NULL) var count = rects.length; for (; i < count; ++i) @@ -194,7 +194,7 @@ function CGContextFillRects(aContext, rects, count) { var i = 0; - if (arguments["count"] == NULL) + if (count === NULL) var count = rects.length; for (; i < count; ++i) @@ -225,7 +225,7 @@ function CGContextClipToRect(aContext, aRect) function CGContextClipToRects(aContext, rects, count) { - if (arguments["count"] == NULL) + if (count === NULL) var count = rects.length; _CGContextBeginPathCanvas(aContext); diff --git a/AppKit/CoreGraphics/CGGradient.j b/AppKit/CoreGraphics/CGGradient.j index 29b5d149f..e8396aa3d 100644 --- a/AppKit/CoreGraphics/CGGradient.j +++ b/AppKit/CoreGraphics/CGGradient.j @@ -29,10 +29,10 @@ kCGGradientDrawsAfterEndLocation = 1 << 1; function CGGradientCreateWithColorComponents(aColorSpace, components, locations, count) { - if (arguments["locations"] == NULL) + if (locations === NULL) var locations = [0.0, 1.0]; - if (arguments["count"] == NULL) + if (count === NULL) var count = locations.length; var colors = []; @@ -58,4 +58,4 @@ function CGGradientRelease() function CGGradientRetain(aGradient) { return aGradient; -} \ No newline at end of file +} diff --git a/AppKit/CoreGraphics/CGPath.j b/AppKit/CoreGraphics/CGPath.j index 5dde217cb..bc0fe4c2f 100644 --- a/AppKit/CoreGraphics/CGPath.j +++ b/AppKit/CoreGraphics/CGPath.j @@ -141,7 +141,7 @@ function CGPathAddLines(aPath, aTransform, points, count) { var i = 1; - if (arguments["count"] == NULL) + if (count === NULL) var count = points.length; if (!aPath || count < 2) @@ -224,7 +224,7 @@ function CGPathAddRects(aPath, aTransform, rects, count) { var i = 0; - if (arguments["count"] == NULL) + if (count === NULL) var count = rects.length; for (; i < count; ++i) diff --git a/Tests/AppKit/CGGradientTest.j b/Tests/AppKit/CGGradientTest.j new file mode 100644 index 000000000..187dd713d --- /dev/null +++ b/Tests/AppKit/CGGradientTest.j @@ -0,0 +1,66 @@ +@import