mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-13 22:21:29 +00:00
Normalize application naming in ./Tests/Manual
Ensure: * CamelCase, ending in Test * No hyphens, spaces, underscores or other non-alpha characters Updated application directory names. Update Jakefiles.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* resignFirstResponder-CPControlTextDidEndEditing
|
||||
*
|
||||
* Created by aparajita on September 2, 2011.
|
||||
* Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow;
|
||||
@outlet CPTextField field1;
|
||||
@outlet CPTextField field2;
|
||||
@outlet CPTextField status;
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
var center = [CPNotificationCenter defaultCenter];
|
||||
|
||||
[center addObserver:self selector:@selector(showNote:) name:CPControlTextDidBeginEditingNotification object:field1];
|
||||
[center addObserver:self selector:@selector(showNote:) name:CPControlTextDidEndEditingNotification object:field1];
|
||||
[center addObserver:self selector:@selector(showNote:) name:CPControlTextDidBeginEditingNotification object:field2];
|
||||
[center addObserver:self selector:@selector(showNote:) name:CPControlTextDidEndEditingNotification object:field2];
|
||||
|
||||
[status setStringValue:@""];
|
||||
}
|
||||
|
||||
- (void)showNote:(CPNotification)note
|
||||
{
|
||||
var fieldName = [note object] === field1 ? "field1" : "field2";
|
||||
[status setStringValue:[CPString stringWithFormat:@"%@\n%@", fieldName, [note name]]];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user