-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
smokyonion
committed
Jan 7, 2011
1 parent
695785e
commit e9cafdd
Showing
12 changed files
with
5,249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
/* Localized versions of Info.plist keys */ | |||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,32 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |||
<plist version="1.0"> | |||
<dict> | |||
<key>CFBundleDevelopmentRegion</key> | |||
<string>English</string> | |||
<key>CFBundleExecutable</key> | |||
<string>${EXECUTABLE_NAME}</string> | |||
<key>CFBundleIconFile</key> | |||
<string></string> | |||
<key>CFBundleIdentifier</key> | |||
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string> | |||
<key>CFBundleInfoDictionaryVersion</key> | |||
<string>6.0</string> | |||
<key>CFBundleName</key> | |||
<string>${PRODUCT_NAME}</string> | |||
<key>CFBundlePackageType</key> | |||
<string>APPL</string> | |||
<key>CFBundleShortVersionString</key> | |||
<string>1.0</string> | |||
<key>CFBundleSignature</key> | |||
<string>????</string> | |||
<key>CFBundleVersion</key> | |||
<string>1</string> | |||
<key>LSMinimumSystemVersion</key> | |||
<string>${MACOSX_DEPLOYMENT_TARGET}</string> | |||
<key>NSMainNibFile</key> | |||
<string>MainMenu</string> | |||
<key>NSPrincipalClass</key> | |||
<string>NSApplication</string> | |||
</dict> | |||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
// | |||
// SCSwitchButton.h | |||
// SCSwitchButton | |||
// | |||
// Created by Vincent on 1/7/11. | |||
// Copyright 2011 Vincent S. Wang. All rights reserved. | |||
// | |||
|
|||
#import <Cocoa/Cocoa.h> | |||
|
|||
|
|||
@interface SCSwitchButton : NSButton { | |||
|
|||
} | |||
|
|||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,84 @@ | |||
// | |||
// SCSwitchButton.m | |||
// SCSwitchButton | |||
// | |||
// Created by Vincent on 1/7/11. | |||
// Copyright 2011 Vincent S. Wang. All rights reserved. | |||
// | |||
|
|||
#import "SCSwitchButton.h" | |||
#import "SCSwitchButtonCell.h" | |||
|
|||
@implementation SCSwitchButton | |||
|
|||
+ (void)initialize | |||
{ | |||
[self setCellClass:[SCSwitchButtonCell class]]; | |||
} | |||
|
|||
- (void)awakeFromNib | |||
{ | |||
[[self class] setCellClass:[SCSwitchButtonCell class]]; | |||
} | |||
|
|||
- (void)keyDown:(NSEvent *)event | |||
{ | |||
unichar character = [[event characters] characterAtIndex:0UL]; | |||
switch (character) | |||
{ | |||
case NSLeftArrowFunctionKey: | |||
case NSRightArrowFunctionKey: | |||
//Do nothing (yet). We'll handle this in keyUp:. | |||
break; | |||
default: | |||
[super keyDown:event]; | |||
break; | |||
} | |||
} | |||
|
|||
- (void)keyUp:(NSEvent *)event | |||
{ | |||
unichar character = [[event characters] characterAtIndex:0UL]; | |||
switch (character) | |||
{ | |||
case NSLeftArrowFunctionKey: | |||
switch ([self state]) | |||
{ | |||
case NSOffState: | |||
NSBeep(); | |||
break; | |||
case NSMixedState: | |||
[self setState:NSOffState]; | |||
break; | |||
case NSOnState: | |||
if ([self allowsMixedState]) | |||
[self setState:NSMixedState]; | |||
else | |||
[self setState:NSOffState]; | |||
break; | |||
} | |||
break; | |||
case NSRightArrowFunctionKey: | |||
switch ([self state]) | |||
{ | |||
case NSOffState: | |||
if ([self allowsMixedState]) | |||
[self setState:NSMixedState]; | |||
else | |||
[self setState:NSOnState]; | |||
break; | |||
case NSMixedState: | |||
[self setState:NSOnState]; | |||
break; | |||
case NSOnState: | |||
NSBeep(); | |||
break; | |||
} | |||
break; | |||
default: | |||
[super keyUp:event]; | |||
break; | |||
} | |||
} | |||
|
|||
@end |
Oops, something went wrong.