mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
formatting and now subclassing is tested by Open a document
This commit is contained in:
@@ -234,9 +234,7 @@ CPRunContinuesResponse = -1002;
|
||||
var delegateClass = objj_getClass(delegateClassName);
|
||||
|
||||
if (delegateClass)
|
||||
{
|
||||
[self setDelegate:[[delegateClass alloc] init]];
|
||||
}
|
||||
}
|
||||
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
// This is called when the application is done loading.
|
||||
var sharedDocController = [CPDocumentController sharedDocumentController];
|
||||
var docController = [[DocumentController alloc] init];
|
||||
var cpAlert = [CPAlert alertWithMessageText:@"Is this the shared instance? " + (sharedDocController == docController) defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:nil];
|
||||
[cpAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]];
|
||||
}
|
||||
|
||||
- (void)applicationWillFinishLaunching:(CPNotification)aNotification
|
||||
|
||||
@@ -12,4 +12,12 @@
|
||||
return [CPDocumentController sharedDocumentController];
|
||||
}
|
||||
|
||||
/* Instead of throwing error in browser environment, show an alert
|
||||
*/
|
||||
- (void)openDocument:(id)aSender
|
||||
{
|
||||
var anAlert = [CPAlert alertWithError:@"Opening a document is not available!"];
|
||||
[anAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -12,20 +12,17 @@
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
CPDocumentController subclassedCPDocumentController;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
// This is called when the application is done loading.
|
||||
var cpAlert = [CPAlert alertWithMessageText:@"Is this the shared instance? " + ([CPDocumentController sharedDocumentController] == subclassedCPDocumentController) defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:nil];
|
||||
[cpAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]];
|
||||
}
|
||||
|
||||
- (void)applicationWillFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
// instantiate a subclass of DocumentController
|
||||
subclassedCPDocumentController = [[DocumentController alloc] init];
|
||||
[[DocumentController alloc] init];
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
|
||||
@@ -12,4 +12,12 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
/* Instead of throwing error in browser environment, show an alert
|
||||
*/
|
||||
- (void)openDocument:(id)aSender
|
||||
{
|
||||
var anAlert = [CPAlert alertWithError:@"Opening a document is not available!"];
|
||||
[anAlert beginSheetModalForWindow:[[CPApplication sharedApplication] mainWindow]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user