├── .gitignore
├── LICENSE
├── Preferences.png
├── README.md
├── RHPreferences.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ └── contents.xcworkspacedata
├── RHPreferences
├── RHPreferences-Info.plist
├── RHPreferences-Prefix.pch
├── RHPreferences.h
├── RHPreferencesWindow.xib
├── RHPreferencesWindowController.h
├── RHPreferencesWindowController.m
└── en.lproj
│ └── InfoPlist.strings
└── RHPreferencesTester
├── AboutPreferences.png
├── AccountsPreferences.png
├── RHAboutViewController.h
├── RHAboutViewController.m
├── RHAboutViewController.xib
├── RHAccountsViewController.h
├── RHAccountsViewController.m
├── RHAccountsViewController.xib
├── RHAppDelegate.h
├── RHAppDelegate.m
├── RHPreferencesTester-Info.plist
├── RHPreferencesTester-Prefix.pch
├── RHWideViewController.h
├── RHWideViewController.m
├── RHWideViewController.xib
├── WidePreferences.png
├── en.lproj
├── Credits.rtf
├── InfoPlist.strings
└── MainMenu.xib
└── main.m
/.gitignore:
--------------------------------------------------------------------------------
1 | RHPreferences.xcodeproj/xcuserdata
2 | RHPreferences.xcodeproj/project.xcworkspace/xcuserdata
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | RHPreferences
2 |
3 | Copyright (c) 2012 Richard Heard. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 | 1. Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | 2. Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 | 3. The name of the author may not be used to endorse or promote products
14 | derived from this software without specific prior written permission.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/Preferences.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heardrwt/RHPreferences/441dd7b690cdb56655dc78c7c34720adad6a4f1c/Preferences.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## RHPreferences
2 | An OS X Window Controller that makes it easy to provide a standard Preferences window with multiple tabs in your application.
3 |
4 | It also provides:
5 | * Auto resizing between different sized tab views (With animation)
6 | * Custom NSToolbarItem support
7 | * Persistance of the last used tab
8 | * Support for placeholder NSToolbarItems (eg NSToolbarFlexibleSpaceItemIdentifier & NSToolbarShowFontsItemIdentifier)
9 |
10 | 
11 |
12 |
13 | ## RHPreferencesWindowController Interface
14 |
15 |
16 | @interface RHPreferencesWindowController : NSWindowController
17 |
18 | //init
19 | -(id)initWithViewControllers:(NSArray*)controllers;
20 | -(id)initWithViewControllers:(NSArray*)controllers andTitle:(NSString*)title;
21 |
22 | //properties
23 | @property (copy) NSString *windowTitle;
24 | @property (assign) BOOL windowTitleShouldAutomaticlyUpdateToReflectSelectedViewController; //defaults to YES
25 |
26 | @property (retain) IBOutlet NSToolbar *toolbar;
27 | @property (retain) IBOutlet NSArray *viewControllers; //controllers should implement RHPreferencesViewControllerProtocol
28 |
29 | @property (assign) NSUInteger selectedIndex;
30 | @property (assign) NSViewController *selectedViewController;
31 |
32 | -(NSViewController *)viewControllerWithIdentifier:(NSString*)identifier;
33 |
34 | //you can include these placeholder controllers amongst your array of view controllers to show their respective items in the toolbar
35 | +(id)separatorPlaceholderController; // NSToolbarSeparatorItemIdentifier
36 | +(id)flexibleSpacePlaceholderController; // NSToolbarFlexibleSpaceItemIdentifier
37 | +(id)spacePlaceholderController; // NSToolbarSpaceItemIdentifier
38 |
39 | +(id)showColorsPlaceholderController; // NSToolbarShowColorsItemIdentifier
40 | +(id)showFontsPlaceholderController; // NSToolbarShowFontsItemIdentifier
41 | +(id)customizeToolbarPlaceholderController; // NSToolbarCustomizeToolbarItemIdentifier
42 | +(id)printPlaceholderController; // NSToolbarPrintItemIdentifier
43 |
44 | @end
45 |
46 |
47 |
48 | ## NSViewController Preferences Protocol
49 |
50 |
51 | // Implement this protocol on your view controller so that RHPreferencesWindow knows what to show in the tabbar. Label, image etc.
52 | @protocol RHPreferencesViewControllerProtocol
53 | @required
54 |
55 | @property (nonatomic, readonly, retain) NSString *identifier;
56 | @property (nonatomic, readonly, retain) NSImage *toolbarItemImage;
57 | @property (nonatomic, readonly, retain) NSString *toolbarItemLabel;
58 |
59 | @optional
60 |
61 | @property (nonatomic, readonly, retain) NSToolbarItem *toolbarItem; //optional, overrides the above 3 properties. allows for custom tabbar items.
62 |
63 | //methods called when switching between tabs
64 | -(void)viewWillAppear;
65 | -(void)viewDidAppear;
66 | -(void)viewWillDisappear;
67 | -(void)viewDidDisappear;
68 |
69 | -(NSView*)initialKeyView; // keyboard focus view on tab switch...
70 |
71 | @end
72 |
73 |
74 |
75 | ## Licence
76 | Released under the Modified BSD License.
77 | (Attribution Required)
78 |
79 | RHPreferences
80 |
81 | Copyright (c) 2012 Richard Heard. All rights reserved.
82 |
83 | Redistribution and use in source and binary forms, with or without
84 | modification, are permitted provided that the following conditions
85 | are met:
86 | 1. Redistributions of source code must retain the above copyright
87 | notice, this list of conditions and the following disclaimer.
88 | 2. Redistributions in binary form must reproduce the above copyright
89 | notice, this list of conditions and the following disclaimer in the
90 | documentation and/or other materials provided with the distribution.
91 | 3. The name of the author may not be used to endorse or promote products
92 | derived from this software without specific prior written permission.
93 |
94 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
95 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
96 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
97 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
98 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
99 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
100 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
101 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
102 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
103 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
104 |
105 |
106 |
107 | ### Version Support
108 | This Framework code compiles and has been tested on OS X 10.6 - 10.8
109 |
110 |
--------------------------------------------------------------------------------
/RHPreferences.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1330B770156DA90C00F2E3ED /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1330B76F156DA90C00F2E3ED /* Cocoa.framework */; };
11 | 1330B77A156DA90C00F2E3ED /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1330B778156DA90C00F2E3ED /* InfoPlist.strings */; };
12 | 1330B787156DA9A300F2E3ED /* RHPreferencesWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1330B784156DA9A300F2E3ED /* RHPreferencesWindow.xib */; };
13 | 1330B788156DA9A300F2E3ED /* RHPreferencesWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1330B785156DA9A300F2E3ED /* RHPreferencesWindowController.h */; settings = {ATTRIBUTES = (Public, ); }; };
14 | 1330B789156DA9A300F2E3ED /* RHPreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1330B786156DA9A300F2E3ED /* RHPreferencesWindowController.m */; };
15 | 1330B790156DAA4D00F2E3ED /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1330B76F156DA90C00F2E3ED /* Cocoa.framework */; };
16 | 1330B796156DAA4D00F2E3ED /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1330B794156DAA4D00F2E3ED /* InfoPlist.strings */; };
17 | 1330B798156DAA4D00F2E3ED /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1330B797156DAA4D00F2E3ED /* main.m */; };
18 | 1330B79C156DAA4D00F2E3ED /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 1330B79A156DAA4D00F2E3ED /* Credits.rtf */; };
19 | 1330B79F156DAA4D00F2E3ED /* RHAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1330B79E156DAA4D00F2E3ED /* RHAppDelegate.m */; };
20 | 1330B7A2156DAA4D00F2E3ED /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1330B7A0156DAA4D00F2E3ED /* MainMenu.xib */; };
21 | 1330B7A6156DAACC00F2E3ED /* RHPreferences.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1330B76C156DA90C00F2E3ED /* RHPreferences.framework */; };
22 | 1330B7AA156DAAEC00F2E3ED /* RHPreferences.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1330B76C156DA90C00F2E3ED /* RHPreferences.framework */; };
23 | 1330B7AB156DAB6B00F2E3ED /* RHPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 1330B77C156DA90C00F2E3ED /* RHPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
24 | 1330B7B8156DAE8D00F2E3ED /* RHAccountsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1330B7B6156DAE8D00F2E3ED /* RHAccountsViewController.m */; };
25 | 1330B7B9156DAE8D00F2E3ED /* RHAccountsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1330B7B7156DAE8D00F2E3ED /* RHAccountsViewController.xib */; };
26 | 1330B7BA156DAE9A00F2E3ED /* RHAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1330B7AF156DAD9200F2E3ED /* RHAboutViewController.m */; };
27 | 1330B7BB156DAE9F00F2E3ED /* RHAboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1330B7B0156DAD9200F2E3ED /* RHAboutViewController.xib */; };
28 | 1330B7BE156DF56900F2E3ED /* AboutPreferences.png in Resources */ = {isa = PBXBuildFile; fileRef = 1330B7BC156DF56900F2E3ED /* AboutPreferences.png */; };
29 | 1330B7BF156DF56900F2E3ED /* AccountsPreferences.png in Resources */ = {isa = PBXBuildFile; fileRef = 1330B7BD156DF56900F2E3ED /* AccountsPreferences.png */; };
30 | 1330B7C4156DF61B00F2E3ED /* RHWideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1330B7C2156DF61B00F2E3ED /* RHWideViewController.m */; };
31 | 1330B7C5156DF61B00F2E3ED /* RHWideViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1330B7C3156DF61B00F2E3ED /* RHWideViewController.xib */; };
32 | 1330B7C7156DF9C600F2E3ED /* WidePreferences.png in Resources */ = {isa = PBXBuildFile; fileRef = 1330B7C6156DF9C600F2E3ED /* WidePreferences.png */; };
33 | /* End PBXBuildFile section */
34 |
35 | /* Begin PBXContainerItemProxy section */
36 | 1330B7A7156DAAD300F2E3ED /* PBXContainerItemProxy */ = {
37 | isa = PBXContainerItemProxy;
38 | containerPortal = 1330B762156DA90B00F2E3ED /* Project object */;
39 | proxyType = 1;
40 | remoteGlobalIDString = 1330B76B156DA90C00F2E3ED;
41 | remoteInfo = RHPreferences;
42 | };
43 | /* End PBXContainerItemProxy section */
44 |
45 | /* Begin PBXCopyFilesBuildPhase section */
46 | 1330B7A9156DAADF00F2E3ED /* CopyFiles */ = {
47 | isa = PBXCopyFilesBuildPhase;
48 | buildActionMask = 2147483647;
49 | dstPath = "";
50 | dstSubfolderSpec = 10;
51 | files = (
52 | 1330B7AA156DAAEC00F2E3ED /* RHPreferences.framework in CopyFiles */,
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | /* End PBXCopyFilesBuildPhase section */
57 |
58 | /* Begin PBXFileReference section */
59 | 1330B76C156DA90C00F2E3ED /* RHPreferences.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RHPreferences.framework; sourceTree = BUILT_PRODUCTS_DIR; };
60 | 1330B76F156DA90C00F2E3ED /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
61 | 1330B772156DA90C00F2E3ED /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
62 | 1330B773156DA90C00F2E3ED /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
63 | 1330B774156DA90C00F2E3ED /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
64 | 1330B777156DA90C00F2E3ED /* RHPreferences-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RHPreferences-Info.plist"; sourceTree = ""; };
65 | 1330B779156DA90C00F2E3ED /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
66 | 1330B77B156DA90C00F2E3ED /* RHPreferences-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RHPreferences-Prefix.pch"; sourceTree = ""; };
67 | 1330B77C156DA90C00F2E3ED /* RHPreferences.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RHPreferences.h; sourceTree = ""; };
68 | 1330B784156DA9A300F2E3ED /* RHPreferencesWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RHPreferencesWindow.xib; sourceTree = ""; };
69 | 1330B785156DA9A300F2E3ED /* RHPreferencesWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RHPreferencesWindowController.h; sourceTree = ""; };
70 | 1330B786156DA9A300F2E3ED /* RHPreferencesWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RHPreferencesWindowController.m; sourceTree = ""; };
71 | 1330B78E156DAA4D00F2E3ED /* RHPreferencesTester.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RHPreferencesTester.app; sourceTree = BUILT_PRODUCTS_DIR; };
72 | 1330B793156DAA4D00F2E3ED /* RHPreferencesTester-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RHPreferencesTester-Info.plist"; sourceTree = ""; };
73 | 1330B795156DAA4D00F2E3ED /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
74 | 1330B797156DAA4D00F2E3ED /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
75 | 1330B799156DAA4D00F2E3ED /* RHPreferencesTester-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RHPreferencesTester-Prefix.pch"; sourceTree = ""; };
76 | 1330B79B156DAA4D00F2E3ED /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; };
77 | 1330B79D156DAA4D00F2E3ED /* RHAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RHAppDelegate.h; sourceTree = ""; };
78 | 1330B79E156DAA4D00F2E3ED /* RHAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RHAppDelegate.m; sourceTree = ""; };
79 | 1330B7A1156DAA4D00F2E3ED /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; };
80 | 1330B7AE156DAD9200F2E3ED /* RHAboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RHAboutViewController.h; sourceTree = ""; };
81 | 1330B7AF156DAD9200F2E3ED /* RHAboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RHAboutViewController.m; sourceTree = ""; };
82 | 1330B7B0156DAD9200F2E3ED /* RHAboutViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RHAboutViewController.xib; sourceTree = ""; };
83 | 1330B7B5156DAE8D00F2E3ED /* RHAccountsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RHAccountsViewController.h; sourceTree = ""; };
84 | 1330B7B6156DAE8D00F2E3ED /* RHAccountsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RHAccountsViewController.m; sourceTree = ""; };
85 | 1330B7B7156DAE8D00F2E3ED /* RHAccountsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RHAccountsViewController.xib; sourceTree = ""; };
86 | 1330B7BC156DF56900F2E3ED /* AboutPreferences.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AboutPreferences.png; sourceTree = ""; };
87 | 1330B7BD156DF56900F2E3ED /* AccountsPreferences.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AccountsPreferences.png; sourceTree = ""; };
88 | 1330B7C1156DF61B00F2E3ED /* RHWideViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RHWideViewController.h; sourceTree = ""; };
89 | 1330B7C2156DF61B00F2E3ED /* RHWideViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RHWideViewController.m; sourceTree = ""; };
90 | 1330B7C3156DF61B00F2E3ED /* RHWideViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RHWideViewController.xib; sourceTree = ""; };
91 | 1330B7C6156DF9C600F2E3ED /* WidePreferences.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = WidePreferences.png; sourceTree = ""; };
92 | /* End PBXFileReference section */
93 |
94 | /* Begin PBXFrameworksBuildPhase section */
95 | 1330B768156DA90C00F2E3ED /* Frameworks */ = {
96 | isa = PBXFrameworksBuildPhase;
97 | buildActionMask = 2147483647;
98 | files = (
99 | 1330B770156DA90C00F2E3ED /* Cocoa.framework in Frameworks */,
100 | );
101 | runOnlyForDeploymentPostprocessing = 0;
102 | };
103 | 1330B78B156DAA4D00F2E3ED /* Frameworks */ = {
104 | isa = PBXFrameworksBuildPhase;
105 | buildActionMask = 2147483647;
106 | files = (
107 | 1330B7A6156DAACC00F2E3ED /* RHPreferences.framework in Frameworks */,
108 | 1330B790156DAA4D00F2E3ED /* Cocoa.framework in Frameworks */,
109 | );
110 | runOnlyForDeploymentPostprocessing = 0;
111 | };
112 | /* End PBXFrameworksBuildPhase section */
113 |
114 | /* Begin PBXGroup section */
115 | 1330B760156DA90B00F2E3ED = {
116 | isa = PBXGroup;
117 | children = (
118 | 1330B775156DA90C00F2E3ED /* RHPreferences */,
119 | 1330B791156DAA4D00F2E3ED /* RHPreferencesTester */,
120 | 1330B76E156DA90C00F2E3ED /* Frameworks */,
121 | 1330B76D156DA90C00F2E3ED /* Products */,
122 | );
123 | sourceTree = "";
124 | };
125 | 1330B76D156DA90C00F2E3ED /* Products */ = {
126 | isa = PBXGroup;
127 | children = (
128 | 1330B76C156DA90C00F2E3ED /* RHPreferences.framework */,
129 | 1330B78E156DAA4D00F2E3ED /* RHPreferencesTester.app */,
130 | );
131 | name = Products;
132 | sourceTree = "";
133 | };
134 | 1330B76E156DA90C00F2E3ED /* Frameworks */ = {
135 | isa = PBXGroup;
136 | children = (
137 | 1330B76F156DA90C00F2E3ED /* Cocoa.framework */,
138 | 1330B771156DA90C00F2E3ED /* Other Frameworks */,
139 | );
140 | name = Frameworks;
141 | sourceTree = "";
142 | };
143 | 1330B771156DA90C00F2E3ED /* Other Frameworks */ = {
144 | isa = PBXGroup;
145 | children = (
146 | 1330B772156DA90C00F2E3ED /* AppKit.framework */,
147 | 1330B773156DA90C00F2E3ED /* CoreData.framework */,
148 | 1330B774156DA90C00F2E3ED /* Foundation.framework */,
149 | );
150 | name = "Other Frameworks";
151 | sourceTree = "";
152 | };
153 | 1330B775156DA90C00F2E3ED /* RHPreferences */ = {
154 | isa = PBXGroup;
155 | children = (
156 | 1330B77C156DA90C00F2E3ED /* RHPreferences.h */,
157 | 1330B785156DA9A300F2E3ED /* RHPreferencesWindowController.h */,
158 | 1330B786156DA9A300F2E3ED /* RHPreferencesWindowController.m */,
159 | 1330B784156DA9A300F2E3ED /* RHPreferencesWindow.xib */,
160 | 1330B776156DA90C00F2E3ED /* Supporting Files */,
161 | );
162 | path = RHPreferences;
163 | sourceTree = "";
164 | };
165 | 1330B776156DA90C00F2E3ED /* Supporting Files */ = {
166 | isa = PBXGroup;
167 | children = (
168 | 1330B777156DA90C00F2E3ED /* RHPreferences-Info.plist */,
169 | 1330B778156DA90C00F2E3ED /* InfoPlist.strings */,
170 | 1330B77B156DA90C00F2E3ED /* RHPreferences-Prefix.pch */,
171 | );
172 | name = "Supporting Files";
173 | sourceTree = "";
174 | };
175 | 1330B791156DAA4D00F2E3ED /* RHPreferencesTester */ = {
176 | isa = PBXGroup;
177 | children = (
178 | 1330B79D156DAA4D00F2E3ED /* RHAppDelegate.h */,
179 | 1330B79E156DAA4D00F2E3ED /* RHAppDelegate.m */,
180 | 1330B7A0156DAA4D00F2E3ED /* MainMenu.xib */,
181 | 1330B7AC156DAD2E00F2E3ED /* Demo Preference View Controllers */,
182 | 1330B792156DAA4D00F2E3ED /* Supporting Files */,
183 | );
184 | path = RHPreferencesTester;
185 | sourceTree = "";
186 | };
187 | 1330B792156DAA4D00F2E3ED /* Supporting Files */ = {
188 | isa = PBXGroup;
189 | children = (
190 | 1330B7C6156DF9C600F2E3ED /* WidePreferences.png */,
191 | 1330B7BC156DF56900F2E3ED /* AboutPreferences.png */,
192 | 1330B7BD156DF56900F2E3ED /* AccountsPreferences.png */,
193 | 1330B793156DAA4D00F2E3ED /* RHPreferencesTester-Info.plist */,
194 | 1330B794156DAA4D00F2E3ED /* InfoPlist.strings */,
195 | 1330B797156DAA4D00F2E3ED /* main.m */,
196 | 1330B799156DAA4D00F2E3ED /* RHPreferencesTester-Prefix.pch */,
197 | 1330B79A156DAA4D00F2E3ED /* Credits.rtf */,
198 | );
199 | name = "Supporting Files";
200 | sourceTree = "";
201 | };
202 | 1330B7AC156DAD2E00F2E3ED /* Demo Preference View Controllers */ = {
203 | isa = PBXGroup;
204 | children = (
205 | 1330B7B4156DAE7E00F2E3ED /* Accounts */,
206 | 1330B7AD156DAD8900F2E3ED /* About */,
207 | 1330B7C0156DF59200F2E3ED /* Resizing */,
208 | );
209 | name = "Demo Preference View Controllers";
210 | sourceTree = "";
211 | };
212 | 1330B7AD156DAD8900F2E3ED /* About */ = {
213 | isa = PBXGroup;
214 | children = (
215 | 1330B7AE156DAD9200F2E3ED /* RHAboutViewController.h */,
216 | 1330B7AF156DAD9200F2E3ED /* RHAboutViewController.m */,
217 | 1330B7B0156DAD9200F2E3ED /* RHAboutViewController.xib */,
218 | );
219 | name = About;
220 | sourceTree = "";
221 | };
222 | 1330B7B4156DAE7E00F2E3ED /* Accounts */ = {
223 | isa = PBXGroup;
224 | children = (
225 | 1330B7B5156DAE8D00F2E3ED /* RHAccountsViewController.h */,
226 | 1330B7B6156DAE8D00F2E3ED /* RHAccountsViewController.m */,
227 | 1330B7B7156DAE8D00F2E3ED /* RHAccountsViewController.xib */,
228 | );
229 | name = Accounts;
230 | sourceTree = "";
231 | };
232 | 1330B7C0156DF59200F2E3ED /* Resizing */ = {
233 | isa = PBXGroup;
234 | children = (
235 | 1330B7C1156DF61B00F2E3ED /* RHWideViewController.h */,
236 | 1330B7C2156DF61B00F2E3ED /* RHWideViewController.m */,
237 | 1330B7C3156DF61B00F2E3ED /* RHWideViewController.xib */,
238 | );
239 | name = Resizing;
240 | sourceTree = "";
241 | };
242 | /* End PBXGroup section */
243 |
244 | /* Begin PBXHeadersBuildPhase section */
245 | 1330B769156DA90C00F2E3ED /* Headers */ = {
246 | isa = PBXHeadersBuildPhase;
247 | buildActionMask = 2147483647;
248 | files = (
249 | 1330B788156DA9A300F2E3ED /* RHPreferencesWindowController.h in Headers */,
250 | 1330B7AB156DAB6B00F2E3ED /* RHPreferences.h in Headers */,
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | };
254 | /* End PBXHeadersBuildPhase section */
255 |
256 | /* Begin PBXNativeTarget section */
257 | 1330B76B156DA90C00F2E3ED /* RHPreferences */ = {
258 | isa = PBXNativeTarget;
259 | buildConfigurationList = 1330B781156DA90C00F2E3ED /* Build configuration list for PBXNativeTarget "RHPreferences" */;
260 | buildPhases = (
261 | 1330B767156DA90C00F2E3ED /* Sources */,
262 | 1330B768156DA90C00F2E3ED /* Frameworks */,
263 | 1330B769156DA90C00F2E3ED /* Headers */,
264 | 1330B76A156DA90C00F2E3ED /* Resources */,
265 | );
266 | buildRules = (
267 | );
268 | dependencies = (
269 | );
270 | name = RHPreferences;
271 | productName = RHPreferences;
272 | productReference = 1330B76C156DA90C00F2E3ED /* RHPreferences.framework */;
273 | productType = "com.apple.product-type.framework";
274 | };
275 | 1330B78D156DAA4D00F2E3ED /* RHPreferencesTester */ = {
276 | isa = PBXNativeTarget;
277 | buildConfigurationList = 1330B7A3156DAA4D00F2E3ED /* Build configuration list for PBXNativeTarget "RHPreferencesTester" */;
278 | buildPhases = (
279 | 1330B78A156DAA4D00F2E3ED /* Sources */,
280 | 1330B78B156DAA4D00F2E3ED /* Frameworks */,
281 | 1330B78C156DAA4D00F2E3ED /* Resources */,
282 | 1330B7A9156DAADF00F2E3ED /* CopyFiles */,
283 | );
284 | buildRules = (
285 | );
286 | dependencies = (
287 | 1330B7A8156DAAD300F2E3ED /* PBXTargetDependency */,
288 | );
289 | name = RHPreferencesTester;
290 | productName = RHPreferencesTester;
291 | productReference = 1330B78E156DAA4D00F2E3ED /* RHPreferencesTester.app */;
292 | productType = "com.apple.product-type.application";
293 | };
294 | /* End PBXNativeTarget section */
295 |
296 | /* Begin PBXProject section */
297 | 1330B762156DA90B00F2E3ED /* Project object */ = {
298 | isa = PBXProject;
299 | attributes = {
300 | CLASSPREFIX = RH;
301 | LastUpgradeCheck = 0510;
302 | ORGANIZATIONNAME = "Richard Heard";
303 | };
304 | buildConfigurationList = 1330B765156DA90B00F2E3ED /* Build configuration list for PBXProject "RHPreferences" */;
305 | compatibilityVersion = "Xcode 3.2";
306 | developmentRegion = English;
307 | hasScannedForEncodings = 0;
308 | knownRegions = (
309 | en,
310 | );
311 | mainGroup = 1330B760156DA90B00F2E3ED;
312 | productRefGroup = 1330B76D156DA90C00F2E3ED /* Products */;
313 | projectDirPath = "";
314 | projectRoot = "";
315 | targets = (
316 | 1330B76B156DA90C00F2E3ED /* RHPreferences */,
317 | 1330B78D156DAA4D00F2E3ED /* RHPreferencesTester */,
318 | );
319 | };
320 | /* End PBXProject section */
321 |
322 | /* Begin PBXResourcesBuildPhase section */
323 | 1330B76A156DA90C00F2E3ED /* Resources */ = {
324 | isa = PBXResourcesBuildPhase;
325 | buildActionMask = 2147483647;
326 | files = (
327 | 1330B77A156DA90C00F2E3ED /* InfoPlist.strings in Resources */,
328 | 1330B787156DA9A300F2E3ED /* RHPreferencesWindow.xib in Resources */,
329 | );
330 | runOnlyForDeploymentPostprocessing = 0;
331 | };
332 | 1330B78C156DAA4D00F2E3ED /* Resources */ = {
333 | isa = PBXResourcesBuildPhase;
334 | buildActionMask = 2147483647;
335 | files = (
336 | 1330B796156DAA4D00F2E3ED /* InfoPlist.strings in Resources */,
337 | 1330B79C156DAA4D00F2E3ED /* Credits.rtf in Resources */,
338 | 1330B7A2156DAA4D00F2E3ED /* MainMenu.xib in Resources */,
339 | 1330B7B9156DAE8D00F2E3ED /* RHAccountsViewController.xib in Resources */,
340 | 1330B7BB156DAE9F00F2E3ED /* RHAboutViewController.xib in Resources */,
341 | 1330B7BE156DF56900F2E3ED /* AboutPreferences.png in Resources */,
342 | 1330B7BF156DF56900F2E3ED /* AccountsPreferences.png in Resources */,
343 | 1330B7C5156DF61B00F2E3ED /* RHWideViewController.xib in Resources */,
344 | 1330B7C7156DF9C600F2E3ED /* WidePreferences.png in Resources */,
345 | );
346 | runOnlyForDeploymentPostprocessing = 0;
347 | };
348 | /* End PBXResourcesBuildPhase section */
349 |
350 | /* Begin PBXSourcesBuildPhase section */
351 | 1330B767156DA90C00F2E3ED /* Sources */ = {
352 | isa = PBXSourcesBuildPhase;
353 | buildActionMask = 2147483647;
354 | files = (
355 | 1330B789156DA9A300F2E3ED /* RHPreferencesWindowController.m in Sources */,
356 | );
357 | runOnlyForDeploymentPostprocessing = 0;
358 | };
359 | 1330B78A156DAA4D00F2E3ED /* Sources */ = {
360 | isa = PBXSourcesBuildPhase;
361 | buildActionMask = 2147483647;
362 | files = (
363 | 1330B798156DAA4D00F2E3ED /* main.m in Sources */,
364 | 1330B79F156DAA4D00F2E3ED /* RHAppDelegate.m in Sources */,
365 | 1330B7B8156DAE8D00F2E3ED /* RHAccountsViewController.m in Sources */,
366 | 1330B7BA156DAE9A00F2E3ED /* RHAboutViewController.m in Sources */,
367 | 1330B7C4156DF61B00F2E3ED /* RHWideViewController.m in Sources */,
368 | );
369 | runOnlyForDeploymentPostprocessing = 0;
370 | };
371 | /* End PBXSourcesBuildPhase section */
372 |
373 | /* Begin PBXTargetDependency section */
374 | 1330B7A8156DAAD300F2E3ED /* PBXTargetDependency */ = {
375 | isa = PBXTargetDependency;
376 | target = 1330B76B156DA90C00F2E3ED /* RHPreferences */;
377 | targetProxy = 1330B7A7156DAAD300F2E3ED /* PBXContainerItemProxy */;
378 | };
379 | /* End PBXTargetDependency section */
380 |
381 | /* Begin PBXVariantGroup section */
382 | 1330B778156DA90C00F2E3ED /* InfoPlist.strings */ = {
383 | isa = PBXVariantGroup;
384 | children = (
385 | 1330B779156DA90C00F2E3ED /* en */,
386 | );
387 | name = InfoPlist.strings;
388 | sourceTree = "";
389 | };
390 | 1330B794156DAA4D00F2E3ED /* InfoPlist.strings */ = {
391 | isa = PBXVariantGroup;
392 | children = (
393 | 1330B795156DAA4D00F2E3ED /* en */,
394 | );
395 | name = InfoPlist.strings;
396 | sourceTree = "";
397 | };
398 | 1330B79A156DAA4D00F2E3ED /* Credits.rtf */ = {
399 | isa = PBXVariantGroup;
400 | children = (
401 | 1330B79B156DAA4D00F2E3ED /* en */,
402 | );
403 | name = Credits.rtf;
404 | sourceTree = "";
405 | };
406 | 1330B7A0156DAA4D00F2E3ED /* MainMenu.xib */ = {
407 | isa = PBXVariantGroup;
408 | children = (
409 | 1330B7A1156DAA4D00F2E3ED /* en */,
410 | );
411 | name = MainMenu.xib;
412 | sourceTree = "";
413 | };
414 | /* End PBXVariantGroup section */
415 |
416 | /* Begin XCBuildConfiguration section */
417 | 1330B77F156DA90C00F2E3ED /* Debug */ = {
418 | isa = XCBuildConfiguration;
419 | buildSettings = {
420 | ALWAYS_SEARCH_USER_PATHS = NO;
421 | CLANG_WARN_BOOL_CONVERSION = YES;
422 | CLANG_WARN_CONSTANT_CONVERSION = YES;
423 | CLANG_WARN_EMPTY_BODY = YES;
424 | CLANG_WARN_ENUM_CONVERSION = YES;
425 | CLANG_WARN_INT_CONVERSION = YES;
426 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
427 | COPY_PHASE_STRIP = NO;
428 | GCC_C_LANGUAGE_STANDARD = gnu99;
429 | GCC_DYNAMIC_NO_PIC = NO;
430 | GCC_ENABLE_OBJC_EXCEPTIONS = YES;
431 | GCC_OPTIMIZATION_LEVEL = 0;
432 | GCC_PREPROCESSOR_DEFINITIONS = (
433 | "DEBUG=1",
434 | "$(inherited)",
435 | );
436 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
437 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
438 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
439 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
440 | GCC_WARN_UNDECLARED_SELECTOR = YES;
441 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
442 | GCC_WARN_UNUSED_FUNCTION = YES;
443 | GCC_WARN_UNUSED_VARIABLE = YES;
444 | MACOSX_DEPLOYMENT_TARGET = 10.6;
445 | ONLY_ACTIVE_ARCH = YES;
446 | SDKROOT = macosx;
447 | };
448 | name = Debug;
449 | };
450 | 1330B780156DA90C00F2E3ED /* Release */ = {
451 | isa = XCBuildConfiguration;
452 | buildSettings = {
453 | ALWAYS_SEARCH_USER_PATHS = NO;
454 | CLANG_WARN_BOOL_CONVERSION = YES;
455 | CLANG_WARN_CONSTANT_CONVERSION = YES;
456 | CLANG_WARN_EMPTY_BODY = YES;
457 | CLANG_WARN_ENUM_CONVERSION = YES;
458 | CLANG_WARN_INT_CONVERSION = YES;
459 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
460 | COPY_PHASE_STRIP = YES;
461 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
462 | GCC_C_LANGUAGE_STANDARD = gnu99;
463 | GCC_ENABLE_OBJC_EXCEPTIONS = YES;
464 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
465 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
466 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
467 | GCC_WARN_UNDECLARED_SELECTOR = YES;
468 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
469 | GCC_WARN_UNUSED_FUNCTION = YES;
470 | GCC_WARN_UNUSED_VARIABLE = YES;
471 | MACOSX_DEPLOYMENT_TARGET = 10.6;
472 | SDKROOT = macosx;
473 | };
474 | name = Release;
475 | };
476 | 1330B782156DA90C00F2E3ED /* Debug */ = {
477 | isa = XCBuildConfiguration;
478 | buildSettings = {
479 | COMBINE_HIDPI_IMAGES = YES;
480 | DYLIB_COMPATIBILITY_VERSION = 1;
481 | DYLIB_CURRENT_VERSION = 1;
482 | FRAMEWORK_VERSION = A;
483 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
484 | GCC_PREFIX_HEADER = "RHPreferences/RHPreferences-Prefix.pch";
485 | INFOPLIST_FILE = "RHPreferences/RHPreferences-Info.plist";
486 | INSTALL_PATH = "@executable_path/../Frameworks";
487 | PRODUCT_NAME = "$(TARGET_NAME)";
488 | WRAPPER_EXTENSION = framework;
489 | };
490 | name = Debug;
491 | };
492 | 1330B783156DA90C00F2E3ED /* Release */ = {
493 | isa = XCBuildConfiguration;
494 | buildSettings = {
495 | COMBINE_HIDPI_IMAGES = YES;
496 | DYLIB_COMPATIBILITY_VERSION = 1;
497 | DYLIB_CURRENT_VERSION = 1;
498 | FRAMEWORK_VERSION = A;
499 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
500 | GCC_PREFIX_HEADER = "RHPreferences/RHPreferences-Prefix.pch";
501 | INFOPLIST_FILE = "RHPreferences/RHPreferences-Info.plist";
502 | INSTALL_PATH = "@executable_path/../Frameworks";
503 | PRODUCT_NAME = "$(TARGET_NAME)";
504 | WRAPPER_EXTENSION = framework;
505 | };
506 | name = Release;
507 | };
508 | 1330B7A4156DAA4D00F2E3ED /* Debug */ = {
509 | isa = XCBuildConfiguration;
510 | buildSettings = {
511 | COMBINE_HIDPI_IMAGES = YES;
512 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
513 | GCC_PREFIX_HEADER = "RHPreferencesTester/RHPreferencesTester-Prefix.pch";
514 | INFOPLIST_FILE = "RHPreferencesTester/RHPreferencesTester-Info.plist";
515 | PRODUCT_NAME = "$(TARGET_NAME)";
516 | WRAPPER_EXTENSION = app;
517 | };
518 | name = Debug;
519 | };
520 | 1330B7A5156DAA4D00F2E3ED /* Release */ = {
521 | isa = XCBuildConfiguration;
522 | buildSettings = {
523 | COMBINE_HIDPI_IMAGES = YES;
524 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
525 | GCC_PREFIX_HEADER = "RHPreferencesTester/RHPreferencesTester-Prefix.pch";
526 | INFOPLIST_FILE = "RHPreferencesTester/RHPreferencesTester-Info.plist";
527 | PRODUCT_NAME = "$(TARGET_NAME)";
528 | WRAPPER_EXTENSION = app;
529 | };
530 | name = Release;
531 | };
532 | /* End XCBuildConfiguration section */
533 |
534 | /* Begin XCConfigurationList section */
535 | 1330B765156DA90B00F2E3ED /* Build configuration list for PBXProject "RHPreferences" */ = {
536 | isa = XCConfigurationList;
537 | buildConfigurations = (
538 | 1330B77F156DA90C00F2E3ED /* Debug */,
539 | 1330B780156DA90C00F2E3ED /* Release */,
540 | );
541 | defaultConfigurationIsVisible = 0;
542 | defaultConfigurationName = Release;
543 | };
544 | 1330B781156DA90C00F2E3ED /* Build configuration list for PBXNativeTarget "RHPreferences" */ = {
545 | isa = XCConfigurationList;
546 | buildConfigurations = (
547 | 1330B782156DA90C00F2E3ED /* Debug */,
548 | 1330B783156DA90C00F2E3ED /* Release */,
549 | );
550 | defaultConfigurationIsVisible = 0;
551 | defaultConfigurationName = Release;
552 | };
553 | 1330B7A3156DAA4D00F2E3ED /* Build configuration list for PBXNativeTarget "RHPreferencesTester" */ = {
554 | isa = XCConfigurationList;
555 | buildConfigurations = (
556 | 1330B7A4156DAA4D00F2E3ED /* Debug */,
557 | 1330B7A5156DAA4D00F2E3ED /* Release */,
558 | );
559 | defaultConfigurationIsVisible = 0;
560 | defaultConfigurationName = Release;
561 | };
562 | /* End XCConfigurationList section */
563 | };
564 | rootObject = 1330B762156DA90B00F2E3ED /* Project object */;
565 | }
566 |
--------------------------------------------------------------------------------
/RHPreferences.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/RHPreferences/RHPreferences-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | com.rheard.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | FMWK
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | NSHumanReadableCopyright
26 | Copyright © 2012 Richard Heard. All rights reserved.
27 | NSPrincipalClass
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/RHPreferences/RHPreferences-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'RHPreferences' target in the 'RHPreferences' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #endif
8 |
--------------------------------------------------------------------------------
/RHPreferences/RHPreferences.h:
--------------------------------------------------------------------------------
1 | //
2 | // RHPreferences.h
3 | // RHPreferences
4 | //
5 | // Created by Richard Heard on 23/05/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 | // Redistribution and use in source and binary forms, with or without
9 | // modification, are permitted provided that the following conditions
10 | // are met:
11 | // 1. Redistributions of source code must retain the above copyright
12 | // notice, this list of conditions and the following disclaimer.
13 | // 2. Redistributions in binary form must reproduce the above copyright
14 | // notice, this list of conditions and the following disclaimer in the
15 | // documentation and/or other materials provided with the distribution.
16 | // 3. The name of the author may not be used to endorse or promote products
17 | // derived from this software without specific prior written permission.
18 | //
19 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 | // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 | // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 | // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 |
31 | #import
32 | #import "RHPreferencesWindowController.h"
33 |
34 |
--------------------------------------------------------------------------------
/RHPreferences/RHPreferencesWindow.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1060
5 | 11D50b
6 | 2182
7 | 1138.32
8 | 568.00
9 |
10 | com.apple.InterfaceBuilder.CocoaPlugin
11 | 2182
12 |
13 |
14 | NSToolbarFlexibleSpaceItem
15 | NSWindowTemplate
16 | NSView
17 | NSToolbar
18 | NSCustomObject
19 | NSToolbarSpaceItem
20 |
21 |
22 | com.apple.InterfaceBuilder.CocoaPlugin
23 |
24 |
25 | PluginDependencyRecalculationVersion
26 |
27 |
28 |
29 |
30 | RHPreferencesWindowController
31 |
32 |
33 | FirstResponder
34 |
35 |
36 | NSApplication
37 |
38 |
39 | 4099
40 | 2
41 | {{478, 490}, {480, 270}}
42 | 544736256
43 | Preferences
44 | NSWindow
45 |
46 |
47 | 9B61CE83-FDFD-4E4C-ACCF-B7218A759A15
48 |
49 |
50 | YES
51 | YES
52 | NO
53 | YES
54 | 1
55 | 1
56 |
57 |
58 | NSToolbarFlexibleSpaceItem
59 |
60 | Flexible Space
61 |
62 |
63 |
64 |
65 |
66 | {1, 5}
67 | {20000, 32}
68 | YES
69 | YES
70 | -1
71 | YES
72 | 0
73 |
89 |
90 |
91 | NSToolbarSpaceItem
92 |
93 | Space
94 |
95 |
96 |
97 |
98 |
99 | {32, 5}
100 | {32, 32}
101 | YES
102 | YES
103 | -1
104 | YES
105 | 0
106 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 | 256
129 | {480, 270}
130 |
131 |
132 |
133 | {{0, 0}, {1440, 878}}
134 | {10000000000000, 10000000000000}
135 | NO
136 |
137 |
138 |
139 |
140 |
141 |
142 | window
143 |
144 |
145 |
146 | 3
147 |
148 |
149 |
150 | toolbar
151 |
152 |
153 |
154 | 15
155 |
156 |
157 |
158 | delegate
159 |
160 |
161 |
162 | 4
163 |
164 |
165 |
166 | delegate
167 |
168 |
169 |
170 | 14
171 |
172 |
173 |
174 |
175 |
176 | 0
177 |
178 |
179 |
180 |
181 |
182 | -2
183 |
184 |
185 | File's Owner
186 |
187 |
188 | -1
189 |
190 |
191 | First Responder
192 |
193 |
194 | -3
195 |
196 |
197 | Application
198 |
199 |
200 | 1
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 | 2
210 |
211 |
212 |
213 |
214 |
215 | 5
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 | 6
225 |
226 |
227 |
228 |
229 | 9
230 |
231 |
232 |
233 |
234 |
235 |
236 | com.apple.InterfaceBuilder.CocoaPlugin
237 | com.apple.InterfaceBuilder.CocoaPlugin
238 | com.apple.InterfaceBuilder.CocoaPlugin
239 |
240 |
241 | com.apple.InterfaceBuilder.CocoaPlugin
242 | {{357, 418}, {480, 270}}
243 |
244 | com.apple.InterfaceBuilder.CocoaPlugin
245 | com.apple.InterfaceBuilder.CocoaPlugin
246 | com.apple.InterfaceBuilder.CocoaPlugin
247 | com.apple.InterfaceBuilder.CocoaPlugin
248 |
249 |
250 |
251 |
252 |
253 | 18
254 |
255 |
256 |
257 |
258 | RHPreferencesWindowController
259 | NSWindowController
260 |
261 | selectToolbarItem:
262 | NSToolbarItem
263 |
264 |
265 | selectToolbarItem:
266 |
267 | selectToolbarItem:
268 | NSToolbarItem
269 |
270 |
271 |
272 | NSToolbar
273 | NSArray
274 |
275 |
276 |
277 | toolbar
278 | NSToolbar
279 |
280 |
281 | viewControllers
282 | NSArray
283 |
284 |
285 |
286 | IBProjectSource
287 | ./Classes/RHPreferencesWindowController.h
288 |
289 |
290 |
291 |
292 | 0
293 | IBCocoaFramework
294 |
295 | com.apple.InterfaceBuilder.CocoaPlugin.macosx
296 |
297 |
298 | YES
299 | 3
300 |
301 | {11, 11}
302 | {10, 3}
303 |
304 |
305 |
306 |
--------------------------------------------------------------------------------
/RHPreferences/RHPreferencesWindowController.h:
--------------------------------------------------------------------------------
1 | //
2 | // RHPreferencesWindowController.h
3 | // RHPreferences
4 | //
5 | // Created by Richard Heard on 10/04/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 | // Redistribution and use in source and binary forms, with or without
9 | // modification, are permitted provided that the following conditions
10 | // are met:
11 | // 1. Redistributions of source code must retain the above copyright
12 | // notice, this list of conditions and the following disclaimer.
13 | // 2. Redistributions in binary form must reproduce the above copyright
14 | // notice, this list of conditions and the following disclaimer in the
15 | // documentation and/or other materials provided with the distribution.
16 | // 3. The name of the author may not be used to endorse or promote products
17 | // derived from this software without specific prior written permission.
18 | //
19 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 | // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 | // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 | // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 |
31 | #import
32 |
33 | @protocol RHPreferencesViewControllerProtocol;
34 |
35 | @interface RHPreferencesWindowController : NSWindowController {
36 |
37 | NSArray *_viewControllers;
38 | NSToolbar *_toolbar;
39 | NSArray *_toolbarItems;
40 |
41 | NSViewController *_selectedViewController;
42 | NSString *_unloadedWindowTitle;
43 | BOOL _windowTitleShouldAutomaticlyUpdateToReflectSelectedViewController;
44 |
45 | }
46 |
47 | //init
48 | -(id)initWithViewControllers:(NSArray*)controllers;
49 | -(id)initWithViewControllers:(NSArray*)controllers andTitle:(NSString*)title;
50 |
51 | //properties
52 | @property (copy) NSString *windowTitle;
53 | @property (assign) BOOL windowTitleShouldAutomaticlyUpdateToReflectSelectedViewController; //defaults to YES
54 |
55 | @property (retain) IBOutlet NSToolbar *toolbar;
56 | @property (retain) IBOutlet NSArray *viewControllers; //controllers should implement RHPreferencesViewControllerProtocol
57 |
58 | @property (assign) NSUInteger selectedIndex;
59 | @property (assign) NSViewController *selectedViewController;
60 |
61 | -(NSViewController *)viewControllerWithIdentifier:(NSString*)identifier;
62 |
63 | //you can include these placeholder controllers amongst your array of view controllers to show their respective items in the toolbar
64 | +(id)separatorPlaceholderController; // NSToolbarSeparatorItemIdentifier
65 | +(id)flexibleSpacePlaceholderController; // NSToolbarFlexibleSpaceItemIdentifier
66 | +(id)spacePlaceholderController; // NSToolbarSpaceItemIdentifier
67 |
68 | +(id)showColorsPlaceholderController; // NSToolbarShowColorsItemIdentifier
69 | +(id)showFontsPlaceholderController; // NSToolbarShowFontsItemIdentifier
70 | +(id)customizeToolbarPlaceholderController; // NSToolbarCustomizeToolbarItemIdentifier
71 | +(id)printPlaceholderController; // NSToolbarPrintItemIdentifier
72 |
73 | @end
74 |
75 |
76 |
77 | // Implement this protocol on your view controller so that RHPreferencesWindow knows what to show in the tabbar. Label, image etc.
78 | @protocol RHPreferencesViewControllerProtocol
79 | @required
80 |
81 | @property (nonatomic, readonly, retain) NSString *identifier;
82 | @property (nonatomic, readonly, retain) NSImage *toolbarItemImage;
83 | @property (nonatomic, readonly, retain) NSString *toolbarItemLabel;
84 |
85 | @optional
86 |
87 | @property (nonatomic, readonly, retain) NSToolbarItem *toolbarItem; //optional, overrides the above 3 properties. allows for custom tabbar items.
88 |
89 | //methods called when switching between tabs
90 | -(void)viewWillAppear;
91 | -(void)viewDidAppear;
92 | -(void)viewWillDisappear;
93 | -(void)viewDidDisappear;
94 |
95 | -(NSView*)initialKeyView; // keyboard focus view on tab switch...
96 |
97 | @end
98 |
--------------------------------------------------------------------------------
/RHPreferences/RHPreferencesWindowController.m:
--------------------------------------------------------------------------------
1 | //
2 | // RHPreferencesWindowController.m
3 | // RHPreferences
4 | //
5 | // Created by Richard Heard on 10/04/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 | // Redistribution and use in source and binary forms, with or without
9 | // modification, are permitted provided that the following conditions
10 | // are met:
11 | // 1. Redistributions of source code must retain the above copyright
12 | // notice, this list of conditions and the following disclaimer.
13 | // 2. Redistributions in binary form must reproduce the above copyright
14 | // notice, this list of conditions and the following disclaimer in the
15 | // documentation and/or other materials provided with the distribution.
16 | // 3. The name of the author may not be used to endorse or promote products
17 | // derived from this software without specific prior written permission.
18 | //
19 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 | // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 | // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 | // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 | // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 |
31 | #import "RHPreferencesWindowController.h"
32 |
33 | static NSString * const RHPreferencesWindowControllerSelectedItemIdentifier = @"RHPreferencesWindowControllerSelectedItemIdentifier";
34 | static const CGFloat RHPreferencesWindowControllerResizeAnimationDurationPer100Pixels = 0.05f;
35 |
36 | #pragma mark - Custom Item Placeholder Controller
37 | @interface RHPreferencesCustomPlaceholderController : NSObject {
38 | NSString *_identifier;
39 | }
40 | +(id)controllerWithIdentifier:(NSString*)identifier;
41 | @property (readwrite, nonatomic, retain) NSString *identifier;
42 | @end
43 |
44 | @implementation RHPreferencesCustomPlaceholderController
45 | @synthesize identifier=_identifier;
46 | +(id)controllerWithIdentifier:(NSString*)identifier{
47 | RHPreferencesCustomPlaceholderController * placeholder = [[[RHPreferencesCustomPlaceholderController alloc] init] autorelease];
48 | placeholder.identifier = identifier;
49 | return placeholder;
50 | }
51 | -(NSToolbarItem*)toolbarItem{
52 | NSToolbarItem *item = [[[NSToolbarItem alloc] initWithItemIdentifier:_identifier] autorelease];
53 | return item;
54 | }
55 | -(NSString*)identifier{
56 | return _identifier;
57 | }
58 | -(NSImage*)toolbarItemImage{
59 | return nil;
60 | }
61 | -(NSString*)toolbarItemLabel{
62 | return nil;
63 | }
64 | @end
65 |
66 |
67 | #pragma mark - RHPreferencesWindowController
68 |
69 | @interface RHPreferencesWindowController ()
70 |
71 | //items
72 | -(NSToolbarItem*)toolbarItemWithItemIdentifier:(NSString*)identifier;
73 | -(NSToolbarItem*)newToolbarItemForViewController:(NSViewController*)controller;
74 | -(void)reloadToolbarItems;
75 | -(IBAction)selectToolbarItem:(NSToolbarItem*)itemToBeSelected;
76 | -(NSArray*)toolbarItemIdentifiers;
77 |
78 | //NSWindowController methods
79 | -(void)resizeWindowForContentSize:(NSSize)size duration:(CGFloat)duration;
80 |
81 | @end
82 |
83 | @implementation RHPreferencesWindowController
84 |
85 | @synthesize toolbar=_toolbar;
86 | @synthesize viewControllers=_viewControllers;
87 | @synthesize windowTitleShouldAutomaticlyUpdateToReflectSelectedViewController=_windowTitleShouldAutomaticlyUpdateToReflectSelectedViewController;
88 |
89 | #pragma mark - setup
90 | -(id)initWithViewControllers:(NSArray*)controllers {
91 | return [self initWithViewControllers:controllers andTitle:nil];
92 | }
93 |
94 | -(id)initWithViewControllers:(NSArray*)controllers andTitle:(NSString*)title{
95 | self = [super initWithWindowNibName:@"RHPreferencesWindow"];
96 | if (self){
97 |
98 | //default settings
99 | _windowTitleShouldAutomaticlyUpdateToReflectSelectedViewController = YES;
100 |
101 | //store the controllers
102 | [self setViewControllers:controllers];
103 | _unloadedWindowTitle = [title copy];
104 |
105 | }
106 |
107 | return self;
108 | }
109 |
110 | #pragma mark - properties
111 |
112 | -(NSString*)windowTitle{
113 | return [self isWindowLoaded] ? self.window.title : _unloadedWindowTitle;
114 | }
115 | -(void)setWindowTitle:(NSString *)windowTitle{
116 | if ([self isWindowLoaded]){
117 | self.window.title = windowTitle;
118 | } else {
119 | [_unloadedWindowTitle release];
120 | _unloadedWindowTitle = [windowTitle copy];
121 | }
122 | }
123 |
124 | -(NSArray*)viewControllers{
125 | return [[_viewControllers retain] autorelease];
126 | }
127 |
128 | -(void)setViewControllers:(NSArray *)viewControllers{
129 | if (_viewControllers != viewControllers){
130 | NSUInteger oldSelectedIndex = [self selectedIndex];
131 |
132 | [_viewControllers autorelease];
133 | _viewControllers = [viewControllers retain];
134 |
135 | //update the selected controller if we had one previously.
136 | if (_selectedViewController){
137 | if ([_viewControllers containsObject:_selectedViewController]){
138 | //cool, nothing to do
139 | } else {
140 | [self setSelectedIndex:oldSelectedIndex]; //reset the currently selected view controller
141 | }
142 | } else {
143 | //initial launch state (need to select previously selected tab)
144 |
145 | //set the selected controller
146 | NSViewController *selectedController = [self viewControllerWithIdentifier:[[NSUserDefaults standardUserDefaults] stringForKey:RHPreferencesWindowControllerSelectedItemIdentifier]];
147 | if (selectedController){
148 | [self setSelectedViewController:(id)selectedController];
149 | } else {
150 | [self setSelectedIndex:0]; // unknown, default to zero.
151 | }
152 |
153 | }
154 |
155 | [self reloadToolbarItems];
156 | }
157 | }
158 |
159 | -(NSViewController*)selectedViewController{
160 | return [[_selectedViewController retain] autorelease];
161 | }
162 |
163 | -(void)setSelectedViewController:(NSViewController *)new{
164 | //alias
165 | NSViewController *old = _selectedViewController;
166 |
167 | //stash
168 | _selectedViewController = new; //weak because we retain it in our array
169 |
170 | //stash to defaults also
171 | [[NSUserDefaults standardUserDefaults] setObject:[self toolbarItemIdentifierForViewController:new] forKey:RHPreferencesWindowControllerSelectedItemIdentifier];
172 |
173 | //bail if not yet loaded
174 | if (![self isWindowLoaded]){
175 | return;
176 | }
177 |
178 | if (old != new){
179 |
180 | //notify the old vc that its going away
181 | if ([old respondsToSelector:@selector(viewWillDisappear)]){
182 | [(id)old viewWillDisappear];
183 | }
184 |
185 | [old.view removeFromSuperview];
186 |
187 | if ([old respondsToSelector:@selector(viewDidDisappear)]){
188 | [(id)old viewDidDisappear];
189 | }
190 |
191 | //notify the new vc of its appearance
192 | if ([new respondsToSelector:@selector(viewWillAppear)]){
193 | [(id)new viewWillAppear];
194 | }
195 |
196 | //resize to Preferred window size for given view (duration is determined by difference between current and new sizes)
197 | float hDifference = fabs(new.view.bounds.size.height - old.view.bounds.size.height);
198 | float wDifference = fabs(new.view.bounds.size.width - old.view.bounds.size.width);
199 | float difference = MAX(hDifference, wDifference);
200 | float duration = MAX(RHPreferencesWindowControllerResizeAnimationDurationPer100Pixels * ( difference / 100), 0.10); // we always want a slight animation
201 | [self resizeWindowForContentSize:new.view.bounds.size duration:duration];
202 |
203 | double delayInSeconds = duration + 0.02; // +.02 to give time for resize to finish before appearing
204 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
205 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
206 |
207 | //make sure our "new" vc is still the selected vc before we add it as a subview, otherwise it's possible we could add more than one vc to the window. (the user has likely clicked to another tab during resizing.)
208 | if (_selectedViewController == new){
209 | [self.window.contentView addSubview:new.view];
210 |
211 | if ([new respondsToSelector:@selector(viewDidAppear)]){
212 | [(id)new viewDidAppear];
213 | }
214 |
215 | //if there is a initialKeyView set it as key
216 | if ([new respondsToSelector:@selector(initialKeyView)]){
217 | [[new initialKeyView] becomeFirstResponder];
218 | }
219 | }
220 | });
221 |
222 |
223 | [new.view setFrameOrigin:NSMakePoint(0, 0)]; // force our view to a 0,0 origin, fixed in the lower right corner.
224 | [new.view setAutoresizingMask:NSViewMaxXMargin|NSViewMaxYMargin];
225 |
226 | //set the currently selected toolbar item
227 | [_toolbar setSelectedItemIdentifier:[self toolbarItemIdentifierForViewController:new]];
228 |
229 | //if we should auto-update window title, do it now
230 | if (_windowTitleShouldAutomaticlyUpdateToReflectSelectedViewController){
231 | NSString *identifier = [self toolbarItemIdentifierForViewController:new];
232 | NSString *title = [[self toolbarItemWithItemIdentifier:identifier] label];
233 | if (title)[self setWindowTitle:title];
234 | }
235 | }
236 | }
237 |
238 | -(NSUInteger)selectedIndex{
239 | return [_viewControllers indexOfObject:[self selectedViewController]];
240 | }
241 |
242 | -(void)setSelectedIndex:(NSUInteger)selectedIndex{
243 | id newSelection = (selectedIndex >= [_viewControllers count]) ? [_viewControllers lastObject] : [_viewControllers objectAtIndex:selectedIndex];
244 | [self setSelectedViewController:newSelection];
245 | }
246 |
247 | -(NSViewController *)viewControllerWithIdentifier:(NSString*)identifier{
248 | for (NSViewController * vc in _viewControllers){
249 |
250 | //set the toolbar back to the current controllers selection
251 | if ([vc respondsToSelector:@selector(toolbarItem)] && [[[vc toolbarItem] itemIdentifier] isEqualToString:identifier]){
252 | return vc;
253 | }
254 |
255 | if ([[vc identifier] isEqualToString:identifier]){
256 | return vc;
257 | }
258 | }
259 | return nil;
260 | }
261 |
262 |
263 | #pragma mark - View Controller Methods
264 |
265 | -(void)resizeWindowForContentSize:(NSSize)size duration:(CGFloat)duration{
266 | NSWindow *window = [self window];
267 |
268 | NSRect frame = [window contentRectForFrameRect:[window frame]];
269 |
270 | CGFloat newX = NSMinX(frame) + (0.5* (NSWidth(frame) - size.width));
271 | NSRect newFrame = [window frameRectForContentRect:NSMakeRect(newX, NSMaxY(frame) - size.height, size.width, size.height)];
272 |
273 | if (duration > 0.0f){
274 | [NSAnimationContext beginGrouping];
275 | [[NSAnimationContext currentContext] setDuration:duration];
276 | [[window animator] setFrame:newFrame display:YES];
277 | [NSAnimationContext endGrouping];
278 | } else {
279 | [window setFrame:newFrame display:YES];
280 | }
281 |
282 | }
283 |
284 |
285 | #pragma mark - Toolbar Items
286 |
287 | -(NSToolbarItem*)toolbarItemWithItemIdentifier:(NSString*)identifier{
288 | for (NSToolbarItem *item in _toolbarItems){
289 | if ([[item itemIdentifier] isEqualToString:identifier]){
290 | return item;
291 | }
292 | }
293 | return nil;
294 | }
295 |
296 | -(NSString*)toolbarItemIdentifierForViewController:(NSViewController*)controller{
297 | if ([controller respondsToSelector:@selector(toolbarItem)]){
298 | NSToolbarItem *item = [(id)controller toolbarItem];
299 | if (item){
300 | return item.itemIdentifier;
301 | }
302 | }
303 |
304 | if ([controller respondsToSelector:@selector(identifier)]){
305 | return [(id)controller identifier];
306 | }
307 |
308 | return nil;
309 | }
310 |
311 |
312 | -(NSToolbarItem*)newToolbarItemForViewController:(NSViewController*)controller{
313 | //if the controller wants to provide a toolbar item, return that
314 | if ([controller respondsToSelector:@selector(toolbarItem)]){
315 | NSToolbarItem *item = [controller toolbarItem];
316 | if (item){
317 | item = [item copy]; //we copy the item because it needs to be unique for a specific toolbar
318 | item.target = self;
319 | item.action = @selector(selectToolbarItem:);
320 | return item;
321 | }
322 | }
323 |
324 | //otherwise, default to creation of a new item.
325 |
326 | NSToolbarItem *new = [[NSToolbarItem alloc] initWithItemIdentifier:controller.identifier];
327 | new.image = controller.toolbarItemImage;
328 | new.label = controller.toolbarItemLabel;
329 | new.target = self;
330 | new.action = @selector(selectToolbarItem:);
331 | return new;
332 | }
333 |
334 | -(void)reloadToolbarItems{
335 | NSMutableArray *newItems = [NSMutableArray arrayWithCapacity:[_viewControllers count]];
336 |
337 | for (NSViewController* vc in _viewControllers){
338 |
339 | NSToolbarItem *insertItem = [self toolbarItemWithItemIdentifier:vc.identifier];
340 | if (!insertItem){
341 | //create a new one
342 | insertItem = [[self newToolbarItemForViewController:vc] autorelease];
343 | }
344 | [newItems addObject:insertItem];
345 | }
346 |
347 | [_toolbarItems release];
348 | _toolbarItems = [[NSArray arrayWithArray:newItems] retain];
349 | }
350 |
351 |
352 | -(IBAction)selectToolbarItem:(NSToolbarItem*)itemToBeSelected{
353 | if ([_selectedViewController commitEditing] && [[NSUserDefaultsController sharedUserDefaultsController] commitEditing]){
354 | NSUInteger index = [_toolbarItems indexOfObject:itemToBeSelected];
355 | if (index != NSNotFound){
356 | [self setSelectedViewController:[_viewControllers objectAtIndex:index]];
357 | }
358 | } else {
359 | //set the toolbar back to the current controllers selection
360 | if ([_selectedViewController respondsToSelector:@selector(toolbarItem)] && [[_selectedViewController toolbarItem] itemIdentifier]){
361 | [_toolbar setSelectedItemIdentifier:[[_selectedViewController toolbarItem] itemIdentifier]];
362 | } else if ([_selectedViewController respondsToSelector:@selector(identifier)]){
363 | [_toolbar setSelectedItemIdentifier:[_selectedViewController identifier]];
364 | }
365 |
366 | }
367 | }
368 |
369 | -(NSArray*)toolbarItemIdentifiers{
370 | NSMutableArray *identifiers = [NSMutableArray arrayWithCapacity:[_viewControllers count]];
371 |
372 | for (id viewController in _viewControllers){
373 | [identifiers addObject:[self toolbarItemIdentifierForViewController:viewController]];
374 | }
375 |
376 | return [NSArray arrayWithArray:identifiers];
377 | }
378 |
379 | #pragma mark - Custom Placeholder Controller Toolbar Items
380 |
381 | +(id)separatorPlaceholderController{
382 | return [RHPreferencesCustomPlaceholderController controllerWithIdentifier:NSToolbarSeparatorItemIdentifier];
383 | }
384 | +(id)flexibleSpacePlaceholderController{
385 | return [RHPreferencesCustomPlaceholderController controllerWithIdentifier:NSToolbarFlexibleSpaceItemIdentifier];
386 | }
387 | +(id)spacePlaceholderController{
388 | return [RHPreferencesCustomPlaceholderController controllerWithIdentifier:NSToolbarSpaceItemIdentifier];
389 | }
390 | +(id)showColorsPlaceholderController{
391 | return [RHPreferencesCustomPlaceholderController controllerWithIdentifier:NSToolbarShowColorsItemIdentifier];
392 | }
393 | +(id)showFontsPlaceholderController{
394 | return [RHPreferencesCustomPlaceholderController controllerWithIdentifier:NSToolbarShowFontsItemIdentifier];
395 | }
396 | +(id)customizeToolbarPlaceholderController{
397 | return [RHPreferencesCustomPlaceholderController controllerWithIdentifier:NSToolbarCustomizeToolbarItemIdentifier];
398 | }
399 | +(id)printPlaceholderController{
400 | return [RHPreferencesCustomPlaceholderController controllerWithIdentifier:NSToolbarPrintItemIdentifier];
401 | }
402 |
403 | #pragma mark - NSWindowController
404 |
405 | -(void)loadWindow{
406 | [super loadWindow];
407 |
408 | if (_unloadedWindowTitle){
409 | self.window.title = _unloadedWindowTitle;
410 | [_unloadedWindowTitle release]; _unloadedWindowTitle = nil;
411 | }
412 |
413 | if (_selectedViewController){
414 |
415 | //add the view to the windows content view
416 | if ([_selectedViewController respondsToSelector:@selector(viewWillAppear)]){
417 | [_selectedViewController viewWillAppear];
418 | }
419 |
420 | [self.window.contentView addSubview:[_selectedViewController view]];
421 |
422 | if ([_selectedViewController respondsToSelector:@selector(viewDidAppear)]){
423 | [_selectedViewController viewDidAppear];
424 | }
425 |
426 | //resize to Preferred window size for given view
427 | [self resizeWindowForContentSize:_selectedViewController.view.bounds.size duration:0.0f];
428 |
429 | [_selectedViewController.view setFrameOrigin:NSMakePoint(0, 0)];
430 | [_selectedViewController.view setAutoresizingMask:NSViewMaxXMargin|NSViewMaxYMargin];
431 |
432 |
433 | //set the current controllers tab to selected
434 | [_toolbar setSelectedItemIdentifier:[self toolbarItemIdentifierForViewController:_selectedViewController]];
435 |
436 | //if there is a initialKeyView set it as key
437 | if ([_selectedViewController respondsToSelector:@selector(initialKeyView)]){
438 | [[_selectedViewController initialKeyView] becomeFirstResponder];
439 | }
440 |
441 | //if we should auto-update window title, do it now
442 | if (_windowTitleShouldAutomaticlyUpdateToReflectSelectedViewController){
443 | NSString *identifier = [self toolbarItemIdentifierForViewController:_selectedViewController];
444 | NSString *title = [[self toolbarItemWithItemIdentifier:identifier] label];
445 | if (title)[self setWindowTitle:title];
446 | }
447 | }
448 | }
449 |
450 | -(void)windowDidLoad{
451 | [super windowDidLoad];
452 | }
453 |
454 | #pragma mark - NSWindowDelegate
455 |
456 | -(BOOL)windowShouldClose:(id)sender{
457 | if (_selectedViewController){
458 | return [_selectedViewController commitEditing];
459 | }
460 |
461 | return YES;
462 | }
463 |
464 | -(void)windowWillClose:(NSNotification *)notification{
465 | // steal firstResponder away from text fields, to commit editing to bindings
466 | [self.window makeFirstResponder:self];
467 | }
468 |
469 | #pragma mark - NSToolbarDelegate
470 |
471 | -(NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag{
472 | return [self toolbarItemWithItemIdentifier:itemIdentifier];
473 | }
474 |
475 | -(NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar{
476 | return [self toolbarItemIdentifiers];
477 | }
478 |
479 | -(NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar{
480 | return [self toolbarItemIdentifiers];
481 | }
482 |
483 | -(NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar{
484 | return [self toolbarItemIdentifiers];
485 | }
486 |
487 | @end
488 |
--------------------------------------------------------------------------------
/RHPreferences/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/RHPreferencesTester/AboutPreferences.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heardrwt/RHPreferences/441dd7b690cdb56655dc78c7c34720adad6a4f1c/RHPreferencesTester/AboutPreferences.png
--------------------------------------------------------------------------------
/RHPreferencesTester/AccountsPreferences.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heardrwt/RHPreferences/441dd7b690cdb56655dc78c7c34720adad6a4f1c/RHPreferencesTester/AccountsPreferences.png
--------------------------------------------------------------------------------
/RHPreferencesTester/RHAboutViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // RHAboutViewController.h
3 | // RHPreferencesTester
4 | //
5 | // Created by Richard Heard on 17/04/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface RHAboutViewController : NSViewController {
13 | NSTextField *_emailTextField;
14 | }
15 |
16 | @property (assign) IBOutlet NSTextField *emailTextField;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHAboutViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // RHAboutViewController.m
3 | // RHPreferencesTester
4 | //
5 | // Created by Richard Heard on 17/04/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import "RHAboutViewController.h"
10 |
11 | @interface RHAboutViewController ()
12 |
13 | @end
14 |
15 | @implementation RHAboutViewController
16 | @synthesize emailTextField = _emailTextField;
17 |
18 | -(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
19 | self = [super initWithNibName:@"RHAboutViewController" bundle:nibBundleOrNil];
20 | if (self){
21 | // Initialization code here.
22 | }
23 | return self;
24 | }
25 |
26 |
27 | #pragma mark - RHPreferencesViewControllerProtocol
28 |
29 | -(NSString*)identifier{
30 | return NSStringFromClass(self.class);
31 | }
32 | -(NSImage*)toolbarItemImage{
33 | return [NSImage imageNamed:@"AboutPreferences"];
34 | }
35 | -(NSString*)toolbarItemLabel{
36 | return NSLocalizedString(@"About", @"AboutToolbarItemLabel");
37 | }
38 |
39 | -(NSView*)initialKeyView{
40 | return self.emailTextField;
41 | }
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHAboutViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1060
5 | 11E53
6 | 2182
7 | 1138.47
8 | 569.00
9 |
10 | com.apple.InterfaceBuilder.CocoaPlugin
11 | 2182
12 |
13 |
14 | NSTextField
15 | NSCustomObject
16 | NSCustomView
17 | NSButtonCell
18 | NSButton
19 | NSUserDefaultsController
20 | NSTextFieldCell
21 |
22 |
23 | com.apple.InterfaceBuilder.CocoaPlugin
24 |
25 |
26 | PluginDependencyRecalculationVersion
27 |
28 |
29 |
30 |
31 | RHAboutViewController
32 |
33 |
34 | FirstResponder
35 |
36 |
37 | NSApplication
38 |
39 |
40 |
41 | 8460
42 |
43 |
44 |
45 | 268
46 | {{53, 21}, {77, 17}}
47 |
48 |
49 |
50 | _NS:1505
51 | YES
52 |
53 | 68288064
54 | 272630784
55 | Mailing List
56 |
57 | LucidaGrande
58 | 13
59 | 1044
60 |
61 | _NS:1505
62 |
63 |
64 | 6
65 | System
66 | controlColor
67 |
68 | 3
69 | MC42NjY2NjY2NjY3AA
70 |
71 |
72 |
73 | 6
74 | System
75 | controlTextColor
76 |
77 | 3
78 | MAA
79 |
80 |
81 |
82 |
83 |
84 |
85 | 268
86 | {{144, 18}, {202, 22}}
87 |
88 |
89 |
90 | _NS:9
91 | YES
92 |
93 | -1804468671
94 | 272630784
95 |
96 |
97 | example@gmail.com
98 | _NS:9
99 |
100 | YES
101 |
102 | 6
103 | System
104 | textBackgroundColor
105 |
106 | 3
107 | MQA
108 |
109 |
110 |
111 | 6
112 | System
113 | textColor
114 |
115 |
116 |
117 |
118 |
119 |
120 | 268
121 | {{350, 12}, {101, 32}}
122 |
123 |
124 | _NS:9
125 | YES
126 |
127 | 67239424
128 | 134283264
129 | Subscribe
130 |
131 | _NS:9
132 |
133 | -2038284033
134 | 129
135 |
136 |
137 | 200
138 | 25
139 |
140 |
141 |
142 |
143 | 268
144 | {{17, 48}, {481, 133}}
145 |
146 |
147 |
148 | _NS:9
149 | {250, 750}
150 | YES
151 |
152 | 67239424
153 | 138412032
154 | VGhpcyBzYW1wbGUgYXBwbGljYXRpb24gZGVtb25zdHJhdGVzIHZhcmlvdXMgZmVhdHVyZXMgb2YgdGhl
155 | IFJIUHJlZmVyZW5jZXMuZnJhbWV3b3JrIAoKVGhlIGZyYW1ld29yayBjb25zaXN0cyBvZiBhIE5TV2lu
156 | ZG93Q29udHJvbGxlciBzdWJjbGFzcyB3aGljaCBhbGxvd3MgZm9yIHRoZSBzZXR0aW5nIG9mIGFuIGFy
157 | cmF5IG9mIE5TVmlld0NvbnRyb2xsZXJzIHRoYXQgc2hvdWxkIGltcGxlbWVudCB0aGUgUkhQcmVmZXJl
158 | bmNlc1ZpZXdQcm90b2NvbC4gA
159 |
160 | LucidaGrande
161 | 15
162 | 16
163 |
164 | _NS:9
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 | 268
173 | {{17, 205}, {481, 24}}
174 |
175 |
176 |
177 | _NS:1505
178 | YES
179 |
180 | 68288064
181 | 138413056
182 | RHPreferences
183 |
184 | LucidaGrande
185 | 20
186 | 16
187 |
188 | _NS:1505
189 |
190 |
191 |
192 |
193 |
194 |
195 | {515, 249}
196 |
197 |
198 |
199 | NSView
200 |
201 |
202 | YES
203 |
204 |
205 |
206 |
207 |
208 |
209 | view
210 |
211 |
212 |
213 | 2
214 |
215 |
216 |
217 | emailTextField
218 |
219 |
220 |
221 | 45
222 |
223 |
224 |
225 | nextKeyView
226 |
227 |
228 |
229 | 40
230 |
231 |
232 |
233 |
234 |
235 | 0
236 |
237 |
238 |
239 |
240 |
241 | -2
242 |
243 |
244 | File's Owner
245 |
246 |
247 | -1
248 |
249 |
250 | First Responder
251 |
252 |
253 | -3
254 |
255 |
256 | Application
257 |
258 |
259 | 1
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 | 25
272 |
273 |
274 |
275 |
276 | 31
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 | 32
285 |
286 |
287 |
288 |
289 | 33
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 | 34
298 |
299 |
300 |
301 |
302 | 35
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 | 36
311 |
312 |
313 |
314 |
315 | 41
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 | 42
324 |
325 |
326 |
327 |
328 | 43
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 | 44
337 |
338 |
339 |
340 |
341 |
342 |
343 | com.apple.InterfaceBuilder.CocoaPlugin
344 | com.apple.InterfaceBuilder.CocoaPlugin
345 | com.apple.InterfaceBuilder.CocoaPlugin
346 | com.apple.InterfaceBuilder.CocoaPlugin
347 | com.apple.InterfaceBuilder.CocoaPlugin
348 | com.apple.InterfaceBuilder.CocoaPlugin
349 | com.apple.InterfaceBuilder.CocoaPlugin
350 | com.apple.InterfaceBuilder.CocoaPlugin
351 | com.apple.InterfaceBuilder.CocoaPlugin
352 | com.apple.InterfaceBuilder.CocoaPlugin
353 | com.apple.InterfaceBuilder.CocoaPlugin
354 | com.apple.InterfaceBuilder.CocoaPlugin
355 | com.apple.InterfaceBuilder.CocoaPlugin
356 | com.apple.InterfaceBuilder.CocoaPlugin
357 | com.apple.InterfaceBuilder.CocoaPlugin
358 |
359 |
360 |
361 |
362 |
363 | 45
364 |
365 |
366 |
367 |
368 | RHAboutViewController
369 | NSViewController
370 |
371 | emailTextField
372 | NSTextField
373 |
374 |
375 | emailTextField
376 |
377 | emailTextField
378 | NSTextField
379 |
380 |
381 |
382 | IBProjectSource
383 | ./Classes/RHAboutViewController.h
384 |
385 |
386 |
387 |
388 | 0
389 | IBCocoaFramework
390 |
391 | com.apple.InterfaceBuilder.CocoaPlugin.macosx
392 |
393 |
394 | YES
395 | 3
396 |
397 |
398 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHAccountsViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // RHAccountsViewController.h
3 | // RHPreferencesTester
4 | //
5 | // Created by Richard Heard on 17/04/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface RHAccountsViewController : NSViewController {
13 | NSTextField *usernameTextField;
14 | }
15 |
16 | @property (assign) IBOutlet NSTextField *usernameTextField;
17 |
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHAccountsViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // RHAccountsViewController.m
3 | // RHPreferencesTester
4 | //
5 | // Created by Richard Heard on 17/04/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import "RHAccountsViewController.h"
10 |
11 | @interface RHAccountsViewController ()
12 |
13 | @end
14 |
15 | @implementation RHAccountsViewController
16 | @synthesize usernameTextField;
17 |
18 | -(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
19 | self = [super initWithNibName:@"RHAccountsViewController" bundle:nibBundleOrNil];
20 | if (self){
21 | // Initialization code here.
22 | }
23 | return self;
24 | }
25 |
26 |
27 | #pragma mark - RHPreferencesViewControllerProtocol
28 |
29 | -(NSString*)identifier{
30 | return NSStringFromClass(self.class);
31 | }
32 | -(NSImage*)toolbarItemImage{
33 | return [NSImage imageNamed:@"AccountsPreferences"];
34 | }
35 | -(NSString*)toolbarItemLabel{
36 | return NSLocalizedString(@"Accounts", @"AccountsToolbarItemLabel");
37 | }
38 |
39 | -(NSView*)initialKeyView{
40 | return self.usernameTextField;
41 | }
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHAccountsViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1060
5 | 11E53
6 | 2182
7 | 1138.47
8 | 569.00
9 |
10 | com.apple.InterfaceBuilder.CocoaPlugin
11 | 2182
12 |
13 |
14 | NSScroller
15 | NSTableHeaderView
16 | NSTextFieldCell
17 | NSScrollView
18 | NSButtonCell
19 | NSBox
20 | NSSecureTextFieldCell
21 | NSTableView
22 | NSMatrix
23 | NSCustomObject
24 | NSCustomView
25 | NSTableColumn
26 | NSUserDefaultsController
27 | NSTextField
28 | NSSecureTextField
29 |
30 |
31 | com.apple.InterfaceBuilder.CocoaPlugin
32 |
33 |
34 | PluginDependencyRecalculationVersion
35 |
36 |
37 |
38 |
39 | RHAccountsViewController
40 |
41 |
42 | FirstResponder
43 |
44 |
45 | NSApplication
46 |
47 |
48 |
49 | 8460
50 |
51 |
52 |
53 | 12
54 |
55 |
56 |
57 | 274
58 |
59 |
60 |
61 | 268
62 | {{130, 14}, {61, 58}}
63 |
64 | _NS:9
65 | YES
66 | 3
67 | 1
68 |
69 |
70 | -2080244224
71 | 0
72 | Red
73 |
74 | LucidaGrande
75 | 13
76 | 1044
77 |
78 |
79 | 1
80 | 1211912703
81 | 0
82 |
83 | NSRadioButton
84 |
85 |
86 |
87 | 200
88 | 25
89 |
90 |
91 | 67239424
92 | 0
93 | Green
94 |
95 |
96 | 1211912703
97 | 0
98 |
99 | 549453824
100 | {18, 18}
101 |
102 |
103 |
104 |
105 |
106 | TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
107 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
108 | IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
109 | 29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
110 | dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
111 | AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
112 | AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
113 | 0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
114 | 7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
115 | 5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
116 | 3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
117 | AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
118 | AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
119 | 6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
120 | /v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
121 | ///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
122 | YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
123 | AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
124 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
125 | AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
126 | AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
127 | AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB
128 | AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
129 | AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
130 | AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
131 |
132 |
133 |
134 |
135 |
136 | 3
137 | MCAwAA
138 |
139 |
140 |
141 | 400
142 | 75
143 |
144 |
145 | 67239424
146 | 0
147 | Blue
148 |
149 |
150 | 1211912703
151 | 0
152 |
153 | 400
154 | 75
155 |
156 |
157 | {61, 18}
158 | {4, 2}
159 | 1151868928
160 | NSActionCell
161 |
162 | 67239424
163 | 0
164 | Radio
165 |
166 | 1211912703
167 | 0
168 |
169 | 549453824
170 | {18, 18}
171 |
172 |
173 |
174 |
175 |
176 | TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
177 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
178 | IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
179 | 29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
180 | dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
181 | AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
182 | AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
183 | 0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
184 | 7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
185 | 5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
186 | 3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
187 | AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
188 | AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
189 | 6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
190 | /v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
191 | ///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
192 | YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
193 | AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
194 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
195 | AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
196 | AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
197 | AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB
198 | AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
199 | AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
200 | AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 | 400
209 | 75
210 |
211 |
212 |
213 | 6
214 | System
215 | controlColor
216 |
217 | 3
218 | MC42NjY2NjY2NjY3AA
219 |
220 |
221 |
222 | 3
223 | MQA
224 |
225 |
226 |
227 |
228 |
229 | 268
230 | {{59, 126}, {71, 17}}
231 |
232 | _NS:1505
233 | YES
234 |
235 | 68288064
236 | 272630784
237 | Username:
238 |
239 | _NS:1505
240 |
241 |
242 |
243 | 6
244 | System
245 | controlTextColor
246 |
247 | 3
248 | MAA
249 |
250 |
251 |
252 |
253 |
254 |
255 | 268
256 | {{135, 121}, {225, 22}}
257 |
258 | _NS:9
259 | YES
260 |
261 | -1804468671
262 | 272630784
263 |
264 |
265 | _NS:9
266 |
267 | YES
268 |
269 | 6
270 | System
271 | textBackgroundColor
272 |
273 |
274 |
275 | 6
276 | System
277 | textColor
278 |
279 |
280 |
281 |
282 |
283 |
284 | 268
285 | {{135, 89}, {225, 22}}
286 |
287 | _NS:9
288 | YES
289 |
290 | 343014976
291 | 272630848
292 |
293 |
294 | _NS:9
295 |
296 | YES
297 |
298 |
299 |
300 | NSAllRomanInputSourcesLocaleIdentifier
301 |
302 |
303 |
304 |
305 |
306 | 268
307 | {{62, 94}, {68, 17}}
308 |
309 | _NS:1505
310 | YES
311 |
312 | 68288064
313 | 272630784
314 | Password:
315 |
316 | _NS:1505
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 | 268
325 | {{74, 36}, {51, 17}}
326 |
327 | _NS:1505
328 | YES
329 |
330 | 68288064
331 | 272630784
332 | Colour:
333 |
334 | _NS:1505
335 |
336 |
337 |
338 |
339 |
340 |
341 | {{1, 1}, {479, 156}}
342 |
343 | _NS:11
344 |
345 |
346 | {{17, 16}, {481, 172}}
347 |
348 |
349 | _NS:9
350 | {0, 0}
351 |
352 | 67239424
353 | 0
354 | Box
355 |
356 | LucidaGrande
357 | 11
358 | 3100
359 |
360 |
361 |
362 | 3
363 | MCAwLjgwMDAwMDAxMTkAA
364 |
365 |
366 |
367 | 1
368 | 0
369 | 2
370 | NO
371 |
372 |
373 |
374 | 268
375 |
376 |
377 |
378 | 2304
379 |
380 |
381 |
382 | 256
383 | {473, 285}
384 |
385 |
386 | _NS:13
387 | YES
388 |
397 |
398 |
399 | -2147483392
400 | {{224, 0}, {16, 17}}
401 |
402 |
403 | _NS:19
404 |
405 |
406 |
407 | 116
408 | 40
409 | 1000
410 |
426 |
427 | 337772096
428 | 2048
429 | Text Cell
430 |
431 |
432 |
433 | 6
434 | System
435 | controlBackgroundColor
436 |
437 |
438 |
439 |
440 | 3
441 | YES
442 | YES
443 |
444 |
445 |
446 | 351
447 | 40
448 | 1000
449 |
457 |
458 | 337772096
459 | 2048
460 | Text Cell
461 |
462 |
463 |
464 |
465 |
466 | 3
467 | YES
468 | YES
469 |
470 |
471 |
472 | 3
473 | 2
474 |
475 |
476 | 6
477 | System
478 | gridColor
479 |
480 | 3
481 | MC41AA
482 |
483 |
484 | 17
485 | -700448768
486 |
487 |
488 | 4
489 | 15
490 | 0
491 | YES
492 | 0
493 | 1
494 |
495 |
496 | {{1, 17}, {473, 285}}
497 |
498 |
499 | _NS:11
500 |
501 |
502 | 4
503 |
504 |
505 |
506 | -2147483392
507 | {{224, 17}, {15, 102}}
508 |
509 |
510 | _NS:58
511 |
512 | _doScroller:
513 | 37
514 | 0.1947367936372757
515 |
516 |
517 |
518 | -2147483392
519 | {{1, 119}, {223, 15}}
520 |
521 | _NS:60
522 | 1
523 |
524 | _doScroller:
525 | 0.57142859697341919
526 |
527 |
528 |
529 | 2304
530 |
531 |
532 |
533 | {{1, 0}, {473, 17}}
534 |
535 |
536 | _NS:15
537 |
538 |
539 | 4
540 |
541 |
542 |
543 | {{20, 209}, {475, 303}}
544 |
545 |
546 | _NS:9
547 | 133682
548 |
549 |
550 |
551 |
552 |
553 | QSAAAEEgAABBmAAAQZgAAA
554 |
555 |
556 | {515, 532}
557 |
558 | NSView
559 |
560 |
561 | YES
562 |
563 |
564 |
565 |
566 |
567 |
568 | view
569 |
570 |
571 |
572 | 2
573 |
574 |
575 |
576 | usernameTextField
577 |
578 |
579 |
580 | 56
581 |
582 |
583 |
584 |
585 |
586 | 0
587 |
588 |
589 |
590 |
591 |
592 | -2
593 |
594 |
595 | File's Owner
596 |
597 |
598 | -1
599 |
600 |
601 | First Responder
602 |
603 |
604 | -3
605 |
606 |
607 | Application
608 |
609 |
610 | 1
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 | 25
620 |
621 |
622 |
623 |
624 | 31
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 | 32
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 | 33
645 |
646 |
647 |
648 |
649 | 34
650 |
651 |
652 |
653 |
654 | 35
655 |
656 |
657 |
658 |
659 | 36
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 | 37
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 | 38
676 |
677 |
678 |
679 |
680 | 39
681 |
682 |
683 |
684 |
685 | 40
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 | 41
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 | 42
710 |
711 |
712 |
713 |
714 | 43
715 |
716 |
717 |
718 |
719 | 44
720 |
721 |
722 |
723 |
724 | 45
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 | 46
733 |
734 |
735 |
736 |
737 | 47
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 | 48
746 |
747 |
748 |
749 |
750 | 49
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 | 50
759 |
760 |
761 |
762 |
763 | 51
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 | 52
772 |
773 |
774 |
775 |
776 | 53
777 |
778 |
779 |
780 |
781 | 54
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 | 55
790 |
791 |
792 |
793 |
794 |
795 |
796 | com.apple.InterfaceBuilder.CocoaPlugin
797 | com.apple.InterfaceBuilder.CocoaPlugin
798 | com.apple.InterfaceBuilder.CocoaPlugin
799 | com.apple.InterfaceBuilder.CocoaPlugin
800 | com.apple.InterfaceBuilder.CocoaPlugin
801 | com.apple.InterfaceBuilder.CocoaPlugin
802 | com.apple.InterfaceBuilder.CocoaPlugin
803 | com.apple.InterfaceBuilder.CocoaPlugin
804 | com.apple.InterfaceBuilder.CocoaPlugin
805 | com.apple.InterfaceBuilder.CocoaPlugin
806 | com.apple.InterfaceBuilder.CocoaPlugin
807 | com.apple.InterfaceBuilder.CocoaPlugin
808 | com.apple.InterfaceBuilder.CocoaPlugin
809 | com.apple.InterfaceBuilder.CocoaPlugin
810 | com.apple.InterfaceBuilder.CocoaPlugin
811 | com.apple.InterfaceBuilder.CocoaPlugin
812 | com.apple.InterfaceBuilder.CocoaPlugin
813 | com.apple.InterfaceBuilder.CocoaPlugin
814 | com.apple.InterfaceBuilder.CocoaPlugin
815 | com.apple.InterfaceBuilder.CocoaPlugin
816 | com.apple.InterfaceBuilder.CocoaPlugin
817 | com.apple.InterfaceBuilder.CocoaPlugin
818 | com.apple.InterfaceBuilder.CocoaPlugin
819 | com.apple.InterfaceBuilder.CocoaPlugin
820 | com.apple.InterfaceBuilder.CocoaPlugin
821 | com.apple.InterfaceBuilder.CocoaPlugin
822 | com.apple.InterfaceBuilder.CocoaPlugin
823 | com.apple.InterfaceBuilder.CocoaPlugin
824 | com.apple.InterfaceBuilder.CocoaPlugin
825 | com.apple.InterfaceBuilder.CocoaPlugin
826 |
827 |
828 |
829 |
830 |
831 | 56
832 |
833 |
834 | 0
835 | IBCocoaFramework
836 |
837 | com.apple.InterfaceBuilder.CocoaPlugin.macosx
838 |
839 |
840 | YES
841 | 3
842 |
843 |
844 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // RHAppDelegate.h
3 | // RHPreferencesTester
4 | //
5 | // Created by Richard Heard on 23/05/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface RHAppDelegate : NSObject {
13 |
14 | NSWindow *_window;
15 | RHPreferencesWindowController *_preferencesWindowController;
16 | }
17 |
18 | @property (assign) IBOutlet NSWindow *window;
19 | @property (retain) RHPreferencesWindowController *preferencesWindowController;
20 |
21 |
22 | #pragma mark - IBActions
23 | -(IBAction)showPreferences:(id)sender;
24 |
25 |
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // RHAppDelegate.m
3 | // RHPreferencesTester
4 | //
5 | // Created by Richard Heard on 23/05/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import "RHAppDelegate.h"
10 | #import "RHAboutViewController.h"
11 | #import "RHAccountsViewController.h"
12 | #import "RHWideViewController.h"
13 |
14 | @implementation RHAppDelegate
15 |
16 | @synthesize window = _window;
17 | @synthesize preferencesWindowController=_preferencesWindowController;
18 |
19 | - (void)dealloc
20 | {
21 | [_preferencesWindowController release]; _preferencesWindowController = nil;
22 | [super dealloc];
23 | }
24 |
25 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
26 | {
27 | // Insert code here to initialize your application
28 | }
29 |
30 |
31 |
32 |
33 | #pragma mark - IBActions
34 | -(IBAction)showPreferences:(id)sender{
35 | //if we have not created the window controller yet, create it now
36 | if (!_preferencesWindowController){
37 | RHAccountsViewController *accounts = [[[RHAccountsViewController alloc] init] autorelease];
38 | RHAboutViewController *about = [[[RHAboutViewController alloc] init] autorelease];
39 | RHWideViewController *wide = [[[RHWideViewController alloc] init] autorelease];
40 |
41 | NSArray *controllers = [NSArray arrayWithObjects:accounts, wide,
42 | [RHPreferencesWindowController flexibleSpacePlaceholderController],
43 | about,
44 | nil];
45 |
46 | _preferencesWindowController = [[RHPreferencesWindowController alloc] initWithViewControllers:controllers andTitle:NSLocalizedString(@"Preferences", @"Preferences Window Title")];
47 | }
48 |
49 | [_preferencesWindowController showWindow:self];
50 |
51 | }
52 |
53 |
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHPreferencesTester-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | com.rheard.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | ${MACOSX_DEPLOYMENT_TARGET}
27 | NSHumanReadableCopyright
28 | Copyright © 2012 Richard Heard. All rights reserved.
29 | NSMainNibFile
30 | MainMenu
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHPreferencesTester-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'RHPreferencesTester' target in the 'RHPreferencesTester' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #endif
8 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHWideViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // RHWideViewController.h
3 | // RHPreferences
4 | //
5 | // Created by Richard Heard on 23/05/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface RHWideViewController : NSViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHWideViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // RHWideViewController.m
3 | // RHPreferences
4 | //
5 | // Created by Richard Heard on 23/05/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import "RHWideViewController.h"
10 |
11 | @interface RHWideViewController ()
12 |
13 | @end
14 |
15 | @implementation RHWideViewController
16 |
17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
18 | {
19 | self = [super initWithNibName:@"RHWideViewController" bundle:nibBundleOrNil];
20 | if (self) {
21 | // Initialization code here.
22 | }
23 |
24 | return self;
25 | }
26 |
27 | #pragma mark - RHPreferencesViewControllerProtocol
28 |
29 | -(NSString*)identifier{
30 | return NSStringFromClass(self.class);
31 | }
32 | -(NSImage*)toolbarItemImage{
33 | return [NSImage imageNamed:@"WidePreferences"];
34 | }
35 | -(NSString*)toolbarItemLabel{
36 | return NSLocalizedString(@"Resizing", @"WideToolbarItemLabel");
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/RHPreferencesTester/RHWideViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1060
5 | 11E53
6 | 2182
7 | 1138.47
8 | 569.00
9 |
10 | com.apple.InterfaceBuilder.CocoaPlugin
11 | 2182
12 |
13 |
14 | NSCustomView
15 | NSTextField
16 | NSTextFieldCell
17 | NSCustomObject
18 |
19 |
20 | com.apple.InterfaceBuilder.CocoaPlugin
21 |
22 |
23 | PluginDependencyRecalculationVersion
24 |
25 |
26 |
27 |
28 | RHWideViewController
29 |
30 |
31 | FirstResponder
32 |
33 |
34 | NSApplication
35 |
36 |
37 |
38 | 268
39 |
40 |
41 |
42 | 268
43 | {{92, 127}, {533, 19}}
44 |
45 |
46 |
47 | _NS:1505
48 | YES
49 |
50 | 68288064
51 | 138413056
52 | This tab demonstrates dynamic resizing for custom width views.
53 |
54 | LucidaGrande
55 | 15
56 | 16
57 |
58 | _NS:1505
59 |
60 |
61 | 6
62 | System
63 | controlColor
64 |
65 | 3
66 | MC42NjY2NjY2NjY3AA
67 |
68 |
69 |
70 | 6
71 | System
72 | controlTextColor
73 |
74 | 3
75 | MAA
76 |
77 |
78 |
79 |
80 |
81 | {717, 272}
82 |
83 |
84 |
85 | NSView
86 |
87 |
88 |
89 |
90 |
91 |
92 | view
93 |
94 |
95 |
96 | 2
97 |
98 |
99 |
100 |
101 |
102 | 0
103 |
104 |
105 |
106 |
107 |
108 | -2
109 |
110 |
111 | File's Owner
112 |
113 |
114 | -1
115 |
116 |
117 | First Responder
118 |
119 |
120 | -3
121 |
122 |
123 | Application
124 |
125 |
126 | 1
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 | 9
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 | 10
143 |
144 |
145 |
146 |
147 |
148 |
149 | com.apple.InterfaceBuilder.CocoaPlugin
150 | com.apple.InterfaceBuilder.CocoaPlugin
151 | com.apple.InterfaceBuilder.CocoaPlugin
152 | com.apple.InterfaceBuilder.CocoaPlugin
153 | com.apple.InterfaceBuilder.CocoaPlugin
154 | com.apple.InterfaceBuilder.CocoaPlugin
155 |
156 |
157 |
158 |
159 |
160 | 14
161 |
162 |
163 |
164 |
165 | RHWideViewController
166 | NSViewController
167 |
168 | IBProjectSource
169 | ./Classes/RHWideViewController.h
170 |
171 |
172 |
173 |
174 | 0
175 | IBCocoaFramework
176 |
177 | com.apple.InterfaceBuilder.CocoaPlugin.macosx
178 |
179 |
180 | YES
181 | 3
182 |
183 |
184 |
--------------------------------------------------------------------------------
/RHPreferencesTester/WidePreferences.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heardrwt/RHPreferences/441dd7b690cdb56655dc78c7c34720adad6a4f1c/RHPreferencesTester/WidePreferences.png
--------------------------------------------------------------------------------
/RHPreferencesTester/en.lproj/Credits.rtf:
--------------------------------------------------------------------------------
1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
2 | {\colortbl;\red255\green255\blue255;}
3 | \paperw9840\paperh8400
4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
5 |
6 | \f0\b\fs24 \cf0 Engineering:
7 | \b0 \
8 | Some people\
9 | \
10 |
11 | \b Human Interface Design:
12 | \b0 \
13 | Some other people\
14 | \
15 |
16 | \b Testing:
17 | \b0 \
18 | Hopefully not nobody\
19 | \
20 |
21 | \b Documentation:
22 | \b0 \
23 | Whoever\
24 | \
25 |
26 | \b With special thanks to:
27 | \b0 \
28 | Mom\
29 | }
30 |
--------------------------------------------------------------------------------
/RHPreferencesTester/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/RHPreferencesTester/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // RHPreferencesTester
4 | //
5 | // Created by Richard Heard on 23/05/12.
6 | // Copyright (c) 2012 Richard Heard. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, char *argv[])
12 | {
13 | return NSApplicationMain(argc, (const char **)argv);
14 | }
15 |
--------------------------------------------------------------------------------