More work on child windows

- Popovers are implemented as child windows.
- Renamed _CPAttachedWindow/_CPAttachedWindowView to _CPPopoverWindow/_CPPopoverWindowView, since that is its only use.
- The default for CPView -acceptsFirstMouse is now NO, per Cocoa. Subclasses override this as necessary.
- _CPWindowView -hitTest returns self it the mouse is within a resize region, which may be outside the window's frame.
- Fixed an off by one bug in CPDomWindowLayer -insertWindow:atIndex:, where inserting a visible window behind a window it is already behind would cause it to move up one from its intended position.
- Updated the ChildWindows and CPPopover test apps.
This commit is contained in:
Aparajita Fishman
2013-01-27 10:32:23 +08:00
parent 25633f03c5
commit c29a54e21a
21 changed files with 921 additions and 234 deletions
+1 -1
View File
@@ -1232,7 +1232,7 @@ _CPRunModalLoop = function(anEvent)
if (theWindow == modalSession._window ||
[theWindow worksWhenModal] ||
[theWindow attachedSheet] == modalSession._window || // -dw- allow modal parent of sheet to be repositioned
([theWindow isKindOfClass:_CPAttachedWindow] && [[theWindow targetView] window] === modalSession._window))
([theWindow isKindOfClass:_CPPopoverWindow] && [[theWindow targetView] window] === modalSession._window))
[theWindow sendEvent:anEvent];
};
+1
View File
@@ -35,6 +35,7 @@
@group CPColorPanelMode
*/
CPWheelColorPickerMode = 1;
/*
Slider based picker
@global
+8
View File
@@ -401,6 +401,14 @@ var CPControlBlackColor = [CPColor blackColor];
[self highlight:YES];
}
/*!
Enabled controls accept first mouse by default.
*/
- (BOOL)acceptsFirstMouse:(CPEvent)anEvent
{
return [self isEnabled];
}
- (void)mouseDown:(CPEvent)anEvent
{
if (![self isEnabled])
+5
View File
@@ -320,6 +320,11 @@
[self tile];
}
- (BOOL)acceptsFirstMouse:(CPEvent)anEvent
{
return YES;
}
- (void)mouseDown:(CPEvent)anEvent
{
var constraintRect = CGRectInset([[self platformWindow] visibleFrame], 5.0, 0.0);
+35 -32
View File
@@ -28,7 +28,7 @@
@import "CPImageView.j"
@import "CPResponder.j"
@import "CPView.j"
@import "_CPAttachedWindow.j"
@import "_CPPopoverWindow.j"
CPPopoverBehaviorApplicationDefined = 0;
@@ -45,7 +45,7 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
/*! @ingroup appkit
@class CPPopover
This class represent a widget that displays a attached
This class represent a widget that displays a popover
view relative to another one.
Delegate can implement:
@@ -67,7 +67,7 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
int _appearance @accessors(property=appearance);
int _behavior @accessors(getter=behavior);
_CPAttachedWindow _attachedWindow;
_CPPopoverWindow _popoverWindow;
int _implementedDelegateMethods;
}
@@ -103,9 +103,10 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
*/
- (CGRect)positioningRect
{
if (![_attachedWindow isVisible])
if (![_popoverWindow isVisible])
return CGRectMakeZero();
return [_attachedWindow frame];
return [_popoverWindow frame];
}
/*! Sets the frame of the popover
@@ -113,9 +114,10 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
*/
- (void)setPositioningRect:(CGRect)aRect
{
if (![_attachedWindow isVisible])
if (![_popoverWindow isVisible])
return;
[_attachedWindow setFrame:aRect];
[_popoverWindow setFrame:aRect];
}
/*!
@@ -125,8 +127,9 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
*/
- (CGSize)contentSize
{
if (![_attachedWindow isVisible])
if (![_popoverWindow isVisible])
return CGRectMakeZero();
return [[_contentViewController view] frameSize];
}
@@ -147,7 +150,7 @@ var CPPopoverDelegate_popover_willShow_ = 1 << 0,
*/
- (BOOL)isShown
{
return [_attachedWindow isVisible];
return [_popoverWindow isVisible];
}
/*!
@@ -164,7 +167,7 @@ Set the behavior of the CPPopover. It can be:
return;
_behavior = aBehavior;
[_attachedWindow setStyleMask:[self styleMaskForBehavior]];
[_popoverWindow setStyleMask:[self styleMaskForBehavior]];
}
- (void)setDelegate:(id)aDelegate
@@ -210,29 +213,29 @@ Set the behavior of the CPPopover. It can be:
[CPException raise:CPInternalInconsistencyException reason:@"contentViewController must not be nil"];
// If the popover is currently closing, do nothing. That is what Cocoa does.
if ([_attachedWindow isClosing])
if ([_popoverWindow isClosing])
return;
if (_implementedDelegateMethods & CPPopoverDelegate_popover_willShow_)
[_delegate popoverWillShow:self];
if (!_attachedWindow)
if (!_popoverWindow)
{
_attachedWindow = [[_CPAttachedWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:[self styleMaskForBehavior]];
_popoverWindow = [[_CPPopoverWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:[self styleMaskForBehavior]];
var parentWindow = [positioningView window];
if (![parentWindow isKindOfClass:_CPAttachedWindow])
if (![parentWindow isKindOfClass:_CPPopoverWindow])
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(parentWindowWillClose:) name:CPWindowWillCloseNotification object:parentWindow];
}
[_attachedWindow setAppearance:_appearance];
[_attachedWindow setAnimates:_animates];
[_attachedWindow setDelegate:self];
[_attachedWindow setMovableByWindowBackground:NO];
[_attachedWindow setFrame:[_attachedWindow frameRectForContentRect:[[_contentViewController view] frame]]];
[_attachedWindow setContentView:[_contentViewController view]];
[_attachedWindow positionRelativeToRect:positioningRect ofView:positioningView preferredEdge:preferredEdge];
[_popoverWindow setAppearance:_appearance];
[_popoverWindow setAnimates:_animates];
[_popoverWindow setDelegate:self];
[_popoverWindow setMovableByWindowBackground:NO];
[_popoverWindow setFrame:[_popoverWindow frameRectForContentRect:[[_contentViewController view] frame]]];
[_popoverWindow setContentView:[_contentViewController view]];
[_popoverWindow positionRelativeToRect:positioningRect ofView:positioningView preferredEdge:preferredEdge];
if (!_animates && _implementedDelegateMethods & CPPopoverDelegate_popover_didShow_)
[_delegate popoverDidShow:self];
@@ -256,16 +259,16 @@ Set the behavior of the CPPopover. It can be:
*/
- (void)_close
{
if ([_attachedWindow isClosing] || ![self isShown])
if ([_popoverWindow isClosing] || ![self isShown])
return;
if (_implementedDelegateMethods & CPPopoverDelegate_popover_willClose_)
[_delegate popoverWillClose:self];
[_attachedWindow close];
[_popoverWindow close];
// popoverDidClose will be sent from attachedWindowDidClose, since
// the attached window will close asynchronously when animating.
// popoverDidClose will be sent from popoverWindowDidClose, since
// the popover window will close asynchronously when animating.
}
@@ -279,7 +282,7 @@ Set the behavior of the CPPopover. It can be:
*/
- (IBAction)performClose:(id)sender
{
if ([_attachedWindow isClosing])
if ([_popoverWindow isClosing])
return;
if (_implementedDelegateMethods & CPPopoverDelegate_popover_shouldClose_)
@@ -294,25 +297,25 @@ Set the behavior of the CPPopover. It can be:
#pragma mark Delegates
/*! @ignore */
- (BOOL)attachedWindowShouldClose:(_CPAttachedWindow)anAttachedWindow
- (BOOL)popoverWindowShouldClose:(_CPPopoverWindow)aPopoverWindow
{
[self performClose:self];
// We return NO, because we want the CPPopover to determine
// if the attached window can be closed and to give us a chance
// if the popover window can be closed and to give us a chance
// to send delegate messages.
return NO;
}
/*! @ignore */
- (void)attachedWindowDidClose:(_CPAttachedWindow)anAttachedWindow
- (void)popoverWindowDidClose:(_CPPopoverWindow)aPopoverWindow
{
if (_implementedDelegateMethods & CPPopoverDelegate_popover_didClose_)
[_delegate popoverDidClose:self];
}
/*! @ignore */
- (void)attachedWindowDidShow:(_CPAttachedWindow)anAttachedWindow
- (void)popoverWindowDidShow:(_CPPopoverWindow)aPopoverWindow
{
if (_implementedDelegateMethods & CPPopoverDelegate_popover_didShow_)
[_delegate popoverDidShow:self];
@@ -330,7 +333,7 @@ Set the behavior of the CPPopover. It can be:
*/
- (void)parentWindowWillClose:(CPNotification)aNotification
{
[_attachedWindow orderOut:nil];
[_popoverWindow orderOut:nil];
[self performClose:nil];
}
@@ -347,7 +350,7 @@ Set the behavior of the CPPopover. It can be:
@end
var CPPopoverNeedsNewAttachedWindowKey = @"CPPopoverNeedsNewAttachedWindowKey",
var CPPopoverNeedsNewPopoverWindowKey = @"CPPopoverNeedsNewPopoverWindowKey",
CPPopoverAppearanceKey = @"CPPopoverAppearanceKey",
CPPopoverAnimatesKey = @"CPPopoverAnimatesKey",
CPPopoverContentViewControllerKey = @"CPPopoverContentViewControllerKey",
+1 -2
View File
@@ -1497,10 +1497,9 @@ var CPViewFlags = { },
Returns \c YES by default.
@return \c YES, if the view object accepts first mouse-down event. \c NO, otherwise.
*/
//FIXME: should be NO by default?
- (BOOL)acceptsFirstMouse:(CPEvent)anEvent
{
return YES;
return NO;
}
/*!
+1 -1
View File
@@ -29,7 +29,7 @@
@import "_CPHUDWindowView.j"
@import "_CPBorderlessWindowView.j"
@import "_CPBorderlessBridgeWindowView.j"
@import "_CPAttachedWindowView.j"
@import "_CPPopoverWindowView.j"
@import "_CPModalWindowView.j"
@import "_CPShadowWindowView.j"
@import "CPDragServer.j"
@@ -1,5 +1,5 @@
/*
* _CPAttachedWindowView.j
* _CPPopoverWindowView.j
* AppKit
*
* Created by Antoine Mercadal
@@ -30,18 +30,18 @@
#define ALIGN_STROKE(point) (FLOOR(point) === (point) ? (point) + halfStrokeWidth : (point))
#define ALIGN_COORD(point) (FLOOR(point))
var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
_CPAttachedWindowViewRadius = 5.0,
_CPAttachedWindowViewStrokeWidth = 1.0,
_CPAttachedWindowViewShadowSize = CGSizeMake(0, 6),
_CPAttachedWindowViewShadowBlur = 15.0;
var _CPPopoverWindowViewDefaultCursorSize = _CGSizeMake(16, 10),
_CPPopoverWindowViewRadius = 5.0,
_CPPopoverWindowViewStrokeWidth = 1.0,
_CPPopoverWindowViewShadowSize = _CGSizeMake(0, 6),
_CPPopoverWindowViewShadowBlur = 15.0;
/*!
@ignore
A custom CPWindowView that manages a border and cursor
*/
@implementation _CPAttachedWindowView : _CPWindowView
@implementation _CPPopoverWindowView : _CPWindowView
{
float _arrowOffsetX @accessors(property=arrowOffsetX);
float _arrowOffsetY @accessors(property=arrowOffsetY);
@@ -58,7 +58,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
*/
- (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
{
var contentRect = CGRectMakeCopy(aFrameRect),
var contentRect = _CGRectMakeCopy(aFrameRect),
modifierX = 16,
modifierY = 19;
@@ -66,7 +66,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
//
// @comment: If we use this, each time we open the popover, the content
// view is reduced a little over and over
// return CGRectInset(contentRect, modifierX, modifierY);
// return _CGRectInset(contentRect, modifierX, modifierY);
contentRect.origin.x += modifierX;
contentRect.origin.y += modifierY;
@@ -83,7 +83,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
*/
+ (CGRect)frameRectForContentRect:(CGRect)aContentRect
{
var frameRect = CGRectMakeCopy(aContentRect),
var frameRect = _CGRectMakeCopy(aContentRect),
modifierX = 16,
modifierY = 19;
@@ -91,7 +91,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
// @comment: If we use this, each time we open the popover, the content
//
// view is reduced a little over and over
// return CGRectOffset(frameRect, modifierX, modifierY);
// return _CGRectOffset(frameRect, modifierX, modifierY);
frameRect.origin.x -= modifierX;
frameRect.origin.y -= modifierY;
@@ -111,7 +111,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
_arrowOffsetX = 0.0;
_arrowOffsetY = 0.0;
_appearance = CPPopoverAppearanceMinimal;
_cursorSize = CGSizeMakeCopy(_CPAttachedWindowViewDefaultCursorSize);
_cursorSize = _CGSizeMakeCopy(_CPPopoverWindowViewDefaultCursorSize);
}
return self;
@@ -122,7 +122,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
*/
- (void)hideCursor
{
_cursorSize = CGSizeMakeZero();
_cursorSize = _CGSizeMakeZero();
[self setNeedsDisplay:YES];
}
@@ -131,7 +131,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
*/
- (void)showCursor
{
_cursorSize = CGSizeMakeCopy(_CPAttachedWindowViewDefaultCursorSize);
_cursorSize = _CGSizeMakeCopy(_CPPopoverWindowViewDefaultCursorSize);
[self setNeedsDisplay:YES];
}
@@ -143,15 +143,15 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
[super drawRect:aRect];
var context = [[CPGraphicsContext currentContext] graphicsPort],
radius = _CPAttachedWindowViewRadius,
radius = _CPPopoverWindowViewRadius,
arrowWidth = _cursorSize.width,
arrowHeight = _cursorSize.height,
strokeWidth = _CPAttachedWindowViewStrokeWidth,
strokeWidth = _CPPopoverWindowViewStrokeWidth,
halfStrokeWidth = strokeWidth / 2.0,
strokeColor,
shadowColor = [[CPColor blackColor] colorWithAlphaComponent:.2],
shadowSize = _CPAttachedWindowViewShadowSize,
shadowBlur = _CPAttachedWindowViewShadowBlur,
shadowSize = _CPPopoverWindowViewShadowSize,
shadowBlur = _CPPopoverWindowViewShadowBlur,
gradient,
frame = [self bounds];
@@ -191,7 +191,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
CGContextSetLineWidth(context, strokeWidth);
CGContextBeginPath(context);
CGContextSetShadowWithColor(context, shadowSize, shadowBlur, shadowColor);
CGContextDrawLinearGradient(context, gradient, CGPointMake(CGRectGetMidX(frame), 0.0), CGPointMake(CGRectGetMidX(frame), frame.size.height), 0);
CGContextDrawLinearGradient(context, gradient, _CGPointMake(_CGRectGetMidX(frame), 0.0), _CGPointMake(_CGRectGetMidX(frame), frame.size.height), 0);
var xMin = _CGRectGetMinX(frame),
xMax = _CGRectGetMaxX(frame),
@@ -201,9 +201,9 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
arrowMaxX = ALIGN_COORD(xMax - radius - strokeWidth),
arrowMinY = ALIGN_COORD(yMin + radius + strokeWidth),
arrowMaxY = ALIGN_COORD(yMax - radius + strokeWidth),
arrowAnchor = CGPointMakeZero(),
arrowStart = CGPointMakeZero(),
pt = CGPointMakeZero();
arrowAnchor = _CGPointMakeZero(),
arrowStart = _CGPointMakeZero(),
pt = _CGPointMakeZero();
// draw!
switch (_preferredEdge)
@@ -236,7 +236,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
pt.y = arrowMaxY - arrowWidth;
pt.x = arrowAnchor.x;
arrowStart = CGPointMakeCopy(pt);
arrowStart = _CGPointMakeCopy(pt);
CGContextAddLineToPoint(context, pt.x, pt.y);
// top edge -> point
@@ -278,7 +278,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
pt.y = arrowMaxY;
pt.x = arrowAnchor.x;
arrowStart = CGPointMakeCopy(pt);
arrowStart = _CGPointMakeCopy(pt);
CGContextAddLineToPoint(context, pt.x, pt.y);
// bottom edge -> point
@@ -327,7 +327,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
pt.x = arrowMaxX - arrowWidth;
pt.y = arrowAnchor.y;
arrowStart = CGPointMakeCopy(pt);
arrowStart = _CGPointMakeCopy(pt);
CGContextAddLineToPoint(context, pt.x, pt.y);
// left edge -> point
@@ -369,7 +369,7 @@ var _CPAttachedWindowViewDefaultCursorSize = CGSizeMake(16, 10),
pt.x = arrowMaxX;
pt.y = arrowAnchor.y;
arrowStart = CGPointMakeCopy(pt);
arrowStart = _CGPointMakeCopy(pt);
CGContextAddLineToPoint(context, pt.x, pt.y);
// right edge -> point
+41 -5
View File
@@ -131,6 +131,7 @@ var CPWindowActionMessageKeys = [
CGRect _frame;
int _level;
BOOL _isVisible;
BOOL _hasBeenOrderedIn @accessors;
BOOL _isMiniaturized;
BOOL _isAnimating;
BOOL _hasShadow;
@@ -253,6 +254,7 @@ CPTexturedBackgroundWindowMask
_frame.origin.x = (visibleFrame.size.width - _frame.size.width) / 2;
_frame.origin.y = (visibleFrame.size.height - _frame.size.height) / 2;
}
[self setPlatformWindow:[[CPPlatformWindow alloc] initWithContentRect:_frame]];
[self platformWindow]._only = self;
}
@@ -262,6 +264,7 @@ CPTexturedBackgroundWindowMask
_registeredDraggedTypesArray = [];
_acceptsMouseMovedEvents = YES;
_isMovable = YES;
_hasBeenOrderedIn = NO;
_parentWindow = nil;
_childWindows = [];
@@ -722,7 +725,8 @@ CPTexturedBackgroundWindowMask
var origin = [childWindow frame].origin;
[childWindow setFrameOrigin:_CGPointMake(origin.x + delta.x, origin.y + delta.y)];
}];
}
];
}
/*!
@@ -820,7 +824,7 @@ CPTexturedBackgroundWindowMask
[self orderWindow:CPWindowOut relativeTo:0];
}
- (void)_orderOut
- (void)_orderOutRecursively:(BOOL)recursive
{
if ([self isSheet])
{
@@ -829,8 +833,8 @@ CPTexturedBackgroundWindowMask
return;
}
[_parentWindow removeChildWindow:self];
[_childWindows makeObjectsPerformSelector:@selector(_orderOut)];
if (recursive)
[_childWindows makeObjectsPerformSelector:@selector(_orderOutRecursively:) withObject:recursive];
#if PLATFORM(DOM)
if ([self _sharesChromeWithPlatformWindow])
@@ -850,7 +854,15 @@ CPTexturedBackgroundWindowMask
- (void)orderWindow:(CPWindowOrderingMode)orderingMode relativeTo:(int)otherWindowNumber
{
if (orderingMode === CPWindowOut)
[self _orderOut];
{
var hasParent = !!_parentWindow;
// Directly ordering out will detach a child window
[_parentWindow removeChildWindow:self];
// In Cocoa, a window orders out its child windows only if it has no parent
[self _orderOutRecursively:!hasParent];
}
else if (orderingMode === CPWindowAbove && otherWindowNumber === 0)
[self _orderFront];
else if (orderingMode === CPWindowBelow && otherWindowNumber === 0)
@@ -2155,7 +2167,31 @@ CPTexturedBackgroundWindowMask
[[CPNotificationCenter defaultCenter] postNotificationName:CPWindowWillCloseNotification object:self];
var hasParent = !!_parentWindow;
[self orderOut:nil];
// If a window has no parent, close all of the children
[self _detachFromChildrenClosing:!hasParent];
}
- (void)_detachFromChildrenClosing:(BOOL)shouldClose
{
// When a window is closed, it must detach itself from all children
[_childWindows enumerateObjectsUsingBlock:function(child)
{
[child setParentWindow:nil];
}
];
if (shouldClose)
[_childWindows enumerateObjectsUsingBlock:function(child)
{
[child close];
}
];
_childWindows = [];
}
// Managing Main Status
+10
View File
@@ -158,6 +158,16 @@ _CPWindowViewResizeSlop = 3;
{
}
- (CPView)hitTest:(CGPoint)locationInWindow
{
var region = [self resizeRegionForPoint:[_window convertBaseToGlobal:locationInWindow]];
if (region !== _CPWindowViewResizeRegionNone)
return self;
else
return [super hitTest:locationInWindow];
}
- (BOOL)acceptsFirstMouse:(CPEvent)anEvent
{
return YES;
-2
View File
@@ -111,9 +111,7 @@
[_windowView setAutoresizesSubviews:YES];
if ([_viewClass isKindOfClass:[CPToolbar class]])
{
[theWindow setToolbar:_viewClass];
}
[theWindow setAutorecalculatesKeyViewLoop:_windowAutorecalculatesKeyViewLoop];
[theWindow setFullPlatformWindow:_windowIsFullPlatformWindow];
+7
View File
@@ -88,7 +88,14 @@
// If the window is already a resident of this layer, remove it.
if (isVisible)
{
// Adjust the z-index to start at the window being inserted
zIndex = MIN(zIndex, aWindow._index);
// If the window being inserted is below the insertion index,
// the index will be one less after we remove the window below.
if (aWindow._index < anIndex)
--anIndex;
[_windows removeObjectAtIndex:aWindow._index];
}
else
+8 -8
View File
@@ -1465,6 +1465,8 @@ var resizeTimer = nil;
// If aWindow is a parent, recursively order all of its children after it
if ([[aWindow childWindows] count])
[self _orderChildWindowsOf:aWindow furthestParent:[self _furthestParentOf:aWindow] layer:layer];
[aWindow _setHasBeenOrderedIn:YES];
}
- (CPWindow)_furthestParentOf:(CPWindow)aWindow
@@ -1477,20 +1479,20 @@ var resizeTimer = nil;
return aWindow;
}
- (int)_orderChildWindowsOf:(CPWindow)aWindow furthestParent:(CPWindow)furthestParent layer:(CPDOMWindowLayer)aLayer
- (void)_orderChildWindowsOf:(CPWindow)aWindow furthestParent:(CPWindow)furthestParent layer:(CPDOMWindowLayer)aLayer
{
// When a parent window is ordered, Cocoa orders its child windows
// relative to it or the furthest parent.
var children = [aWindow childWindows],
count = [children count],
parent = aWindow,
index;
parent = aWindow;
for (var i = 0; i < count; ++i)
{
var child = children[i];
if (![child isVisible])
// If a child is not visible and has not yet been ordered in, skip it
if (![child isVisible] && ![child _hasBeenOrderedIn])
continue;
var ordering = [child _childOrdering];
@@ -1499,14 +1501,12 @@ var resizeTimer = nil;
(ordering === CPWindowBelow && furthestParent._index < parent._index))
parent = furthestParent;
index = ordering === CPWindowAbove ? parent._index : parent._index - 1;
var index = ordering === CPWindowAbove ? parent._index + 1 : parent._index;
[aLayer insertWindow:child atIndex:index];
if ([[child childWindows] count])
index = [self _orderChildWindowsOf:child furthestParent:furthestParent layer:aLayer];
else
index = [child _childOrdering] === CPWindowAbove ? child._index : child._index - 1;
[self _orderChildWindowsOf:child furthestParent:furthestParent layer:aLayer];
parent = child;
}
+1
View File
@@ -105,6 +105,7 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
}
_textSize = nil;
[self setHitTests:NO];
}
return self;
@@ -1,5 +1,5 @@
/*
* _CPAttachedWindow.j
* _CPPopoverWindow.j
* AppKit
*
* Created by Antoine Mercadal
@@ -23,25 +23,25 @@
@import <Foundation/CPObject.j>
@import "CPButton.j"
@import "CPWindow.j"
@import "CPPanel.j"
CPClosableOnBlurWindowMask = 1 << 4;
CPPopoverAppearanceMinimal = 0;
CPPopoverAppearanceHUD = 1;
var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
_CPAttachedWindow_attachedWindowDidClose_ = 1 << 1,
_CPAttachedWindow_attachedWindowDidShow_ = 1 << 2;
var _CPPopoverWindow_shouldClose_ = 1 << 0,
_CPPopoverWindow_didClose_ = 1 << 1,
_CPPopoverWindow_didShow_ = 1 << 2;
/*!
@ignore
This is a simple attached window like the one that pops up
This is a simple popover window like the one that pops up
when you double click on a meeting in iCal.
*/
@implementation _CPAttachedWindow : CPWindow
@implementation _CPPopoverWindow : CPPanel
{
BOOL _animates @accessors(property=animates);
id _targetView @accessors(property=targetView);
@@ -66,7 +66,7 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
*/
+ (Class)_windowViewClassForStyleMask:(unsigned)aStyleMask
{
return _CPAttachedWindowView;
return _CPPopoverWindowView;
}
@@ -74,39 +74,40 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
#pragma mark Initialization
/*!
Create and init a _CPAttachedWindow with the given size and view.
Create and init a _CPPopoverWindow with the given size and view.
@param aSize the size of the attached window
@param aSize the size of the popover window
@param aView the target view
@return ready to use _CPAttachedWindow
@return ready to use _CPPopoverWindow
*/
+ (id)attachedWindowWithSize:(CGSize)aSize forView:(CPView)aView
+ (id)popoverWindowWithSize:(CGSize)aSize forView:(CPView)aView
{
return [_CPAttachedWindow attachedWindowWithSize:aSize forView:aView styleMask:0];
return [_CPPopoverWindow popoverWindowWithSize:aSize forView:aView styleMask:0];
}
/*!
Create and init a _CPAttachedWindow with given the size, view and style mask.
Create and init a _CPPopoverWindow with given the size, view and style mask.
@param aSize the size of the attached window
@param aSize the size of the popover window
@param aView the target view
@param styleMask the window style mask (combine CPClosableWindowMask and CPClosableOnBlurWindowMask)
@return ready to use _CPAttachedWindow
@return ready to use _CPPopoverWindow
*/
+ (id)attachedWindowWithSize:(CGSize)aSize forView:(CPView)aView styleMask:(int)aMask
+ (id)popoverWindowWithSize:(CGSize)aSize forView:(CPView)aView styleMask:(int)aMask
{
var attachedWindow = [[_CPAttachedWindow alloc] initWithContentRect:_CGRectMake(0.0, 0.0, aSize.width, aSize.height) styleMask:aMask];
var popoverWindow = [[_CPPopoverWindow alloc] initWithContentRect:_CGRectMake(0.0, 0.0, aSize.width, aSize.height) styleMask:aMask];
[attachedWindow attachToView:aView];
// FIXME: There is no attachToView method
// [popoverWindow attachToView:aView];
return attachedWindow;
return popoverWindow;
}
/*!
Create and init a _CPAttachedWindow with given the given frame.
Create and init a _CPPopoverWindow with given the given frame.
@param aFrame the frame of the attached window
@return ready to use _CPAttachedWindow
@param aFrame the frame of the popover window
@return ready to use _CPPopoverWindow
*/
- (id)initWithContentRect:(CGRect)aFrame
{
@@ -114,11 +115,11 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
}
/*!
Designated initializer. Create and init a _CPAttachedWindow with the given frame and style mask.
Designated initializer. Create and init a _CPPopoverWindow with the given frame and style mask.
@param aFrame the frame of the attached window
@param aFrame the frame of the popover window
@param styleMask the window style mask (combine CPClosableWindowMask and CPClosableOnBlurWindowMask)
@return ready to use _CPAttachedWindow
@return ready to use _CPPopoverWindow
*/
- (id)initWithContentRect:(CGRect)aFrame styleMask:(unsigned)aStyleMask
{
@@ -130,7 +131,7 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
_browserAnimates = [self browserSupportsAnimation];
_shouldPerformAnimation = YES;
[self setLevel:CPStatusWindowLevel];
[self setBecomesKeyOnlyIfNeeded:YES];
[self setMovableByWindowBackground:YES];
[self setHasShadow:NO];
@@ -166,21 +167,21 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
_delegate = aDelegate;
_implementedDelegateMethods = 0;
if ([_delegate respondsToSelector:@selector(attachedWindowShouldClose:)])
_implementedDelegateMethods |= _CPAttachedWindow_attachedWindowShouldClose_;
if ([_delegate respondsToSelector:@selector(popoverWindowShouldClose:)])
_implementedDelegateMethods |= _CPPopoverWindow_shouldClose_;
if ([_delegate respondsToSelector:@selector(attachedWindowDidClose:)])
_implementedDelegateMethods |= _CPAttachedWindow_attachedWindowDidClose_;
if ([_delegate respondsToSelector:@selector(popoverWindowDidClose:)])
_implementedDelegateMethods |= _CPPopoverWindow_didClose_;
if ([_delegate respondsToSelector:@selector(attachedWindowDidShow:)])
_implementedDelegateMethods |= _CPAttachedWindow_attachedWindowDidShow_;
if ([_delegate respondsToSelector:@selector(popoverWindowDidShow:)])
_implementedDelegateMethods |= _CPPopoverWindow_didShow_;
}
#pragma mark -
#pragma mark Observer
/*!
Update the _CPAttachedWindow frame if a resize event is observed.
Update the _CPPopoverWindow frame if a resize event is observed.
*/
- (void)observeValueForKeyPath:(CPString)aPath ofObject:(id)anObject change:(CPDictionary)theChange context:(void)aContext
{
@@ -318,9 +319,9 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
/*!
Compute the frame needed to be placed to the given view
and position the attached window according to this view (edge will be automatic)
and position the popover window according to this view (edge will be automatic)
@param aView the view where _CPAttachedWindow must be attached
@param aView the view where _CPPopoverWindow must be popover
*/
- (void)positionRelativeToView:(CPView)aView
{
@@ -328,10 +329,10 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
}
/*!
Position the _CPAttachedWindow relative to a given rect's edge.
Position the _CPPopoverWindow relative to a given rect's edge.
@param aRect the rect relative to which the attached window will be positioned
@param positioningView the view to which the attached window is attached
@param aRect the rect relative to which the popover window will be positioned
@param positioningView the view to which the popover window is popover
@param anEdge the prefered edge
*/
- (void)positionRelativeToRect:(CGRect)aRect ofView:(CPView)positioningView preferredEdge:(int)anEdge
@@ -343,16 +344,21 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
[self setFrameOrigin:point];
[_windowView showCursor];
[self setLevel:CPStatusWindowLevel];
[_windowView setNeedsDisplay:YES];
[self makeKeyAndOrderFront:nil];
if (positioningView !== _targetView)
{
[[_targetView window] removeChildWindow:self];
[_targetView removeObserver:self forKeyPath:@"frame"];
_targetView = positioningView;
[_targetView addObserver:self forKeyPath:@"frame" options:0 context:nil];
}
// Always add us as a child, because when we close we are detached from
// the parent, and the parent may cache this window and reopen it.
[[_targetView window] addChildWindow:self ordered:CPWindowAbove];
}
/*! @ignore */
@@ -376,7 +382,7 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
#pragma mark Actions
/*!
Closes the _CPAttachedWindow
Closes the _CPPopoverWindow
@param sender the sender of the action
*/
@@ -389,32 +395,18 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
#pragma mark -
#pragma mark Overrides
/*!
Attached windows, such as pop overs, can usually become the key window.
*/
- (BOOL)canBecomeKeyWindow
{
return YES;
}
/*!
Normally untitled windows cannot become main, but popovers can.
*/
- (BOOL)canBecomeMainWindow
{
return [self isVisible];
}
/*!
Called when the window is losing focus.
*/
- (void)resignMainWindow
- (void)resignKeyWindow
{
[super resignKeyWindow];
if (_closeOnBlur && !_isClosing)
{
if (!_delegate ||
((_implementedDelegateMethods & _CPAttachedWindow_attachedWindowShouldClose_) &&
[_delegate attachedWindowShouldClose:self]))
((_implementedDelegateMethods & _CPPopoverWindow_shouldClose_) &&
[_delegate popoverWindowShouldClose:self]))
{
[self close];
}
@@ -438,8 +430,7 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
var transformOrigin = "50% 100%",
frame = [self frame],
preferredEdge = [_windowView preferredEdge],
posX,
posY;
posX, posY;
switch (preferredEdge)
{
@@ -490,8 +481,8 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
#if PLATFORM(DOM)
_DOMElement.removeEventListener(CPBrowserStyleProperty('transitionend'), transitionCompleteFunction, YES);
#endif
if (_implementedDelegateMethods & _CPAttachedWindow_attachedWindowDidShow_)
[_delegate attachedWindowDidShow:self];
if (_implementedDelegateMethods & _CPPopoverWindow_didShow_)
[_delegate popoverWindowDidShow:self];
}
#if PLATFORM(DOM)
@@ -562,8 +553,8 @@ var _CPAttachedWindow_attachedWindowShouldClose_ = 1 << 0,
_shouldPerformAnimation = YES;
_isClosing = NO;
if (_implementedDelegateMethods & _CPAttachedWindow_attachedWindowDidClose_)
[_delegate attachedWindowDidClose:self];
if (_implementedDelegateMethods & _CPPopoverWindow_didClose_)
[_delegate popoverWindowDidClose:self];
}
@end
+32 -6
View File
@@ -18,9 +18,11 @@
CPPopUpButton buttonBehaviour;
CPButton lastButton;
int lastPreferredEdge;
@outlet CPTextField titleLabel;
@outlet CPPopover popover;
@outlet CPPopover windowPopover;
@outlet CPWindow popoverWindow;
@outlet CPPopover nestedPopover;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
@@ -98,7 +100,9 @@
[button setFrameOrigin:CGPointMake(CGRectGetMinX([button frame]), 70)];
[contentView addSubview:button];
buttonEdge = [[CPPopUpButton alloc] initWithFrame:CGRectMake(150, 10, 130, 24)];
var buttonHeight = [[CPTheme defaultTheme] valueForAttributeWithName:@"min-size" forClass:CPPopUpButton].height;
buttonEdge = [[CPPopUpButton alloc] initWithFrame:CGRectMake(150, 10, 130, buttonHeight)];
[buttonEdge addItemWithTitle:"Automatic"];
[buttonEdge addItemWithTitle:"Bottom"];
[buttonEdge addItemWithTitle:"Top"];
@@ -106,21 +110,24 @@
[buttonEdge addItemWithTitle:"Left"];
[contentView addSubview:buttonEdge];
buttonStyle = [[CPPopUpButton alloc] initWithFrame:CGRectMake(290, 10, 130, 24)];
buttonStyle = [[CPPopUpButton alloc] initWithFrame:CGRectMake(290, 10, 130, buttonHeight)];
[buttonStyle addItemWithTitle:"Minimal"];
[buttonStyle addItemWithTitle:"HUD"];
[contentView addSubview:buttonStyle];
buttonAnimation = [[CPPopUpButton alloc] initWithFrame:CGRectMake(430, 10, 130, 24)];
buttonAnimation = [[CPPopUpButton alloc] initWithFrame:CGRectMake(430, 10, 130, buttonHeight)];
[buttonAnimation addItemWithTitle:"With animation"];
[buttonAnimation addItemWithTitle:"No animation"];
[contentView addSubview:buttonAnimation];
buttonBehaviour = [[CPPopUpButton alloc] initWithFrame:CGRectMake(570, 10, 130, 24)];
buttonBehaviour = [[CPPopUpButton alloc] initWithFrame:CGRectMake(570, 10, 130, buttonHeight)];
[buttonBehaviour addItemWithTitle:"Transient"];
[buttonBehaviour addItemWithTitle:"Not managed"];
[contentView addSubview:buttonBehaviour];
[windowPopover setDelegate:self];
[nestedPopover setDelegate:self];
[theWindow orderFront:self];
}
@@ -146,18 +153,23 @@
- (@action)open:(id)sender
{
var edge = [self popoverEdge],
appearance;
appearance,
color;
switch ([buttonStyle title])
{
case "Minimal":
appearance = CPPopoverAppearanceMinimal;
color = [CPColor blackColor];
break;
case "HUD":
appearance = CPPopoverAppearanceHUD;
color = [CPColor whiteColor];
break;
}
[titleLabel setTextColor:color];
[self initPopover:popover withAppearance:appearance];
lastButton = sender;
lastPreferredEdge = edge;
@@ -166,7 +178,7 @@
- (void)openWindow:(id)sender
{
[popoverWindow orderFront:nil];
[popoverWindow makeKeyAndOrderFront:nil];
}
- (@action)openWindowPopover:(id)sender
@@ -174,6 +186,17 @@
[windowPopover showRelativeToRect:nil ofView:sender preferredEdge:[self popoverEdge]];
}
- (@action)openNestedPopover:(id)sender
{
[nestedPopover showRelativeToRect:nil ofView:sender preferredEdge:[self popoverEdge]];
}
- (@action)setTransient:(id)sender
{
[windowPopover setBehavior:[sender state] === CPOnState ? CPPopoverBehaviorTransient : CPPopoverBehaviorApplicationDefined];
[nestedPopover setBehavior:[sender state] === CPOnState ? CPPopoverBehaviorTransient : CPPopoverBehaviorApplicationDefined];
}
- (@action)movePopover:(id)sender
{
if (++lastPreferredEdge > CPMaxYEdge)
@@ -206,6 +229,9 @@
- (void)popoverDidShow:(CPPopover)aPopover
{
CPLog.info("popover " + aPopover + " did show");
var popWindow = [[[aPopover contentViewController] view] window];
[popWindow makeFirstResponder:[[popWindow contentView] nextValidKeyView]];
}
- (BOOL)popoverShouldClose:(CPPopover)aPopover
File diff suppressed because one or more lines are too long
+476 -65
View File
@@ -2,26 +2,26 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<string key="IBDocument.SystemVersion">12C3012</string>
<string key="IBDocument.InterfaceBuilderVersion">2844</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">2182</string>
<string key="NS.object.0">2844</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSTextField</string>
<string>NSCustomObject</string>
<string>NSWindowTemplate</string>
<string>NSView</string>
<string>NSCustomView</string>
<string>NSViewController</string>
<string>NSButtonCell</string>
<string>NSPopover</string>
<string>NSButton</string>
<string>NSButtonCell</string>
<string>NSCustomObject</string>
<string>NSCustomView</string>
<string>NSPopover</string>
<string>NSTextField</string>
<string>NSTextFieldCell</string>
<string>NSView</string>
<string>NSViewController</string>
<string>NSWindowTemplate</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -55,7 +55,7 @@
<bool key="NSAnimates">YES</bool>
</object>
<object class="NSCustomView" id="857722922">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -64,12 +64,11 @@
<int key="NSvFlags">301</int>
<string key="NSFrame">{{31, 137}, {239, 22}}</string>
<reference key="NSSuperview" ref="857722922"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="767709548"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="79646772">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags">-1804599231</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport" id="500612644">
@@ -81,7 +80,7 @@
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="545120110"/>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSColor" key="NSBackgroundColor">
<object class="NSColor" key="NSBackgroundColor" id="269469117">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textBackgroundColor</string>
@@ -90,7 +89,7 @@
<bytes key="NSWhite">MQA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<object class="NSColor" key="NSTextColor" id="984370616">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textColor</string>
@@ -100,89 +99,89 @@
</object>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="913980254">
<reference key="NSNextResponder" ref="857722922"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{114, 50}, {73, 32}}</string>
<reference key="NSSuperview" ref="857722922"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="13055898"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="801370502">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">close</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="913980254"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="13055898">
<reference key="NSNextResponder" ref="857722922"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{113, 18}, {74, 32}}</string>
<reference key="NSSuperview" ref="857722922"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="673410962">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Move</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="13055898"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="767709548">
<reference key="NSNextResponder" ref="857722922"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{87, 82}, {126, 32}}</string>
<reference key="NSSuperview" ref="857722922"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="13055898"/>
<reference key="NSNextKeyView" ref="913980254"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="550729654">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">performClose</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="767709548"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSTextField" id="143820433">
<reference key="NSNextResponder" ref="857722922"/>
<int key="NSvFlags">269</int>
<string key="NSFrame">{{28, 185}, {245, 32}}</string>
<reference key="NSSuperview" ref="857722922"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="545120110"/>
<string key="NSReuseIdentifierKey">_NS:1505</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="308389570">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">138412544</int>
<string key="NSContents">Im a popover!</string>
<object class="NSFont" key="NSSupport">
@@ -208,11 +207,10 @@
<reference key="NSColor" ref="44855948"/>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</object>
<string key="NSFrameSize">{301, 261}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="143820433"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">NSView</string>
@@ -220,8 +218,8 @@
<object class="NSWindowTemplate" id="1044407869">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{344, 821}, {212, 112}}</string>
<int key="NSWTFlags">607650816</int>
<string key="NSWindowRect">{{181, 548}, {212, 167}}</string>
<int key="NSWTFlags">606602240</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
@@ -234,35 +232,93 @@
<object class="NSButton" id="58551230">
<reference key="NSNextResponder" ref="757557230"/>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{56, 39}, {99, 32}}</string>
<string key="NSFrame">{{61, 66}, {91, 32}}</string>
<reference key="NSSuperview" ref="757557230"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="785624348"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="151393059">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Click me!</string>
<string key="NSContents">Popover</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="58551230"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="785624348">
<reference key="NSNextResponder" ref="757557230"/>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{58, 22}, {97, 32}}</string>
<reference key="NSSuperview" ref="757557230"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="528171139">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">orderOut</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="785624348"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="741616633">
<reference key="NSNextResponder" ref="757557230"/>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{66, 120}, {82, 18}}</string>
<reference key="NSSuperview" ref="757557230"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="58551230"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="799110954">
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">268435456</int>
<string key="NSContents">Transient</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="741616633"/>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSSwitch</string>
</object>
<object class="NSButtonImageSource" key="NSAlternateImage">
<string key="NSImageName">NSSwitch</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</object>
<string key="NSFrameSize">{212, 112}</string>
<string key="NSFrameSize">{212, 167}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="58551230"/>
<reference key="NSNextKeyView" ref="741616633"/>
<string key="NSReuseIdentifierKey">_NS:20</string>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
@@ -270,51 +326,94 @@
<object class="NSPopover" id="975947371">
<nil key="NSNextResponder"/>
<int key="NSAppearance">0</int>
<int key="NSBehavior">0</int>
<int key="NSBehavior">1</int>
<double key="NSContentWidth">0.0</double>
<double key="NSContentHeight">0.0</double>
<bool key="NSAnimates">YES</bool>
</object>
<object class="NSCustomView" id="200356413">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButton" id="400712972">
<object class="NSTextField" id="804107127">
<reference key="NSNextResponder" ref="200356413"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{18, 12}, {126, 32}}</string>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{52, 94}, {96, 22}}</string>
<reference key="NSSuperview" ref="200356413"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="540127758"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1032520345">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">performClose</string>
<object class="NSTextFieldCell" key="NSCell" id="985449319">
<int key="NSCellFlags">-1804599231</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="400712972"/>
<int key="NSButtonFlags">-2038284033</int>
<reference key="NSControlView" ref="804107127"/>
<bool key="NSDrawsBackground">YES</bool>
<reference key="NSBackgroundColor" ref="269469117"/>
<reference key="NSTextColor" ref="984370616"/>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="540127758">
<reference key="NSNextResponder" ref="200356413"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{27, 51}, {147, 32}}</string>
<reference key="NSSuperview" ref="200356413"/>
<reference key="NSNextKeyView" ref="400712972"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1024704232">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Another popover</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="540127758"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="400712972">
<reference key="NSNextResponder" ref="200356413"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{37, 13}, {126, 32}}</string>
<reference key="NSSuperview" ref="200356413"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1032520345">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">performClose</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="400712972"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSTextField" id="934009527">
<reference key="NSNextResponder" ref="200356413"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{37, 59}, {89, 17}}</string>
<string key="NSFrame">{{56, 131}, {89, 17}}</string>
<reference key="NSSuperview" ref="200356413"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="400712972"/>
<reference key="NSNextKeyView" ref="804107127"/>
<string key="NSReuseIdentifierKey">_NS:1505</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="420985577">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags">68157504</int>
<int key="NSCellFlags2">138413056</int>
<string key="NSContents">From window</string>
<reference key="NSSupport" ref="500612644"/>
@@ -323,11 +422,10 @@
<reference key="NSBackgroundColor" ref="516425847"/>
<reference key="NSTextColor" ref="807438272"/>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</object>
<string key="NSFrameSize">{163, 96}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<string key="NSFrameSize">{201, 168}</string>
<reference key="NSNextKeyView" ref="934009527"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">NSView</string>
@@ -339,7 +437,7 @@
<string key="NSReuseIdentifierKey">_NS:1505</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="171236348">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags">68157504</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Label</string>
<reference key="NSSupport" ref="500612644"/>
@@ -348,6 +446,91 @@
<reference key="NSBackgroundColor" ref="516425847"/>
<reference key="NSTextColor" ref="807438272"/>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSCustomView" id="452956084">
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTextField" id="906865563">
<reference key="NSNextResponder" ref="452956084"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{52, 94}, {96, 22}}</string>
<reference key="NSSuperview" ref="452956084"/>
<reference key="NSNextKeyView" ref="931185376"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="866550038">
<int key="NSCellFlags">-1804599231</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="906865563"/>
<bool key="NSDrawsBackground">YES</bool>
<reference key="NSBackgroundColor" ref="269469117"/>
<reference key="NSTextColor" ref="984370616"/>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="931185376">
<reference key="NSNextResponder" ref="452956084"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{37, 13}, {126, 32}}</string>
<reference key="NSSuperview" ref="452956084"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="538259882">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">performClose</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="931185376"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSTextField" id="390189650">
<reference key="NSNextResponder" ref="452956084"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{52, 131}, {97, 17}}</string>
<reference key="NSSuperview" ref="452956084"/>
<reference key="NSNextKeyView" ref="906865563"/>
<string key="NSReuseIdentifierKey">_NS:1505</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="383913172">
<int key="NSCellFlags">68157504</int>
<int key="NSCellFlags2">138413056</int>
<string key="NSContents">From popover</string>
<reference key="NSSupport" ref="500612644"/>
<string key="NSCellIdentifier">_NS:1505</string>
<reference key="NSControlView" ref="390189650"/>
<reference key="NSBackgroundColor" ref="516425847"/>
<reference key="NSTextColor" ref="807438272"/>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</object>
<string key="NSFrameSize">{201, 168}</string>
<reference key="NSNextKeyView" ref="390189650"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">NSView</string>
</object>
<object class="NSViewController" id="870492"/>
<object class="NSPopover" id="774646896">
<nil key="NSNextResponder"/>
<int key="NSAppearance">0</int>
<int key="NSBehavior">1</int>
<double key="NSContentWidth">0.0</double>
<double key="NSContentHeight">0.0</double>
<bool key="NSAnimates">YES</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -409,6 +592,38 @@
</object>
<int key="connectionID">559</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nestedPopover</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="774646896"/>
</object>
<int key="connectionID">582</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">openNestedPopover:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="540127758"/>
</object>
<int key="connectionID">584</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">titleLabel</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="143820433"/>
</object>
<int key="connectionID">585</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">setTransient:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="741616633"/>
</object>
<int key="connectionID">586</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">view</string>
@@ -433,6 +648,14 @@
</object>
<int key="connectionID">484</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">orderOut:</string>
<reference key="source" ref="1044407869"/>
<reference key="destination" ref="785624348"/>
</object>
<int key="connectionID">590</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">view</string>
@@ -457,6 +680,30 @@
</object>
<int key="connectionID">554</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="870492"/>
<reference key="destination" ref="452956084"/>
</object>
<int key="connectionID">581</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">contentViewController</string>
<reference key="source" ref="774646896"/>
<reference key="destination" ref="870492"/>
</object>
<int key="connectionID">580</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">performClose:</string>
<reference key="source" ref="774646896"/>
<reference key="destination" ref="931185376"/>
</object>
<int key="connectionID">583</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -586,7 +833,9 @@
<reference key="object" ref="757557230"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="741616633"/>
<reference ref="58551230"/>
<reference ref="785624348"/>
</object>
<reference key="parent" ref="1044407869"/>
</object>
@@ -623,6 +872,8 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="934009527"/>
<reference ref="400712972"/>
<reference ref="540127758"/>
<reference ref="804107127"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">Parent View</string>
@@ -683,6 +934,128 @@
<reference key="object" ref="801370502"/>
<reference key="parent" ref="913980254"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">560</int>
<reference key="object" ref="804107127"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="985449319"/>
</object>
<reference key="parent" ref="200356413"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">561</int>
<reference key="object" ref="985449319"/>
<reference key="parent" ref="804107127"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">562</int>
<reference key="object" ref="741616633"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="799110954"/>
</object>
<reference key="parent" ref="757557230"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">563</int>
<reference key="object" ref="799110954"/>
<reference key="parent" ref="741616633"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">564</int>
<reference key="object" ref="540127758"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="1024704232"/>
</object>
<reference key="parent" ref="200356413"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">565</int>
<reference key="object" ref="1024704232"/>
<reference key="parent" ref="540127758"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">567</int>
<reference key="object" ref="452956084"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="906865563"/>
<reference ref="390189650"/>
<reference ref="931185376"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">Parent View</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">568</int>
<reference key="object" ref="906865563"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="866550038"/>
</object>
<reference key="parent" ref="452956084"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">570</int>
<reference key="object" ref="931185376"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="538259882"/>
</object>
<reference key="parent" ref="452956084"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">571</int>
<reference key="object" ref="390189650"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="383913172"/>
</object>
<reference key="parent" ref="452956084"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">572</int>
<reference key="object" ref="383913172"/>
<reference key="parent" ref="390189650"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">573</int>
<reference key="object" ref="538259882"/>
<reference key="parent" ref="931185376"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">575</int>
<reference key="object" ref="866550038"/>
<reference key="parent" ref="906865563"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">578</int>
<reference key="object" ref="870492"/>
<reference key="parent" ref="0"/>
<string key="objectName">Nested popover view controller</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">579</int>
<reference key="object" ref="774646896"/>
<reference key="parent" ref="0"/>
<string key="objectName">Nested popover</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">587</int>
<reference key="object" ref="785624348"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="528171139"/>
</object>
<reference key="parent" ref="757557230"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">588</int>
<reference key="object" ref="528171139"/>
<reference key="parent" ref="785624348"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -722,6 +1095,23 @@
<string>552.IBPluginDependency</string>
<string>556.IBPluginDependency</string>
<string>557.IBPluginDependency</string>
<string>560.IBPluginDependency</string>
<string>561.IBPluginDependency</string>
<string>562.IBPluginDependency</string>
<string>563.IBPluginDependency</string>
<string>564.IBPluginDependency</string>
<string>565.IBPluginDependency</string>
<string>567.IBPluginDependency</string>
<string>568.IBPluginDependency</string>
<string>570.IBPluginDependency</string>
<string>571.IBPluginDependency</string>
<string>572.IBPluginDependency</string>
<string>573.IBPluginDependency</string>
<string>575.IBPluginDependency</string>
<string>578.IBPluginDependency</string>
<string>579.IBPluginDependency</string>
<string>587.IBPluginDependency</string>
<string>588.IBPluginDependency</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -758,6 +1148,23 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -772,7 +1179,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">559</int>
<int key="maxID">590</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -884,5 +1291,9 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">NSSwitch</string>
<string key="NS.object.0">{15, 15}</string>
</object>
</data>
</archive>
+15 -1
View File
@@ -15,6 +15,8 @@
@outlet CPWindow child;
@outlet CPWindow grandchild;
@outlet CPWindow other;
CPWindow outWindow;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
@@ -23,7 +25,7 @@
[child addChildWindow:grandchild ordered:CPWindowBelow];
[other orderFront:self];
[parent orderFront:self];
[parent makeKeyAndOrderFront:self];
}
- (@action)move:(id)sender
@@ -34,4 +36,16 @@
[[sender window] setFrameOrigin:newOrigin];
}
- (@action)out:(id)sender
{
outWindow = [sender window];
[outWindow orderOut:self];
[CPTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(in:) userInfo:nil repeats:NO];
}
- (void)in:(id)sender
{
[outWindow makeKeyAndOrderFront:self];
}
@end
File diff suppressed because one or more lines are too long
+194 -17
View File
@@ -59,7 +59,7 @@
<string key="NSFrame">{{55, 73}, {96, 22}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="766861743"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="46991665">
<int key="NSCellFlags">-1804599231</int>
@@ -118,6 +118,31 @@
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="766861743">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{72, 13}, {63, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="77278115">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Out</string>
<reference key="NSSupport" ref="803793547"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="766861743"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</object>
<string key="NSFrameSize">{207, 169}</string>
<reference key="NSSuperview"/>
@@ -126,7 +151,7 @@
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
<bool key="NSWindowIsRestorable">NO</bool>
</object>
<object class="NSCustomObject" id="635946545">
<string key="NSClassName">AppController</string>
@@ -148,10 +173,10 @@
<object class="NSTextField" id="538442349">
<reference key="NSNextResponder" ref="972554476"/>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{103, 73}, {96, 22}}</string>
<string key="NSFrame">{{103, 95}, {96, 22}}</string>
<reference key="NSSuperview" ref="972554476"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="584758671"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="485851911">
<int key="NSCellFlags">-1804599231</int>
@@ -165,6 +190,31 @@
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="584758671">
<reference key="NSNextResponder" ref="972554476"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{120, 34}, {63, 32}}</string>
<reference key="NSSuperview" ref="972554476"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="189475193">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Out</string>
<reference key="NSSupport" ref="803793547"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="584758671"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</object>
<string key="NSFrameSize">{303, 169}</string>
<reference key="NSSuperview"/>
@@ -173,7 +223,7 @@
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
<bool key="NSWindowIsRestorable">NO</bool>
</object>
<object class="NSWindowTemplate" id="938104522">
<int key="NSWindowStyleMask">7</int>
@@ -192,10 +242,10 @@
<object class="NSTextField" id="613062">
<reference key="NSNextResponder" ref="130905996"/>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{99, 73}, {96, 22}}</string>
<string key="NSFrame">{{99, 95}, {96, 22}}</string>
<reference key="NSSuperview" ref="130905996"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="647238683"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="560284048">
<int key="NSCellFlags">-1804599231</int>
@@ -209,6 +259,31 @@
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="647238683">
<reference key="NSNextResponder" ref="130905996"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{116, 33}, {63, 32}}</string>
<reference key="NSSuperview" ref="130905996"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="520056073">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Out</string>
<reference key="NSSupport" ref="803793547"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="647238683"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</object>
<string key="NSFrameSize">{294, 169}</string>
<reference key="NSSuperview"/>
@@ -217,7 +292,7 @@
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
<bool key="NSWindowIsRestorable">NO</bool>
</object>
<object class="NSWindowTemplate" id="199114555">
<int key="NSWindowStyleMask">7</int>
@@ -261,7 +336,7 @@
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
<bool key="NSWindowIsRestorable">NO</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -315,6 +390,30 @@
</object>
<int key="connectionID">478</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">out:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="766861743"/>
</object>
<int key="connectionID">482</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">out:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="647238683"/>
</object>
<int key="connectionID">485</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">out:</string>
<reference key="source" ref="635946545"/>
<reference key="destination" ref="584758671"/>
</object>
<int key="connectionID">488</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -361,6 +460,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="160623561"/>
<reference ref="665574939"/>
<reference ref="766861743"/>
</object>
<reference key="parent" ref="972006081"/>
</object>
@@ -398,6 +498,7 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="538442349"/>
<reference ref="584758671"/>
</object>
<reference key="parent" ref="625282019"/>
</object>
@@ -430,6 +531,7 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="613062"/>
<reference ref="647238683"/>
</object>
<reference key="parent" ref="938104522"/>
</object>
@@ -493,6 +595,48 @@
<reference key="object" ref="38629759"/>
<reference key="parent" ref="665574939"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">479</int>
<reference key="object" ref="766861743"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="77278115"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">480</int>
<reference key="object" ref="77278115"/>
<reference key="parent" ref="766861743"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">483</int>
<reference key="object" ref="647238683"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="520056073"/>
</object>
<reference key="parent" ref="130905996"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">484</int>
<reference key="object" ref="520056073"/>
<reference key="parent" ref="647238683"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">486</int>
<reference key="object" ref="584758671"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="189475193"/>
</object>
<reference key="parent" ref="972554476"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">487</int>
<reference key="object" ref="189475193"/>
<reference key="parent" ref="584758671"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -537,6 +681,12 @@
<string>474.IBPluginDependency</string>
<string>476.IBPluginDependency</string>
<string>477.IBPluginDependency</string>
<string>479.IBPluginDependency</string>
<string>480.IBPluginDependency</string>
<string>483.IBPluginDependency</string>
<string>484.IBPluginDependency</string>
<string>486.IBPluginDependency</string>
<string>487.IBPluginDependency</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -547,7 +697,7 @@
<boolean value="NO"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{303, 221}, {480, 360}}</string>
<integer value="1"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -578,6 +728,12 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -592,7 +748,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">478</int>
<int key="maxID">488</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -601,14 +757,35 @@
<string key="className">AppController</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">move:</string>
<string key="NS.object.0">id</string>
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>move:</string>
<string>out:</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">move:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">move:</string>
<string key="candidateClassName">id</string>
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>move:</string>
<string>out:</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
<string key="name">move:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">out:</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">