diff --git a/Color Picker.xcodeproj/project.pbxproj b/Color Picker.xcodeproj/project.pbxproj index 7c4f52e..8bdcbc2 100644 --- a/Color Picker.xcodeproj/project.pbxproj +++ b/Color Picker.xcodeproj/project.pbxproj @@ -14,6 +14,8 @@ 55A8833E14153BCA0076BB4A /* close.png in Resources */ = {isa = PBXBuildFile; fileRef = 55A8833D14153BCA0076BB4A /* close.png */; }; 55A883421415F8EF0076BB4A /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55A883401415F8EE0076BB4A /* PreferencesController.m */; }; 55A883431415F8EF0076BB4A /* PreferencesController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55A883411415F8EE0076BB4A /* PreferencesController.xib */; }; + 55A8835014162EF80076BB4A /* HelpController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55A8834F14162EF80076BB4A /* HelpController.m */; }; + 55A8835214162F720076BB4A /* HelpController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55A8835114162F710076BB4A /* HelpController.xib */; }; 55C9F16E1400FAF000321C9E /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C9F16D1400FAF000321C9E /* AppController.m */; }; 55C9F1751400FB0200321C9E /* CustomStatusItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C9F1721400FB0200321C9E /* CustomStatusItem.m */; }; 55C9F1761400FB0200321C9E /* CustomWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C9F1741400FB0200321C9E /* CustomWindow.m */; }; @@ -45,6 +47,9 @@ 55A8833F1415F8EE0076BB4A /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesController.h; sourceTree = ""; }; 55A883401415F8EE0076BB4A /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesController.m; sourceTree = ""; }; 55A883411415F8EE0076BB4A /* PreferencesController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PreferencesController.xib; sourceTree = ""; }; + 55A8834E14162EF80076BB4A /* HelpController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpController.h; sourceTree = ""; }; + 55A8834F14162EF80076BB4A /* HelpController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelpController.m; sourceTree = ""; }; + 55A8835114162F710076BB4A /* HelpController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HelpController.xib; sourceTree = ""; }; 55C9F16C1400FAF000321C9E /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; 55C9F16D1400FAF000321C9E /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; }; 55C9F1701400FAF900321C9E /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; @@ -122,7 +127,6 @@ isa = PBXGroup; children = ( 55A8833B141539E10076BB4A /* APPL.icns */, - 55C9F1B71402F45B00321C9E /* Carbon.framework */, 55D4EC8513FFF18D00D13344 /* ColorPicker */, 55D4EC7E13FFF18D00D13344 /* Frameworks */, 55D4EC7C13FFF18D00D13344 /* Products */, @@ -140,6 +144,7 @@ 55D4EC7E13FFF18D00D13344 /* Frameworks */ = { isa = PBXGroup; children = ( + 55C9F1B71402F45B00321C9E /* Carbon.framework */, 55D4EC7F13FFF18D00D13344 /* Cocoa.framework */, 55D4EC8113FFF18D00D13344 /* Other Frameworks */, ); @@ -188,6 +193,9 @@ 55A8833F1415F8EE0076BB4A /* PreferencesController.h */, 55A883401415F8EE0076BB4A /* PreferencesController.m */, 55A883411415F8EE0076BB4A /* PreferencesController.xib */, + 55A8834E14162EF80076BB4A /* HelpController.h */, + 55A8834F14162EF80076BB4A /* HelpController.m */, + 55A8835114162F710076BB4A /* HelpController.xib */, ); path = ColorPicker; sourceTree = ""; @@ -262,6 +270,7 @@ 55A8833C141539E10076BB4A /* APPL.icns in Resources */, 55A8833E14153BCA0076BB4A /* close.png in Resources */, 55A883431415F8EF0076BB4A /* PreferencesController.xib in Resources */, + 55A8835214162F720076BB4A /* HelpController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -287,6 +296,7 @@ 550A63CF1406567B00864125 /* NSColorFormatter.m in Sources */, 55A8833714151D5D0076BB4A /* NSScreen+PointConversion.m in Sources */, 55A883421415F8EF0076BB4A /* PreferencesController.m in Sources */, + 55A8835014162EF80076BB4A /* HelpController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ColorPicker/AppController.h b/ColorPicker/AppController.h index f381708..3a133fc 100755 --- a/ColorPicker/AppController.h +++ b/ColorPicker/AppController.h @@ -6,6 +6,7 @@ @class RSLoginItems; @class ColorPickerViewController; @class PreferencesController; +@class HelpController; @interface AppController : NSObject @@ -16,6 +17,7 @@ @property (retain) NSView *view; @property (retain) RSLoginItems *loginItems; @property (retain) PreferencesController *preferencesController; +@property (retain) HelpController *helpController; - (void)toggleShowWindow; - (void)toggleShowWindowFromPoint:(NSPoint)point forceAnchoring:(BOOL)forceAnchoring; @@ -28,5 +30,6 @@ - (void)copyColorToPasteboard:(NSColor *)color; - (IBAction)showPreferences:(id)sender; +- (IBAction)showHelp:(id)sender; @end diff --git a/ColorPicker/AppController.m b/ColorPicker/AppController.m index cfc0810..efb6e78 100755 --- a/ColorPicker/AppController.m +++ b/ColorPicker/AppController.m @@ -5,6 +5,7 @@ #import "NSColorFormatter.h" #import "NSScreen+PointConversion.h" #import "PreferencesController.h" +#import "HelpController.h" @implementation AppController @@ -15,6 +16,7 @@ @implementation AppController @synthesize loginItems; @synthesize viewController; @synthesize preferencesController; +@synthesize helpController; - (void)awakeFromNib { @@ -124,7 +126,7 @@ - (void)registerHotKey DDHotKeyCenter * c = [[DDHotKeyCenter alloc] init]; DDHotKeyTask task = ^(NSEvent *hkEvent) { [viewController captureColor:YES]; - [self toggleShowWindowFromPoint:[statusItemView getAnchorPoint] forceAnchoring:YES]; + [window setAlphaValue:1.0]; // force show window }; if (![c registerHotKeyWithKeyCode:35 modifierFlags:(NSCommandKeyMask | NSShiftKeyMask) task:task]) { // cmd shift p NSLog(@"Unable to register hotkey"); @@ -168,5 +170,13 @@ - (IBAction)showPreferences:(id)sender [preferencesController showWindow:self]; } +- (IBAction)showHelp:(id)sender +{ + if (!helpController) { + self.helpController = [[HelpController alloc] init]; + } + [helpController showWindow:self]; +} + @end diff --git a/ColorPicker/Constants.h b/ColorPicker/Constants.h index fdadfeb..9db7fd0 100755 --- a/ColorPicker/Constants.h +++ b/ColorPicker/Constants.h @@ -15,4 +15,6 @@ #define kNumberOfColorsHistory 5 #define kAlertTitleStartupItem @"Run at Login?" -#define kAlertTextStartupItem @"Click \"Yes\" if you would like to run Color Picker when you login." \ No newline at end of file +#define kAlertTextStartupItem @"Click \"Yes\" if you would like to run Color Picker when you login." + +#define kInstructions @"Color Picker makes it easy to get color information from the screen.\n\nTo capture a color, simply press cmd + p. You can see a preview of the color directly on the window or in the menu bar at any time.\n\nWhen you copy a color, it will get copied to your clipboard and added to the colors history. To copy a color back from the history simply click on it.\n\n You can hide and show the main interface by clicking on its menu bar icon. There are many preferences that you can tweak to customize the behavior of Color Picker." \ No newline at end of file diff --git a/ColorPicker/HelpController.h b/ColorPicker/HelpController.h new file mode 100644 index 0000000..4978eb3 --- /dev/null +++ b/ColorPicker/HelpController.h @@ -0,0 +1,14 @@ +// +// HelpController.h +// Color Picker +// +// Created by Oscar Del Ben on 9/6/11. +// Copyright 2011 DibiStore. All rights reserved. +// + +#import + +@interface HelpController : NSWindowController + +@property (strong) IBOutlet NSTextField *instructions; +@end diff --git a/ColorPicker/HelpController.m b/ColorPicker/HelpController.m new file mode 100644 index 0000000..93e2ee7 --- /dev/null +++ b/ColorPicker/HelpController.m @@ -0,0 +1,29 @@ +// +// HelpController.m +// Color Picker +// +// Created by Oscar Del Ben on 9/6/11. +// Copyright 2011 DibiStore. All rights reserved. +// + +#import "HelpController.h" + +@implementation HelpController +@synthesize instructions; + +- (id)init +{ + self = [super initWithWindowNibName:@"HelpController"]; + if (self) { + // Initialization code here. + } + + return self; +} + +- (void)awakeFromNib +{ + [instructions setStringValue:kInstructions]; +} + +@end diff --git a/ColorPicker/HelpController.xib b/ColorPicker/HelpController.xib new file mode 100644 index 0000000..c99fbcc --- /dev/null +++ b/ColorPicker/HelpController.xib @@ -0,0 +1,265 @@ + + + + 0 + 11B26 + 1891 + 1138 + 566.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1891 + + + YES + NSTextField + NSTextFieldCell + NSWindowTemplate + NSView + NSCustomObject + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + HelpController + + + FirstResponder + + + NSApplication + + + 23 + 2 + {{913, 538}, {490, 313}} + -1535638528 + Color Picker Help + NSPanel + + + + + 256 + + YES + + + 268 + {{17, 20}, {456, 273}} + + + + _NS:3595 + YES + + 67239424 + 272891904 + Color Picker Help. + + LucidaGrande + 13 + 16 + + _NS:3595 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + {490, 313} + + + + _NS:2836 + + {{0, 0}, {1920, 1178}} + {10000000000000, 10000000000000} + YES + + + + + YES + + + window + + + + 4 + + + + instructions + + + + 7 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 2 + + + YES + + + + + + 3 + + + YES + + + + + + 5 + + + YES + + + + + + 6 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 2.IBPluginDependency + 2.NSWindowTemplate.visibleAtLaunch + 3.IBPluginDependency + 5.IBPluginDependency + 6.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 7 + + + + YES + + HelpController + NSWindowController + + instructions + NSTextField + + + instructions + + instructions + NSTextField + + + + IBProjectSource + ./Classes/HelpController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/ColorPicker/PreferencesController.xib b/ColorPicker/PreferencesController.xib index fbee666..e391e2f 100644 --- a/ColorPicker/PreferencesController.xib +++ b/ColorPicker/PreferencesController.xib @@ -100,7 +100,6 @@ {{76, 51}, {188, 18}} - _NS:238 YES @@ -131,7 +130,6 @@ {{76, 23}, {224, 18}} - _NS:238 YES @@ -270,28 +268,29 @@ 400 75 - + + + HEX (#ff0000) + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + YES OtherViews - - - HEX (#ff0000) - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - + rgb (240, 240, 240) @@ -349,10 +348,9 @@ YES - + 268 {90, 17} - _NS:3935 YES @@ -367,10 +365,9 @@ - + 268 {97, 17} - _NS:3935 YES @@ -663,6 +660,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -702,7 +701,6 @@ NSPopUpButton NSButton NSButton - NSButton @@ -717,10 +715,6 @@ showColorPreview NSButton - - showDockIcon - NSButton - IBProjectSource diff --git a/ColorPicker/en.lproj/MainMenu.xib b/ColorPicker/en.lproj/MainMenu.xib index 2b4f254..f15750e 100644 --- a/ColorPicker/en.lproj/MainMenu.xib +++ b/ColorPicker/en.lproj/MainMenu.xib @@ -1869,14 +1869,6 @@ 489 - - - showHelp: - - - - 493 - delegate @@ -2005,6 +1997,14 @@ 542 + + + showHelp: + + + + 543 + @@ -3364,7 +3364,7 @@ - 542 + 543 @@ -3373,14 +3373,35 @@ AppController NSObject - showPreferences: - id + YES + + YES + showHelp: + showPreferences: + + + YES + id + id + - showPreferences: - - showPreferences: - id + YES + + YES + showHelp: + showPreferences: + + + YES + + showHelp: + id + + + showPreferences: + id +