mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-15 15:11:28 +00:00
Added support for new tracking in CPTextField and CPImageView.
Reviewed by me.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user