diff --git a/AppKit/CPImage.j b/AppKit/CPImage.j index 7c4a050c3..34ff42ee7 100644 --- a/AppKit/CPImage.j +++ b/AppKit/CPImage.j @@ -38,6 +38,17 @@ CPImageLoadStatusReadError = 6; CPImageDidLoadNotification = @"CPImageDidLoadNotification"; +function CPImageInBundle(aFilename, aSize, aBundle) +{ + if (!aBundle) + aBundle = [CPBundle mainBundle]; + + if (aSize) + return [[CPImage alloc] initWithContentsOfFile:[aBundle pathForResource:aFilename] size:aSize]; + + return [[CPImage alloc] initWithContentsOfFile:[aBundle pathForResource:aFilename]]; +} + @implementation CPBundle (CPImageAdditions) - (CPString)pathForResource:(CPString)aFilename diff --git a/AppKit/CPImageView.j b/AppKit/CPImageView.j index f8086c4e9..5391bea51 100644 --- a/AppKit/CPImageView.j +++ b/AppKit/CPImageView.j @@ -346,6 +346,12 @@ var LEFT_SHADOW_INSET = 3.0, [_shadowView setFrame:_CGRectMake(x - LEFT_SHADOW_INSET, y - TOP_SHADOW_INSET, width + insetWidth, height + insetHeight)]; } +- (void)mouseDown:(CPEvent)anEvent +{ + // Should we do something with this event? + [[self nextResponder] mouseDown:anEvent]; +} + @end var CPImageViewImageKey = @"CPImageViewImageKey", diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 36179e976..e81a786c6 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -513,6 +513,14 @@ var _CPTextFieldSquareBezelColor = nil, return YES; } +- (void)mouseDown:(CPEvent)anEvent +{ + if (![self isEditable]) + return [[self nextResponder] mouseDown:anEvent]; + + [super mouseDown:anEvent]; +} +/* - (void)mouseUp:(CPEvent)anEvent { if (_isEditable && [[self window] firstResponder] == self) @@ -520,7 +528,7 @@ var _CPTextFieldSquareBezelColor = nil, [super mouseUp:anEvent]; } - +*/ /*! Sets whether or not the receiver text field can be edited */