mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-27 05:57:04 +00:00
- 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.
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
/*
|
|
* AppController.j
|
|
* ChildWindows
|
|
*
|
|
* Created by You on January 17, 2013.
|
|
* Copyright 2013, Your Company All rights reserved.
|
|
*/
|
|
|
|
@import <Foundation/CPObject.j>
|
|
|
|
|
|
@implementation AppController : CPObject
|
|
{
|
|
@outlet CPWindow parent;
|
|
@outlet CPWindow child;
|
|
@outlet CPWindow grandchild;
|
|
@outlet CPWindow other;
|
|
|
|
CPWindow outWindow;
|
|
}
|
|
|
|
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
|
{
|
|
[parent addChildWindow:child ordered:CPWindowAbove];
|
|
[child addChildWindow:grandchild ordered:CPWindowBelow];
|
|
|
|
[other orderFront:self];
|
|
[parent makeKeyAndOrderFront:self];
|
|
}
|
|
|
|
- (@action)move:(id)sender
|
|
{
|
|
var origin = [[sender window] frame].origin,
|
|
newOrigin = CGPointMake(origin.x + 20, origin.y + 20);
|
|
|
|
[[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
|