Files
cappuccino/Tests/Manual/CPPlatformWindow/AppController.j
T
Alexandre Wilhelm 02dfa638ca Fixed: orderOut on a fullPlatformWindow doesn't close the parent platformWindow
Previously, when calling the method orderOut: on the full platform window of a CPPlatformWindow, cappuccino didn't close the parent CPPlatformWindow. When he does, this only works if the parent platformWindow is not the primary platform.

Test app in Tests/Manual/CPPlatformWindow/
2014-10-30 15:59:15 -07:00

65 lines
1.7 KiB
Plaintext

/*
* AppController.j
* CPPlatformWindow
*
* Created by You on October 30, 2014.
* Copyright 2014, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@implementation AppController : CPObject
{
@outlet CPWindow theWindow;
@outlet CPWindow windowPlatformWindow;
CPPlatformWindow platformWindow;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
platformWindow = [[CPPlatformWindow alloc] init];
[platformWindow setContentRect:[windowPlatformWindow contentRectForFrameRect:[windowPlatformWindow frame]]];
[windowPlatformWindow setPlatformWindow:platformWindow];
[windowPlatformWindow setFullPlatformWindow:YES]
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
}
- (IBAction)showWindow:(id)sender
{
[windowPlatformWindow orderFront:sender];
}
- (IBAction)closeWindow:(id)sender
{
[windowPlatformWindow orderOut:sender];
}
- (IBAction)changeFrame:(id)sender
{
[platformWindow setContentRect:CGRectMake(50, 50, 200, 200)];
}
- (IBAction)showAlert:(id)sender
{
var alert = [CPAlert alertWithMessageText:@"rer" defaultButton:"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:"Multiple login failures may result in blocked access to the system."];
[alert beginSheetModalForWindow:windowPlatformWindow];
}
@end