Permalink
Browse files

init with project files

  • Loading branch information...
1 parent 695785e commit e9cafdddd6977007b24a67cb4f5d7f0ad1d3e461 smokyonion committed Jan 7, 2011
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -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>
View
@@ -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
View
@@ -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.

0 comments on commit e9cafdd

Please sign in to comment.