From 47bc7e812dcf71ed6271aca3c0f878b64d791dae Mon Sep 17 00:00:00 2001 From: saikat Date: Sun, 28 Feb 2010 00:52:51 -0800 Subject: [PATCH 1/5] Fix for issue #511 - disabling a menu item in the menu item's action --- AppKit/CPMenuItem/_CPMenuItemMenuBarView.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPMenuItem/_CPMenuItemMenuBarView.j b/AppKit/CPMenuItem/_CPMenuItemMenuBarView.j index 6e232fef8..6342ef99e 100644 --- a/AppKit/CPMenuItem/_CPMenuItemMenuBarView.j +++ b/AppKit/CPMenuItem/_CPMenuItemMenuBarView.j @@ -155,7 +155,7 @@ var SelectionColor = nil, { // FIXME: This should probably be even throw. if (![_menuItem isEnabled]) - return; + shouldHighlight = NO; if (shouldHighlight) { From 50b5c21fcfe725dbbee9553382441c13dce332e5 Mon Sep 17 00:00:00 2001 From: saikat Date: Sun, 28 Feb 2010 00:22:47 -0800 Subject: [PATCH 2/5] Fixes calling selectText in the text field's delegate's controlTextDidFocus: method. --- AppKit/CPTextField.j | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 762e4c9b3..b3c452cc0 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -483,6 +483,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); window.setTimeout(function() { element.focus(); + [self textDidFocus:[CPNotification notificationWithName:CPTextFieldDidFocusNotification object:self userInfo:nil]]; CPTextFieldInputOwner = self; }, 0.0); @@ -500,8 +501,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); [[self window] platformWindow]._DOMBodyElement.ondrag = function () {}; [[self window] platformWindow]._DOMBodyElement.onselectstart = function () {}; } - - [self textDidFocus:[CPNotification notificationWithName:CPTextFieldDidFocusNotification object:self userInfo:nil]]; #endif return YES; From ab196e75c1bcd2af86e46aab6023f81e8dad9b8e Mon Sep 17 00:00:00 2001 From: Paul Baumgart Date: Fri, 5 Mar 2010 02:07:13 -0800 Subject: [PATCH 3/5] Fix missing throw in Preprocessor to report an error on unmatched brackets. Closes gh-524 --- Objective-J/Preprocessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objective-J/Preprocessor.js b/Objective-J/Preprocessor.js index e07ccf75a..51bcd4bae 100644 --- a/Objective-J/Preprocessor.js +++ b/Objective-J/Preprocessor.js @@ -855,7 +855,7 @@ Preprocessor.prototype.preprocess = function(tokens, /*StringBuffer*/ aStringBuf // If we get this far and we're parsing an objj_msgSend (or array), then we have a problem. if (tuple) - new SyntaxError(this.error_message("*** Expected ']' - Unterminated message send or array.")); + throw new SyntaxError(this.error_message("*** Expected ']' - Unterminated message send or array.")); if (!aStringBuffer) return buffer; From c478afee0fa0f8f19080be7738fb89efe7d5d76a Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Fri, 5 Mar 2010 12:38:59 -0800 Subject: [PATCH 4/5] Add a missing import to CPTheme. Closes #527. --- AppKit/CPTheme.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTheme.j b/AppKit/CPTheme.j index 499aaa8f7..77bac886d 100644 --- a/AppKit/CPTheme.j +++ b/AppKit/CPTheme.j @@ -22,7 +22,7 @@ @import @import - +@import var CPThemesByName = { }, CPThemeDefaultTheme = nil; From 7d1c7b2907dd373e817c5a8d8b4cff43e389545a Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Fri, 5 Mar 2010 13:46:41 -0800 Subject: [PATCH 5/5] Add missing accessor to CPImageView, and fix nib2cib support for image scaling. Closes #523. --- AppKit/CPImageView.j | 19 +++++-------------- Tools/nib2cib/NSImageView.j | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/AppKit/CPImageView.j b/AppKit/CPImageView.j index ed6eeea42..817ffbd0b 100644 --- a/AppKit/CPImageView.j +++ b/AppKit/CPImageView.j @@ -31,24 +31,10 @@ #include "CoreGraphics/CGGeometry.h" - -/* - @global - @group CPImageScaling -*/ CPScaleProportionally = 0; -/* - @global - @group CPImageScaling -*/ CPScaleToFit = 1; -/* - @global - @group CPImageScaling -*/ CPScaleNone = 2; - var CPImageViewShadowBackgroundColor = nil; var LEFT_SHADOW_INSET = 3.0, @@ -225,6 +211,11 @@ var LEFT_SHADOW_INSET = 3.0, [self setNeedsDisplay:YES]; } +- (unsigned)imageScaling +{ + return [self currentValueForThemeAttribute:@"image-scaling"]; +} + /*! Toggles the display of the image view. */ diff --git a/Tools/nib2cib/NSImageView.j b/Tools/nib2cib/NSImageView.j index 62eb55fe0..2624c2582 100644 --- a/Tools/nib2cib/NSImageView.j +++ b/Tools/nib2cib/NSImageView.j @@ -33,7 +33,7 @@ { var cell = [aCoder decodeObjectForKey:@"NSCell"]; - _imageScaling = [cell imageScaling]; + [self setImageScaling:[cell imageScaling]]; _isEditable = [cell isEditable]; }