Added support for new tracking in CPTextField and CPImageView.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-01-21 15:07:41 -08:00
parent 7c2e6875c6
commit 815e12be66
3 changed files with 26 additions and 1 deletions
+11
View File
@@ -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
+6
View File
@@ -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",
+9 -1
View File
@@ -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
*/