mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-23 15:05:52 +00:00
A number of Cib improvments.
Reviewed by me.
This commit is contained in:
1 parent
53aadde343
commit
670ebee06d
5 files changed
+30
-22
No files matched your search
+1
-1
@@ -794,7 +794,7 @@ var DOMElementPrototype = nil,
|
||||
*/
|
||||
- (void)resizeWithOldSuperviewSize:(CGSize)aSize
|
||||
{
|
||||
var mask = _autoresizingMask;
|
||||
var mask = [self autoresizingMask];
|
||||
|
||||
if(mask == CPViewNotSizable)
|
||||
return;
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ var CPCibObjectDataKey = @"CPCibObjectDataKey";
|
||||
}
|
||||
|
||||
// Display Visible Windows.
|
||||
[[objectData visibleWindows] makeObjectsPerformSelector:@selector(makeKeyAndOrderFront:) withObject:self];
|
||||
[objectData displayVisibleWindows];
|
||||
|
||||
/*
|
||||
// [objectData establishConnectionsWithOwner:owner topLevelObjects:topLevelObjects];
|
||||
|
||||
@@ -46,12 +46,8 @@ var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey";
|
||||
self = [super initWithCoder:aCoder];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_className = [aCoder decodeObjectForKey:_CPCibCustomViewClassNameKey];
|
||||
|
||||
[self setBackgroundColor:[CPColor blueColor]];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -62,6 +58,18 @@ var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey";
|
||||
[aCoder encodeObject:_className forKey:_CPCibCustomViewClassNameKey];
|
||||
}
|
||||
|
||||
- (void)drawRect:(CGRect)aRect
|
||||
{
|
||||
var bounds = [self bounds],
|
||||
context = [[CPGraphicsContext currentContext] graphicsPort];
|
||||
|
||||
CGContextSetLineWidth(context, 1.0);
|
||||
CGContextSetStrokeColor(context, [CPColor colorWithCalibratedRed:169.0 / 255.0 green:173.0 / 255.0 blue:178.0 / 255.0 alpha:1.0]);
|
||||
CGContextStrokeRect(context, CGRectInset(CGRectIntegral(bounds), 0.5, 0.5));
|
||||
CGContextSetFillColor(context, [CPColor colorWithCalibratedRed:224.0 / 255.0 green:236.0 / 255.0 blue:250.0 / 255.0 alpha:1.0]);
|
||||
CGContextFillRect(context, CGRectInset(bounds, 2.0, 2.0));
|
||||
}
|
||||
|
||||
- (id)_cibInstantiate
|
||||
{
|
||||
var theClass = CPClassFromString(_className);
|
||||
@@ -77,15 +85,16 @@ var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey";
|
||||
|
||||
// Hey this is us!
|
||||
if (theClass === [self class])
|
||||
{
|
||||
_className = @"CPView";
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
var view = [[theClass alloc] initWithFrame:[self frame]];
|
||||
|
||||
if (view)
|
||||
{
|
||||
view._superview = _superview;
|
||||
view._window = _window; // Doesn't matter that we don't call _setWindow: since nothing has a window yet anyways(?)
|
||||
|
||||
[view setBounds:[self bounds]];
|
||||
|
||||
// Since the object replacement logic hasn't had a chance to kick in yet, we need to do it manually:
|
||||
@@ -104,7 +113,9 @@ var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey";
|
||||
[view setHitTests:[self hitTests]];
|
||||
[view setHidden:[self isHidden]];
|
||||
[view setAlphaValue:[self alphaValue]];
|
||||
|
||||
|
||||
[_superview replaceSubview:self with:view];
|
||||
|
||||
[view setBackgroundColor:[self backgroundColor]];
|
||||
}
|
||||
|
||||
|
||||
@@ -26,14 +26,6 @@
|
||||
return _bundle;
|
||||
}
|
||||
|
||||
- (id)unarchiver:(CPKeyedUnarchiver)aKeyedUnarchiver didDecodeObject:(id)anObject
|
||||
{
|
||||
if ([anObject respondsToSelector:@selector(_cibInstantiate)])
|
||||
return [anObject _cibInstantiate];
|
||||
|
||||
return anObject;
|
||||
}
|
||||
|
||||
- (void)replaceObjectAtUID:(int)aUID withObject:(id)anObject
|
||||
{
|
||||
_objects[aUID] = anObject;
|
||||
|
||||
@@ -71,9 +71,13 @@
|
||||
return _namesKeys[index];
|
||||
}
|
||||
|
||||
- (CPSet)visibleWindows
|
||||
- (void)displayVisibleWindows
|
||||
{
|
||||
return _visibleWindows;
|
||||
var object = nil,
|
||||
objectEnumerator = [_visibleWindows objectEnumerator];
|
||||
|
||||
while (object = [objectEnumerator nextObject])
|
||||
[_replacementObjects[[object hash]] makeKeyAndOrderFront:self];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -187,7 +191,8 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
|
||||
while (count--)
|
||||
{
|
||||
var object = _objectsKeys[count],
|
||||
parent = _objectsValues[count];
|
||||
parent = _objectsValues[count],
|
||||
instantiatedObject = object;
|
||||
|
||||
if ([object respondsToSelector:@selector(_cibInstantiate)])
|
||||
{
|
||||
@@ -198,7 +203,7 @@ var _CPCibObjectDataNamesKeysKey = @"_CPCibObjectDataNamesKeysKey
|
||||
}
|
||||
|
||||
if (topLevelObjects && parent === _fileOwner && object !== _fileOwner)
|
||||
topLevelObjects.push(object);
|
||||
topLevelObjects.push(instantiatedObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user