├── .gitignore ├── README.md └── Sample ├── Sample.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata └── Sample ├── ANSegmentedControl ├── ANSegmentedCell.h ├── ANSegmentedCell.m ├── ANSegmentedControl.h ├── ANSegmentedControl.m ├── NSBezierPath+MCAdditions.h ├── NSBezierPath+MCAdditions.m ├── NSShadow+MCAdditions.h └── NSShadow+MCAdditions.m ├── INAppStoreWindow ├── INAppStoreWindow.h └── INAppStoreWindow.m ├── Resources ├── FilterNone.png ├── FilterStarred.png └── FilterUnread.png ├── Sample-Info.plist ├── Sample-Prefix.pch ├── SampleAppDelegate.h ├── SampleAppDelegate.m ├── en.lproj ├── Credits.rtf ├── InfoPlist.strings └── MainMenu.xib └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pbxuser 3 | *.perspective 4 | *.perspectivev3 5 | *.mode1v3 6 | *.mode2v3 7 | *.xcuserdata 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ANSegmentedControl 2 | ==================== 3 | 4 | NSSegmentedControl subclass 5 | 6 | ![ANSegmentedControl](http://i51.tinypic.com/apcwlf.png) 7 | 8 | * License : BSD 9 | 10 | * Includes: 11 | * NSBezierPath / NSShadow additions from Sean Patrick O'Brien 12 | 13 | ==================== 14 | -------------------------------------------------------------------------------- /Sample/Sample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B91B3D8F13673DA600AC21B2 /* INAppStoreWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = B91B3D8E13673DA600AC21B2 /* INAppStoreWindow.m */; }; 11 | CBE8AF3E13655C3C0056207D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBE8AF3D13655C3C0056207D /* Cocoa.framework */; }; 12 | CBE8AF4813655C3C0056207D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CBE8AF4613655C3C0056207D /* InfoPlist.strings */; }; 13 | CBE8AF4B13655C3C0056207D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE8AF4A13655C3C0056207D /* main.m */; }; 14 | CBE8AF4E13655C3C0056207D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = CBE8AF4C13655C3C0056207D /* Credits.rtf */; }; 15 | CBE8AF5113655C3C0056207D /* SampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE8AF5013655C3C0056207D /* SampleAppDelegate.m */; }; 16 | CBE8AF5413655C3C0056207D /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = CBE8AF5213655C3C0056207D /* MainMenu.xib */; }; 17 | CBE8AF6B13655CA70056207D /* ANSegmentedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE8AF6413655CA70056207D /* ANSegmentedCell.m */; }; 18 | CBE8AF6C13655CA70056207D /* ANSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE8AF6613655CA70056207D /* ANSegmentedControl.m */; }; 19 | CBE8AF6D13655CA70056207D /* NSBezierPath+MCAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE8AF6813655CA70056207D /* NSBezierPath+MCAdditions.m */; }; 20 | CBE8AF6E13655CA70056207D /* NSShadow+MCAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CBE8AF6A13655CA70056207D /* NSShadow+MCAdditions.m */; }; 21 | CBE8AF7413655CAC0056207D /* FilterNone.png in Resources */ = {isa = PBXBuildFile; fileRef = CBE8AF7113655CAC0056207D /* FilterNone.png */; }; 22 | CBE8AF7513655CAC0056207D /* FilterStarred.png in Resources */ = {isa = PBXBuildFile; fileRef = CBE8AF7213655CAC0056207D /* FilterStarred.png */; }; 23 | CBE8AF7613655CAC0056207D /* FilterUnread.png in Resources */ = {isa = PBXBuildFile; fileRef = CBE8AF7313655CAC0056207D /* FilterUnread.png */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | B91B3D8D13673DA600AC21B2 /* INAppStoreWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INAppStoreWindow.h; sourceTree = ""; }; 28 | B91B3D8E13673DA600AC21B2 /* INAppStoreWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = INAppStoreWindow.m; sourceTree = ""; }; 29 | CBE8AF3913655C3C0056207D /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | CBE8AF3D13655C3C0056207D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 31 | CBE8AF4013655C3C0056207D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 32 | CBE8AF4113655C3C0056207D /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 33 | CBE8AF4213655C3C0056207D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 34 | CBE8AF4513655C3C0056207D /* Sample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Sample-Info.plist"; sourceTree = ""; }; 35 | CBE8AF4713655C3C0056207D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 36 | CBE8AF4913655C3C0056207D /* Sample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Sample-Prefix.pch"; sourceTree = ""; }; 37 | CBE8AF4A13655C3C0056207D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | CBE8AF4D13655C3C0056207D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 39 | CBE8AF4F13655C3C0056207D /* SampleAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SampleAppDelegate.h; sourceTree = ""; }; 40 | CBE8AF5013655C3C0056207D /* SampleAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SampleAppDelegate.m; sourceTree = ""; }; 41 | CBE8AF5313655C3C0056207D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 42 | CBE8AF6313655CA70056207D /* ANSegmentedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANSegmentedCell.h; sourceTree = ""; }; 43 | CBE8AF6413655CA70056207D /* ANSegmentedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANSegmentedCell.m; sourceTree = ""; }; 44 | CBE8AF6513655CA70056207D /* ANSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANSegmentedControl.h; sourceTree = ""; }; 45 | CBE8AF6613655CA70056207D /* ANSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANSegmentedControl.m; sourceTree = ""; }; 46 | CBE8AF6713655CA70056207D /* NSBezierPath+MCAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBezierPath+MCAdditions.h"; sourceTree = ""; }; 47 | CBE8AF6813655CA70056207D /* NSBezierPath+MCAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBezierPath+MCAdditions.m"; sourceTree = ""; }; 48 | CBE8AF6913655CA70056207D /* NSShadow+MCAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSShadow+MCAdditions.h"; sourceTree = ""; }; 49 | CBE8AF6A13655CA70056207D /* NSShadow+MCAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSShadow+MCAdditions.m"; sourceTree = ""; }; 50 | CBE8AF7113655CAC0056207D /* FilterNone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = FilterNone.png; sourceTree = ""; }; 51 | CBE8AF7213655CAC0056207D /* FilterStarred.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = FilterStarred.png; sourceTree = ""; }; 52 | CBE8AF7313655CAC0056207D /* FilterUnread.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = FilterUnread.png; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | CBE8AF3613655C3C0056207D /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | CBE8AF3E13655C3C0056207D /* Cocoa.framework in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | B91B3D8C13673DA600AC21B2 /* INAppStoreWindow */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | B91B3D8D13673DA600AC21B2 /* INAppStoreWindow.h */, 71 | B91B3D8E13673DA600AC21B2 /* INAppStoreWindow.m */, 72 | ); 73 | path = INAppStoreWindow; 74 | sourceTree = ""; 75 | }; 76 | CBE8AF2E13655C3B0056207D = { 77 | isa = PBXGroup; 78 | children = ( 79 | CBE8AF4313655C3C0056207D /* Sample */, 80 | CBE8AF3C13655C3C0056207D /* Frameworks */, 81 | CBE8AF3A13655C3C0056207D /* Products */, 82 | ); 83 | sourceTree = ""; 84 | }; 85 | CBE8AF3A13655C3C0056207D /* Products */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | CBE8AF3913655C3C0056207D /* Sample.app */, 89 | ); 90 | name = Products; 91 | sourceTree = ""; 92 | }; 93 | CBE8AF3C13655C3C0056207D /* Frameworks */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | CBE8AF3D13655C3C0056207D /* Cocoa.framework */, 97 | CBE8AF3F13655C3C0056207D /* Other Frameworks */, 98 | ); 99 | name = Frameworks; 100 | sourceTree = ""; 101 | }; 102 | CBE8AF3F13655C3C0056207D /* Other Frameworks */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | CBE8AF4013655C3C0056207D /* AppKit.framework */, 106 | CBE8AF4113655C3C0056207D /* CoreData.framework */, 107 | CBE8AF4213655C3C0056207D /* Foundation.framework */, 108 | ); 109 | name = "Other Frameworks"; 110 | sourceTree = ""; 111 | }; 112 | CBE8AF4313655C3C0056207D /* Sample */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | B91B3D8C13673DA600AC21B2 /* INAppStoreWindow */, 116 | CBE8AF7013655CAC0056207D /* Resources */, 117 | CBE8AF6213655CA70056207D /* ANSegmentedControl */, 118 | CBE8AF4F13655C3C0056207D /* SampleAppDelegate.h */, 119 | CBE8AF5013655C3C0056207D /* SampleAppDelegate.m */, 120 | CBE8AF5213655C3C0056207D /* MainMenu.xib */, 121 | CBE8AF4413655C3C0056207D /* Supporting Files */, 122 | ); 123 | path = Sample; 124 | sourceTree = ""; 125 | }; 126 | CBE8AF4413655C3C0056207D /* Supporting Files */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | CBE8AF4513655C3C0056207D /* Sample-Info.plist */, 130 | CBE8AF4613655C3C0056207D /* InfoPlist.strings */, 131 | CBE8AF4913655C3C0056207D /* Sample-Prefix.pch */, 132 | CBE8AF4A13655C3C0056207D /* main.m */, 133 | CBE8AF4C13655C3C0056207D /* Credits.rtf */, 134 | ); 135 | name = "Supporting Files"; 136 | sourceTree = ""; 137 | }; 138 | CBE8AF6213655CA70056207D /* ANSegmentedControl */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | CBE8AF6313655CA70056207D /* ANSegmentedCell.h */, 142 | CBE8AF6413655CA70056207D /* ANSegmentedCell.m */, 143 | CBE8AF6513655CA70056207D /* ANSegmentedControl.h */, 144 | CBE8AF6613655CA70056207D /* ANSegmentedControl.m */, 145 | CBE8AF6713655CA70056207D /* NSBezierPath+MCAdditions.h */, 146 | CBE8AF6813655CA70056207D /* NSBezierPath+MCAdditions.m */, 147 | CBE8AF6913655CA70056207D /* NSShadow+MCAdditions.h */, 148 | CBE8AF6A13655CA70056207D /* NSShadow+MCAdditions.m */, 149 | ); 150 | path = ANSegmentedControl; 151 | sourceTree = ""; 152 | }; 153 | CBE8AF7013655CAC0056207D /* Resources */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | CBE8AF7113655CAC0056207D /* FilterNone.png */, 157 | CBE8AF7213655CAC0056207D /* FilterStarred.png */, 158 | CBE8AF7313655CAC0056207D /* FilterUnread.png */, 159 | ); 160 | name = Resources; 161 | path = Sample/Resources; 162 | sourceTree = SOURCE_ROOT; 163 | }; 164 | /* End PBXGroup section */ 165 | 166 | /* Begin PBXNativeTarget section */ 167 | CBE8AF3813655C3C0056207D /* Sample */ = { 168 | isa = PBXNativeTarget; 169 | buildConfigurationList = CBE8AF5713655C3C0056207D /* Build configuration list for PBXNativeTarget "Sample" */; 170 | buildPhases = ( 171 | CBE8AF3513655C3C0056207D /* Sources */, 172 | CBE8AF3613655C3C0056207D /* Frameworks */, 173 | CBE8AF3713655C3C0056207D /* Resources */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | ); 179 | name = Sample; 180 | productName = Sample; 181 | productReference = CBE8AF3913655C3C0056207D /* Sample.app */; 182 | productType = "com.apple.product-type.application"; 183 | }; 184 | /* End PBXNativeTarget section */ 185 | 186 | /* Begin PBXProject section */ 187 | CBE8AF3013655C3B0056207D /* Project object */ = { 188 | isa = PBXProject; 189 | buildConfigurationList = CBE8AF3313655C3B0056207D /* Build configuration list for PBXProject "Sample" */; 190 | compatibilityVersion = "Xcode 3.2"; 191 | developmentRegion = English; 192 | hasScannedForEncodings = 0; 193 | knownRegions = ( 194 | en, 195 | ); 196 | mainGroup = CBE8AF2E13655C3B0056207D; 197 | productRefGroup = CBE8AF3A13655C3C0056207D /* Products */; 198 | projectDirPath = ""; 199 | projectRoot = ""; 200 | targets = ( 201 | CBE8AF3813655C3C0056207D /* Sample */, 202 | ); 203 | }; 204 | /* End PBXProject section */ 205 | 206 | /* Begin PBXResourcesBuildPhase section */ 207 | CBE8AF3713655C3C0056207D /* Resources */ = { 208 | isa = PBXResourcesBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | CBE8AF4813655C3C0056207D /* InfoPlist.strings in Resources */, 212 | CBE8AF4E13655C3C0056207D /* Credits.rtf in Resources */, 213 | CBE8AF5413655C3C0056207D /* MainMenu.xib in Resources */, 214 | CBE8AF7413655CAC0056207D /* FilterNone.png in Resources */, 215 | CBE8AF7513655CAC0056207D /* FilterStarred.png in Resources */, 216 | CBE8AF7613655CAC0056207D /* FilterUnread.png in Resources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | CBE8AF3513655C3C0056207D /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | CBE8AF4B13655C3C0056207D /* main.m in Sources */, 228 | CBE8AF5113655C3C0056207D /* SampleAppDelegate.m in Sources */, 229 | CBE8AF6B13655CA70056207D /* ANSegmentedCell.m in Sources */, 230 | CBE8AF6C13655CA70056207D /* ANSegmentedControl.m in Sources */, 231 | CBE8AF6D13655CA70056207D /* NSBezierPath+MCAdditions.m in Sources */, 232 | CBE8AF6E13655CA70056207D /* NSShadow+MCAdditions.m in Sources */, 233 | B91B3D8F13673DA600AC21B2 /* INAppStoreWindow.m in Sources */, 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | }; 237 | /* End PBXSourcesBuildPhase section */ 238 | 239 | /* Begin PBXVariantGroup section */ 240 | CBE8AF4613655C3C0056207D /* InfoPlist.strings */ = { 241 | isa = PBXVariantGroup; 242 | children = ( 243 | CBE8AF4713655C3C0056207D /* en */, 244 | ); 245 | name = InfoPlist.strings; 246 | sourceTree = ""; 247 | }; 248 | CBE8AF4C13655C3C0056207D /* Credits.rtf */ = { 249 | isa = PBXVariantGroup; 250 | children = ( 251 | CBE8AF4D13655C3C0056207D /* en */, 252 | ); 253 | name = Credits.rtf; 254 | sourceTree = ""; 255 | }; 256 | CBE8AF5213655C3C0056207D /* MainMenu.xib */ = { 257 | isa = PBXVariantGroup; 258 | children = ( 259 | CBE8AF5313655C3C0056207D /* en */, 260 | ); 261 | name = MainMenu.xib; 262 | sourceTree = ""; 263 | }; 264 | /* End PBXVariantGroup section */ 265 | 266 | /* Begin XCBuildConfiguration section */ 267 | CBE8AF5513655C3C0056207D /* Debug */ = { 268 | isa = XCBuildConfiguration; 269 | buildSettings = { 270 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 271 | GCC_C_LANGUAGE_STANDARD = gnu99; 272 | GCC_OPTIMIZATION_LEVEL = 0; 273 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 274 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 275 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 276 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 277 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | MACOSX_DEPLOYMENT_TARGET = 10.6; 280 | ONLY_ACTIVE_ARCH = YES; 281 | SDKROOT = macosx; 282 | }; 283 | name = Debug; 284 | }; 285 | CBE8AF5613655C3C0056207D /* Release */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 289 | GCC_C_LANGUAGE_STANDARD = gnu99; 290 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 292 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 293 | GCC_WARN_UNUSED_VARIABLE = YES; 294 | MACOSX_DEPLOYMENT_TARGET = 10.6; 295 | SDKROOT = macosx; 296 | }; 297 | name = Release; 298 | }; 299 | CBE8AF5813655C3C0056207D /* Debug */ = { 300 | isa = XCBuildConfiguration; 301 | buildSettings = { 302 | ALWAYS_SEARCH_USER_PATHS = NO; 303 | COPY_PHASE_STRIP = NO; 304 | GCC_DYNAMIC_NO_PIC = NO; 305 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 306 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 307 | GCC_PREFIX_HEADER = "Sample/Sample-Prefix.pch"; 308 | INFOPLIST_FILE = "Sample/Sample-Info.plist"; 309 | PRODUCT_NAME = "$(TARGET_NAME)"; 310 | WRAPPER_EXTENSION = app; 311 | }; 312 | name = Debug; 313 | }; 314 | CBE8AF5913655C3C0056207D /* Release */ = { 315 | isa = XCBuildConfiguration; 316 | buildSettings = { 317 | ALWAYS_SEARCH_USER_PATHS = NO; 318 | COPY_PHASE_STRIP = YES; 319 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 320 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 321 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 322 | GCC_PREFIX_HEADER = "Sample/Sample-Prefix.pch"; 323 | INFOPLIST_FILE = "Sample/Sample-Info.plist"; 324 | PRODUCT_NAME = "$(TARGET_NAME)"; 325 | WRAPPER_EXTENSION = app; 326 | }; 327 | name = Release; 328 | }; 329 | /* End XCBuildConfiguration section */ 330 | 331 | /* Begin XCConfigurationList section */ 332 | CBE8AF3313655C3B0056207D /* Build configuration list for PBXProject "Sample" */ = { 333 | isa = XCConfigurationList; 334 | buildConfigurations = ( 335 | CBE8AF5513655C3C0056207D /* Debug */, 336 | CBE8AF5613655C3C0056207D /* Release */, 337 | ); 338 | defaultConfigurationIsVisible = 0; 339 | defaultConfigurationName = Release; 340 | }; 341 | CBE8AF5713655C3C0056207D /* Build configuration list for PBXNativeTarget "Sample" */ = { 342 | isa = XCConfigurationList; 343 | buildConfigurations = ( 344 | CBE8AF5813655C3C0056207D /* Debug */, 345 | CBE8AF5913655C3C0056207D /* Release */, 346 | ); 347 | defaultConfigurationIsVisible = 0; 348 | defaultConfigurationName = Release; 349 | }; 350 | /* End XCConfigurationList section */ 351 | }; 352 | rootObject = CBE8AF3013655C3B0056207D /* Project object */; 353 | } 354 | -------------------------------------------------------------------------------- /Sample/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sample/Sample/ANSegmentedControl/ANSegmentedCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ANSegmentedCell.h 3 | // test01 4 | // 5 | // Created by Decors on 11/04/22. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ANSegmentedCell : NSSegmentedCell { 13 | @private 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Sample/Sample/ANSegmentedControl/ANSegmentedCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ANSegmentedCell.m 3 | // test01 4 | // 5 | // Created by Decors on 11/04/22. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ANSegmentedCell.h" 10 | #import "NSBezierPath+MCAdditions.h" 11 | #import "NSShadow+MCAdditions.h" 12 | 13 | @implementation ANSegmentedCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Sample/Sample/ANSegmentedControl/ANSegmentedControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // ANSegmentedControl.h 3 | // test01 4 | // 5 | // Created by Decors on 11/04/22. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ANSegmentedControl : NSSegmentedControl { 13 | @private 14 | NSPoint location; 15 | } 16 | 17 | -(void)setSelectedSegment:(NSInteger)newSegment animate:(bool)animate; 18 | @property CGFloat fastAnimationDuration; 19 | @property CGFloat slowAnimationDuration; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Sample/Sample/ANSegmentedControl/ANSegmentedControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // ANSegmentedControl.m 3 | // test01 4 | // 5 | // Created by Decors on 11/04/22. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ANSegmentedControl.h" 10 | #import "ANSegmentedCell.h" 11 | #import "NSBezierPath+MCAdditions.h" 12 | #import "NSShadow+MCAdditions.h" 13 | 14 | @interface ANKnobAnimation : NSAnimation { 15 | int start, range; 16 | id delegate; 17 | } 18 | 19 | @end 20 | 21 | @implementation ANKnobAnimation 22 | 23 | - (id)initWithStart:(int)begin end:(int)end 24 | { 25 | self = [super init]; 26 | if( self ) 27 | { 28 | start = begin; 29 | range = end - begin; 30 | } 31 | return self; 32 | } 33 | 34 | - (void)setCurrentProgress:(NSAnimationProgress)progress 35 | { 36 | int x = start + progress * range; 37 | [super setCurrentProgress:progress]; 38 | [delegate performSelector:@selector(setPosition:) 39 | withObject:[NSNumber numberWithInteger:x]]; 40 | } 41 | 42 | - (void)setDelegate:(id)d 43 | { 44 | delegate = d; 45 | } 46 | 47 | @end 48 | 49 | @interface ANSegmentedControl (Private) 50 | - (void)drawBackgroud:(NSRect)rect; 51 | - (void)drawKnob:(NSRect)rect; 52 | - (void)animateTo:(int)x; 53 | - (void)setPosition:(NSNumber *)x; 54 | - (void)offsetLocationByX:(float)x; 55 | - (void)drawCenteredImage:(NSImage*)image inFrame:(NSRect)frame imageFraction:(float)imageFraction; 56 | - (void)setDefaultDurations; 57 | @end 58 | 59 | @implementation ANSegmentedControl 60 | @synthesize fastAnimationDuration=_fastAnimationDuration; 61 | @synthesize slowAnimationDuration=_slowAnimationDuration; 62 | 63 | 64 | + (Class)cellClass 65 | { 66 | return [ANSegmentedCell class]; 67 | } 68 | - (id) initWithFrame:(NSRect)frameRect 69 | { 70 | self = [super initWithFrame:frameRect]; 71 | if( self ) 72 | { 73 | [self setDefaultDurations]; 74 | } 75 | return self; 76 | } 77 | - (id)initWithCoder:(NSCoder *)aDecoder 78 | { 79 | if (![aDecoder isKindOfClass:[NSKeyedUnarchiver class]]) 80 | return [super initWithCoder:aDecoder]; 81 | 82 | NSKeyedUnarchiver *unarchiver = (NSKeyedUnarchiver *)aDecoder; 83 | Class oldClass = [[self superclass] cellClass]; 84 | Class newClass = [[self class] cellClass]; 85 | 86 | [unarchiver setClass:newClass forClassName:NSStringFromClass(oldClass)]; 87 | self = [super initWithCoder:aDecoder]; 88 | [unarchiver setClass:oldClass forClassName:NSStringFromClass(oldClass)]; 89 | 90 | [self setDefaultDurations]; 91 | 92 | return self; 93 | } 94 | 95 | - (void)awakeFromNib 96 | { 97 | [self setBoundsSize:NSMakeSize([self bounds].size.width, 25)]; 98 | [self setFrameSize:NSMakeSize([self frame].size.width, 25)]; 99 | location.x = [self frame].size.width / [self segmentCount] * [self selectedSegment]; 100 | [[self cell] setTrackingMode:NSSegmentSwitchTrackingSelectOne]; 101 | } 102 | 103 | -(void)drawCenteredImage:(NSImage*)image inFrame:(NSRect)frame imageFraction:(float)imageFraction 104 | { 105 | CGSize imageSize = [image size]; 106 | CGRect rect= NSMakeRect(frame.origin.x + (frame.size.width-imageSize.width)/2.0, 107 | frame.origin.y + (frame.size.height-imageSize.height)/2.0, 108 | imageSize.width, 109 | imageSize.height ); 110 | [image drawInRect:rect 111 | fromRect:NSZeroRect 112 | operation:NSCompositeSourceOver 113 | fraction:imageFraction 114 | respectFlipped:YES 115 | hints:nil]; 116 | } 117 | - (void)drawRect:(NSRect)dirtyRect 118 | { 119 | NSRect rect = [self bounds]; 120 | rect.size.height -= 1; 121 | 122 | [self drawBackgroud:rect]; 123 | [self drawKnob:rect]; 124 | } 125 | 126 | - (void)drawSegment:(NSInteger)segment inFrame:(NSRect)frame withView:(NSView *)controlView 127 | { 128 | float imageFraction; 129 | 130 | if ([[self window] isKeyWindow]) { 131 | imageFraction = .5; 132 | } else { 133 | imageFraction = .2; 134 | } 135 | 136 | NSImage *image = [self imageForSegment:segment]; 137 | [[NSGraphicsContext currentContext] setImageInterpolation: NSImageInterpolationHigh]; 138 | [self drawCenteredImage:image inFrame:frame imageFraction:imageFraction]; 139 | } 140 | 141 | - (void)drawBackgroud:(NSRect)rect 142 | { 143 | CGFloat radius = 3.5; 144 | NSGradient *gradient; 145 | NSColor *frameColor; 146 | 147 | NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect 148 | xRadius:radius 149 | yRadius:radius]; 150 | 151 | NSGraphicsContext *ctx = [NSGraphicsContext currentContext]; 152 | 153 | if ([[self window] isKeyWindow]) { 154 | gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithCalibratedWhite:.75 alpha:1.0] 155 | endingColor:[NSColor colorWithCalibratedWhite:.6 alpha:1.0]]; 156 | 157 | frameColor = [NSColor colorWithCalibratedWhite:.37 alpha:1.0] ; 158 | } else { 159 | gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithCalibratedWhite:.8 alpha:1.0] 160 | endingColor:[NSColor colorWithCalibratedWhite:.77 alpha:1.0]]; 161 | frameColor = [NSColor colorWithCalibratedWhite:.68 alpha:1.0] ; 162 | } 163 | 164 | // シャドウ 165 | [ctx saveGraphicsState]; 166 | NSShadow *dropShadow = [[NSShadow alloc] init]; 167 | [dropShadow setShadowOffset:NSMakeSize(0, -1.0)]; 168 | [dropShadow setShadowBlurRadius:1.0]; 169 | [dropShadow setShadowColor:[NSColor colorWithCalibratedWhite:.863 alpha:.75]]; 170 | [dropShadow set]; 171 | [path fill]; 172 | [ctx restoreGraphicsState]; 173 | 174 | // 塗り 175 | [gradient drawInBezierPath:path angle:-90]; 176 | 177 | // 枠線 178 | [frameColor setStroke]; 179 | [path strokeInside]; 180 | 181 | float segmentWidth = rect.size.width / [self segmentCount]; 182 | float segmentHeight = rect.size.height; 183 | NSRect segmentRect = NSMakeRect(0, 0, segmentWidth, segmentHeight); 184 | 185 | for(int s = 0; s < [self segmentCount]; s ++) { 186 | [self drawSegment:s 187 | inFrame:segmentRect 188 | withView:self]; 189 | segmentRect.origin.x += segmentWidth; 190 | } 191 | #if ! __has_feature(objc_arc) 192 | [gradient release]; 193 | [dropShadow release]; 194 | #endif 195 | } 196 | 197 | - (void)drawKnob:(NSRect)rect 198 | { 199 | CGFloat radius = 3; 200 | NSGradient *gradient; 201 | float imageFraction; 202 | NSColor *frameColor; 203 | 204 | if ([[self window] isKeyWindow]) { 205 | gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithCalibratedWhite:.68 alpha:1.0] 206 | endingColor:[NSColor colorWithCalibratedWhite:.91 alpha:1.0]]; 207 | imageFraction = 1.0; 208 | frameColor = [NSColor colorWithCalibratedWhite:.37 alpha:1.0] ; 209 | } else { 210 | gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithCalibratedWhite:.76 alpha:1.0] 211 | endingColor:[NSColor colorWithCalibratedWhite:.90 alpha:1.0]]; 212 | imageFraction = .25; 213 | frameColor = [NSColor colorWithCalibratedWhite:.68 alpha:1.0] ; 214 | } 215 | 216 | CGFloat width = rect.size.width / [self segmentCount]; 217 | CGFloat height = rect.size.height; 218 | NSRect knobRect=NSMakeRect(location.x, rect.origin.y, width, height); 219 | NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect: knobRect 220 | xRadius:radius 221 | yRadius:radius]; 222 | // 塗り 223 | [gradient drawInBezierPath:path angle:-90]; 224 | // 枠線 225 | [frameColor setStroke]; 226 | [path strokeInside]; 227 | 228 | int newSegment = (int)round(location.x / width); 229 | NSImage *image = [self imageForSegment:newSegment]; 230 | [self drawCenteredImage:image inFrame:knobRect imageFraction:imageFraction]; 231 | 232 | #if ! __has_feature(objc_arc) 233 | [gradient release]; 234 | #endif 235 | } 236 | 237 | - (void)animateTo:(int)x 238 | { 239 | float maxX = [self frame].size.width - ([self frame].size.width / [self segmentCount]); 240 | 241 | ANKnobAnimation *a = [[ANKnobAnimation alloc] initWithStart:location.x end:x]; 242 | [a setDelegate:self]; 243 | if (location.x == 0 || location.x == maxX){ 244 | [a setDuration:_fastAnimationDuration]; 245 | [a setAnimationCurve:NSAnimationEaseInOut]; 246 | } else { 247 | [a setDuration:_slowAnimationDuration * ((fabs(location.x - x)) / maxX)]; 248 | [a setAnimationCurve:NSAnimationLinear]; 249 | } 250 | 251 | [a setAnimationBlockingMode:NSAnimationBlocking]; 252 | [a startAnimation]; 253 | #if ! __has_feature(objc_arc) 254 | [a release]; 255 | #endif 256 | } 257 | 258 | 259 | - (void)setPosition:(NSNumber *)x 260 | { 261 | location.x = [x intValue]; 262 | [self display]; 263 | } 264 | 265 | - (void)setSelectedSegment:(NSInteger)newSegment 266 | { 267 | [self setSelectedSegment:newSegment animate:true]; 268 | } 269 | 270 | - (void)setSelectedSegment:(NSInteger)newSegment animate:(bool)animate 271 | { 272 | if(newSegment == [self selectedSegment]) 273 | return; 274 | 275 | float maxX = [self frame].size.width - ([self frame].size.width / [self segmentCount]); 276 | 277 | int x = newSegment > [self segmentCount] ? maxX : newSegment * ([self frame].size.width / [self segmentCount]); 278 | 279 | if(animate) 280 | [self animateTo:x]; 281 | else { 282 | [self setNeedsDisplay:YES]; 283 | } 284 | 285 | [super setSelectedSegment:newSegment]; 286 | } 287 | 288 | 289 | - (void)offsetLocationByX:(float)x 290 | { 291 | location.x = location.x + x; 292 | float maxX = [self frame].size.width - ([self frame].size.width / [self segmentCount]); 293 | 294 | if (location.x < 0) location.x = 0; 295 | if (location.x > maxX) location.x = maxX; 296 | 297 | [self setNeedsDisplay:YES]; 298 | } 299 | 300 | - (void)mouseDown:(NSEvent *)event 301 | { 302 | BOOL loop = YES; 303 | 304 | NSPoint clickLocation = [self convertPoint:[event locationInWindow] fromView:nil]; 305 | float knobWidth = [self frame].size.width / [self segmentCount]; 306 | NSRect knobRect = NSMakeRect(location.x, 0, knobWidth, [self frame].size.height); 307 | 308 | if (NSPointInRect(clickLocation, [self bounds])) { 309 | NSPoint newDragLocation; 310 | NSPoint localLastDragLocation; 311 | localLastDragLocation = clickLocation; 312 | 313 | while (loop) { 314 | NSEvent *localEvent; 315 | localEvent = [[self window] nextEventMatchingMask:NSLeftMouseUpMask | NSLeftMouseDraggedMask]; 316 | 317 | switch ([localEvent type]) { 318 | case NSLeftMouseDragged: 319 | if (NSPointInRect(clickLocation, knobRect)) { 320 | newDragLocation = [self convertPoint:[localEvent locationInWindow] 321 | fromView:nil]; 322 | 323 | [self offsetLocationByX:(newDragLocation.x - localLastDragLocation.x)]; 324 | 325 | localLastDragLocation = newDragLocation; 326 | [self autoscroll:localEvent]; 327 | } 328 | break; 329 | case NSLeftMouseUp: 330 | loop = NO; 331 | 332 | int newSegment; 333 | 334 | if (memcmp(&clickLocation, &localLastDragLocation, sizeof(NSPoint)) == 0) { 335 | newSegment = floor(clickLocation.x / knobWidth); 336 | //if (newSegment != [self selectedSegment]) { 337 | [self animateTo:newSegment * knobWidth]; 338 | //} 339 | } else { 340 | newSegment = (int)round(location.x / knobWidth); 341 | [self animateTo:newSegment * knobWidth]; 342 | } 343 | 344 | [self setSelectedSegment:newSegment]; 345 | [[self window] invalidateCursorRectsForView:self]; 346 | [self sendAction:[self action] to:[self target]]; 347 | 348 | break; 349 | default: 350 | break; 351 | } 352 | } 353 | }; 354 | return; 355 | } 356 | 357 | - (BOOL)acceptsFirstResponder 358 | { 359 | return YES; 360 | } 361 | 362 | - (void)setDefaultDurations 363 | { 364 | _fastAnimationDuration = 0.20; 365 | _slowAnimationDuration = 0.35; 366 | } 367 | 368 | @end 369 | -------------------------------------------------------------------------------- /Sample/Sample/ANSegmentedControl/NSBezierPath+MCAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBezierPath+MCAdditions.h 3 | // 4 | // Created by Sean Patrick O'Brien on 4/1/08. 5 | // Copyright 2008 MolokoCacao. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface NSBezierPath (MCAdditions) 12 | 13 | + (NSBezierPath *)bezierPathWithCGPath:(CGPathRef)pathRef; 14 | - (CGPathRef)cgPath; 15 | 16 | - (NSBezierPath *)pathWithStrokeWidth:(CGFloat)strokeWidth; 17 | 18 | - (void)fillWithInnerShadow:(NSShadow *)shadow; 19 | - (void)drawBlurWithColor:(NSColor *)color radius:(CGFloat)radius; 20 | 21 | - (void)strokeInside; 22 | - (void)strokeInsideWithinRect:(NSRect)clipRect; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Sample/Sample/ANSegmentedControl/NSBezierPath+MCAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBezierPath+MCAdditions.m 3 | // 4 | // Created by Sean Patrick O'Brien on 4/1/08. 5 | // Copyright 2008 MolokoCacao. All rights reserved. 6 | // 7 | 8 | #import "NSBezierPath+MCAdditions.h" 9 | 10 | // remove/comment out this line of you don't want to use undocumented functions 11 | //#define MCBEZIER_USE_PRIVATE_FUNCTION 12 | 13 | #ifdef MCBEZIER_USE_PRIVATE_FUNCTION 14 | extern CGPathRef CGContextCopyPath(CGContextRef context); 15 | #endif 16 | 17 | static void CGPathCallback(void *info, const CGPathElement *element) 18 | { 19 | NSBezierPath *path = info; 20 | CGPoint *points = element->points; 21 | 22 | switch (element->type) { 23 | case kCGPathElementMoveToPoint: 24 | { 25 | [path moveToPoint:NSMakePoint(points[0].x, points[0].y)]; 26 | break; 27 | } 28 | case kCGPathElementAddLineToPoint: 29 | { 30 | [path lineToPoint:NSMakePoint(points[0].x, points[0].y)]; 31 | break; 32 | } 33 | case kCGPathElementAddQuadCurveToPoint: 34 | { 35 | // NOTE: This is untested. 36 | NSPoint currentPoint = [path currentPoint]; 37 | NSPoint interpolatedPoint = NSMakePoint((currentPoint.x + 2*points[0].x) / 3, (currentPoint.y + 2*points[0].y) / 3); 38 | [path curveToPoint:NSMakePoint(points[1].x, points[1].y) controlPoint1:interpolatedPoint controlPoint2:interpolatedPoint]; 39 | break; 40 | } 41 | case kCGPathElementAddCurveToPoint: 42 | { 43 | [path curveToPoint:NSMakePoint(points[2].x, points[2].y) controlPoint1:NSMakePoint(points[0].x, points[0].y) controlPoint2:NSMakePoint(points[1].x, points[1].y)]; 44 | break; 45 | } 46 | case kCGPathElementCloseSubpath: 47 | { 48 | [path closePath]; 49 | break; 50 | } 51 | } 52 | } 53 | 54 | @implementation NSBezierPath (MCAdditions) 55 | 56 | + (NSBezierPath *)bezierPathWithCGPath:(CGPathRef)pathRef 57 | { 58 | NSBezierPath *path = [NSBezierPath bezierPath]; 59 | CGPathApply(pathRef, path, CGPathCallback); 60 | 61 | return path; 62 | } 63 | 64 | // Method borrowed from Google's Cocoa additions 65 | - (CGPathRef)cgPath 66 | { 67 | CGMutablePathRef thePath = CGPathCreateMutable(); 68 | if (!thePath) return nil; 69 | 70 | unsigned int elementCount = (unsigned int)[self elementCount]; 71 | 72 | // The maximum number of points is 3 for a NSCurveToBezierPathElement. 73 | // (controlPoint1, controlPoint2, and endPoint) 74 | NSPoint controlPoints[3]; 75 | 76 | for (unsigned int i = 0; i < elementCount; i++) { 77 | switch ([self elementAtIndex:i associatedPoints:controlPoints]) { 78 | case NSMoveToBezierPathElement: 79 | CGPathMoveToPoint(thePath, &CGAffineTransformIdentity, 80 | controlPoints[0].x, controlPoints[0].y); 81 | break; 82 | case NSLineToBezierPathElement: 83 | CGPathAddLineToPoint(thePath, &CGAffineTransformIdentity, 84 | controlPoints[0].x, controlPoints[0].y); 85 | break; 86 | case NSCurveToBezierPathElement: 87 | CGPathAddCurveToPoint(thePath, &CGAffineTransformIdentity, 88 | controlPoints[0].x, controlPoints[0].y, 89 | controlPoints[1].x, controlPoints[1].y, 90 | controlPoints[2].x, controlPoints[2].y); 91 | break; 92 | case NSClosePathBezierPathElement: 93 | CGPathCloseSubpath(thePath); 94 | break; 95 | default: 96 | NSLog(@"Unknown element at [NSBezierPath (GTMBezierPathCGPathAdditions) cgPath]"); 97 | break; 98 | }; 99 | } 100 | return thePath; 101 | } 102 | 103 | - (NSBezierPath *)pathWithStrokeWidth:(CGFloat)strokeWidth 104 | { 105 | #ifdef MCBEZIER_USE_PRIVATE_FUNCTION 106 | NSBezierPath *path = [self copy]; 107 | CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; 108 | CGPathRef pathRef = [path cgPath]; 109 | [path release]; 110 | 111 | CGContextSaveGState(context); 112 | 113 | CGContextBeginPath(context); 114 | CGContextAddPath(context, pathRef); 115 | CGContextSetLineWidth(context, strokeWidth); 116 | CGContextReplacePathWithStrokedPath(context); 117 | CGPathRef strokedPathRef = CGContextCopyPath(context); 118 | CGContextBeginPath(context); 119 | NSBezierPath *strokedPath = [NSBezierPath bezierPathWithCGPath:strokedPathRef]; 120 | 121 | CGContextRestoreGState(context); 122 | 123 | CFRelease(pathRef); 124 | CFRelease(strokedPathRef); 125 | 126 | return strokedPath; 127 | #else 128 | return nil; 129 | #endif//MCBEZIER_USE_PRIVATE_FUNCTION 130 | } 131 | 132 | - (void)fillWithInnerShadow:(NSShadow *)shadow 133 | { 134 | [NSGraphicsContext saveGraphicsState]; 135 | 136 | NSSize offset = shadow.shadowOffset; 137 | NSSize originalOffset = offset; 138 | CGFloat radius = shadow.shadowBlurRadius; 139 | NSRect bounds = NSInsetRect(self.bounds, -(ABS(offset.width) + radius), -(ABS(offset.height) + radius)); 140 | offset.height += bounds.size.height; 141 | shadow.shadowOffset = offset; 142 | NSAffineTransform *transform = [NSAffineTransform transform]; 143 | if ([[NSGraphicsContext currentContext] isFlipped]) 144 | [transform translateXBy:0 yBy:bounds.size.height]; 145 | else 146 | [transform translateXBy:0 yBy:-bounds.size.height]; 147 | 148 | NSBezierPath *drawingPath = [NSBezierPath bezierPathWithRect:bounds]; 149 | [drawingPath setWindingRule:NSEvenOddWindingRule]; 150 | [drawingPath appendBezierPath:self]; 151 | [drawingPath transformUsingAffineTransform:transform]; 152 | 153 | [self addClip]; 154 | [shadow set]; 155 | [[NSColor blackColor] set]; 156 | [drawingPath fill]; 157 | 158 | shadow.shadowOffset = originalOffset; 159 | 160 | [NSGraphicsContext restoreGraphicsState]; 161 | } 162 | 163 | - (void)drawBlurWithColor:(NSColor *)color radius:(CGFloat)radius 164 | { 165 | NSRect bounds = NSInsetRect(self.bounds, -radius, -radius); 166 | NSShadow *shadow = [[NSShadow alloc] init]; 167 | shadow.shadowOffset = NSMakeSize(0, bounds.size.height); 168 | shadow.shadowBlurRadius = radius; 169 | shadow.shadowColor = color; 170 | NSBezierPath *path = [self copy]; 171 | NSAffineTransform *transform = [NSAffineTransform transform]; 172 | if ([[NSGraphicsContext currentContext] isFlipped]) 173 | [transform translateXBy:0 yBy:bounds.size.height]; 174 | else 175 | [transform translateXBy:0 yBy:-bounds.size.height]; 176 | [path transformUsingAffineTransform:transform]; 177 | 178 | [NSGraphicsContext saveGraphicsState]; 179 | 180 | [shadow set]; 181 | [[NSColor blackColor] set]; 182 | NSRectClip(bounds); 183 | [path fill]; 184 | 185 | [NSGraphicsContext restoreGraphicsState]; 186 | 187 | [path release]; 188 | [shadow release]; 189 | } 190 | 191 | // Credit for the next two methods goes to Matt Gemmell 192 | - (void)strokeInside 193 | { 194 | /* Stroke within path using no additional clipping rectangle. */ 195 | [self strokeInsideWithinRect:NSZeroRect]; 196 | } 197 | 198 | - (void)strokeInsideWithinRect:(NSRect)clipRect 199 | { 200 | NSGraphicsContext *thisContext = [NSGraphicsContext currentContext]; 201 | float lineWidth = [self lineWidth]; 202 | 203 | /* Save the current graphics context. */ 204 | [thisContext saveGraphicsState]; 205 | 206 | /* Double the stroke width, since -stroke centers strokes on paths. */ 207 | [self setLineWidth:(lineWidth * 2.0)]; 208 | 209 | /* Clip drawing to this path; draw nothing outwith the path. */ 210 | [self setClip]; 211 | 212 | /* Further clip drawing to clipRect, usually the view's frame. */ 213 | if (clipRect.size.width > 0.0 && clipRect.size.height > 0.0) { 214 | [NSBezierPath clipRect:clipRect]; 215 | } 216 | 217 | /* Stroke the path. */ 218 | [self stroke]; 219 | 220 | /* Restore the previous graphics context. */ 221 | [thisContext restoreGraphicsState]; 222 | [self setLineWidth:lineWidth]; 223 | } 224 | 225 | @end 226 | -------------------------------------------------------------------------------- /Sample/Sample/ANSegmentedControl/NSShadow+MCAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSShadow+MCAdditions.h 3 | // 4 | // Created by Sean Patrick O'Brien on 4/3/08. 5 | // Copyright 2008 MolokoCacao. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface NSShadow (MCAdditions) 12 | 13 | - (id)initWithColor:(NSColor *)color offset:(NSSize)offset blurRadius:(CGFloat)blur; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Sample/Sample/ANSegmentedControl/NSShadow+MCAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSShadow+MCAdditions.m 3 | // 4 | // Created by Sean Patrick O'Brien on 4/3/08. 5 | // Copyright 2008 MolokoCacao. All rights reserved. 6 | // 7 | 8 | #import "NSShadow+MCAdditions.h" 9 | 10 | 11 | @implementation NSShadow (MCAdditions) 12 | 13 | - (id)initWithColor:(NSColor *)color offset:(NSSize)offset blurRadius:(CGFloat)blur 14 | { 15 | self = [self init]; 16 | 17 | if (self != nil) { 18 | self.shadowColor = color; 19 | self.shadowOffset = offset; 20 | self.shadowBlurRadius = blur; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Sample/Sample/INAppStoreWindow/INAppStoreWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // INAppStoreWindow.h 3 | // 4 | // Copyright 2011 Indragie Karunaratne. All rights reserved. 5 | // 6 | // Licensed under the BSD License 7 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8 | 9 | #import 10 | 11 | /** @class INTitlebarView 12 | Draws a default style Mac OS X title bar. 13 | **/ 14 | @interface INTitlebarView : NSView { 15 | 16 | } 17 | - (NSBezierPath*)clippingPathWithRect:(NSRect)aRect cornerRadius:(float)radius; 18 | @end 19 | 20 | /** @class INAppStoreWindow 21 | Creates a window similar to the Mac App Store window, with centered traffic lights and an enlarged title bar. This does not handle creating the toolbar. 22 | **/ 23 | @interface INAppStoreWindow : NSWindow { 24 | float _titleBarHeight; 25 | NSView *_titleBarView; 26 | } 27 | /** The height of the title bar. By default, this is set to the standard title bar height. **/ 28 | @property (nonatomic, assign) float titleBarHeight; 29 | /** The title bar view itself. Add subviews to this view that you want to show in the title bar (e.g. buttons, a toolbar, etc.). This view can also be set if you want to use a different styled title bar aside from the default one (textured, etc.). **/ 30 | @property (nonatomic, retain) NSView *titleBarView; 31 | @end 32 | -------------------------------------------------------------------------------- /Sample/Sample/INAppStoreWindow/INAppStoreWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // INAppStoreWindow.m 3 | // 4 | // Copyright 2011 Indragie Karunaratne. All rights reserved. 5 | // 6 | // Licensed under the BSD License 7 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8 | 9 | #import "INAppStoreWindow.h" 10 | 11 | /** ----------------------------------------- 12 | - There are 2 sets of colors, one for an active (key) state and one for an inactivate state 13 | - Each set contains 3 colors. 2 colors for the start and end of the title gradient, and another color to draw the separator line on the bottom 14 | - These colors are meant to mimic the color of the default titlebar (taken from OS X 10.6), but are subject 15 | to change at any time 16 | ----------------------------------------- **/ 17 | 18 | #define COLOR_KEY_START [NSColor colorWithDeviceRed:0.659 green:0.659 blue:0.659 alpha:1.00] 19 | #define COLOR_KEY_END [NSColor colorWithDeviceRed:0.812 green:0.812 blue:0.812 alpha:1.00] 20 | #define COLOR_KEY_BOTTOM [NSColor colorWithDeviceRed:0.318 green:0.318 blue:0.318 alpha:1.00] 21 | 22 | #define COLOR_NOTKEY_START [NSColor colorWithDeviceRed:0.851 green:0.851 blue:0.851 alpha:1.00] 23 | #define COLOR_NOTKEY_END [NSColor colorWithDeviceRed:0.929 green:0.929 blue:0.929 alpha:1.00] 24 | #define COLOR_NOTKEY_BOTTOM [NSColor colorWithDeviceRed:0.600 green:0.600 blue:0.600 alpha:1.00] 25 | 26 | /** Corner clipping radius **/ 27 | #define CORNER_CLIP_RADIUS 4.0 28 | 29 | @interface INAppStoreWindow () 30 | - (void)_doInitialWindowSetup; 31 | - (void)_createTitlebarView; 32 | - (void)_recalculateFrameForTitleBarView; 33 | - (void)_layoutTrafficLightsAndContent; 34 | - (float)_minimumTitlebarHeight; 35 | @end 36 | 37 | @implementation INTitlebarView 38 | - (void)drawRect:(NSRect)dirtyRect 39 | { 40 | BOOL key = [[self window] isKeyWindow]; 41 | NSRect drawingRect = [self bounds]; 42 | drawingRect.size.height -= 1.0; // Decrease the height by 1.0px to show the highlight line at the top 43 | 44 | NSColor *startColor = key ? COLOR_KEY_START : COLOR_NOTKEY_START; 45 | NSColor *endColor = key ? COLOR_KEY_END : COLOR_NOTKEY_END; 46 | NSBezierPath *clipPath = [self clippingPathWithRect:drawingRect cornerRadius:CORNER_CLIP_RADIUS]; 47 | [NSGraphicsContext saveGraphicsState]; 48 | [clipPath addClip]; 49 | NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:startColor endingColor:endColor]; 50 | [gradient drawInRect:drawingRect angle:90]; 51 | [gradient release]; 52 | [NSGraphicsContext restoreGraphicsState]; 53 | 54 | NSColor *bottomColor = key ? COLOR_KEY_BOTTOM : COLOR_NOTKEY_BOTTOM; 55 | NSRect bottomRect = NSMakeRect(0.0, NSMinY(drawingRect), NSWidth(drawingRect), 1.0); 56 | [bottomColor set]; 57 | NSRectFill(bottomRect); 58 | } 59 | 60 | // Uses code from NSBezierPath+PXRoundedRectangleAdditions by Andy Matuschak 61 | // 62 | 63 | - (NSBezierPath*)clippingPathWithRect:(NSRect)aRect cornerRadius:(float)radius 64 | { 65 | NSBezierPath *path = [NSBezierPath bezierPath]; 66 | NSRect rect = NSInsetRect(aRect, radius, radius); 67 | NSPoint cornerPoint = NSMakePoint(NSMinX(aRect), NSMinY(aRect)); 68 | // Create a rounded rectangle path, omitting the bottom left/right corners 69 | [path appendBezierPathWithPoints:&cornerPoint count:1]; 70 | cornerPoint = NSMakePoint(NSMaxX(aRect), NSMinY(aRect)); 71 | [path appendBezierPathWithPoints:&cornerPoint count:1]; 72 | [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMaxY(rect)) radius:radius startAngle: 0.0 endAngle: 90.0]; 73 | [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMaxY(rect)) radius:radius startAngle: 90.0 endAngle:180.0]; 74 | [path closePath]; 75 | return path; 76 | } 77 | @end 78 | 79 | @implementation INAppStoreWindow 80 | 81 | #pragma mark - 82 | #pragma mark Initialization 83 | 84 | - (id)init 85 | { 86 | if ((self = [super init])) { 87 | [self _doInitialWindowSetup]; 88 | } 89 | return self; 90 | } 91 | 92 | - (void)awakeFromNib 93 | { 94 | [super awakeFromNib]; 95 | [self _doInitialWindowSetup]; 96 | } 97 | 98 | #pragma mark - 99 | #pragma mark Memory Management 100 | 101 | - (void)dealloc 102 | { 103 | [_titleBarView release]; 104 | [super dealloc]; 105 | } 106 | 107 | #pragma mark - 108 | #pragma mark NSWindow Overrides 109 | 110 | // Disable window titles 111 | 112 | - (NSString*)title 113 | { 114 | return @""; 115 | } 116 | 117 | - (void)setTitle:(NSString *)aString 118 | { 119 | return; 120 | } 121 | 122 | #pragma mark - 123 | #pragma mark Accessors 124 | 125 | - (void)setTitleBarView:(NSView *)newTitleBarView 126 | { 127 | if ((_titleBarView != newTitleBarView) && newTitleBarView) { 128 | [_titleBarView removeFromSuperview]; 129 | [_titleBarView release]; 130 | _titleBarView = [newTitleBarView retain]; 131 | 132 | // Configure the view properties and add it as a subview of the theme frame 133 | NSView *contentView = [self contentView]; 134 | NSView *themeFrame = [contentView superview]; 135 | NSView *firstSubview = [[themeFrame subviews] objectAtIndex:0]; 136 | [_titleBarView setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)]; 137 | [self _recalculateFrameForTitleBarView]; 138 | [themeFrame addSubview:_titleBarView positioned:NSWindowBelow relativeTo:firstSubview]; 139 | [self _layoutTrafficLightsAndContent]; 140 | [self display]; 141 | } 142 | } 143 | 144 | - (NSView*)titleBarView 145 | { 146 | return _titleBarView; 147 | } 148 | 149 | - (void)setTitleBarHeight:(float)newTitleBarHeight 150 | { 151 | float minTitleHeight = [self _minimumTitlebarHeight]; 152 | if (newTitleBarHeight < minTitleHeight) { 153 | newTitleBarHeight = minTitleHeight; 154 | } 155 | _titleBarHeight = newTitleBarHeight; 156 | [self _recalculateFrameForTitleBarView]; 157 | [self _layoutTrafficLightsAndContent]; 158 | [self display]; 159 | } 160 | 161 | - (float)titleBarHeight 162 | { 163 | return _titleBarHeight; 164 | } 165 | 166 | #pragma mark - 167 | #pragma mark Private 168 | 169 | - (void)_doInitialWindowSetup 170 | { 171 | // Calculate titlebar height 172 | _titleBarHeight = [self _minimumTitlebarHeight]; 173 | [self setMovableByWindowBackground:YES]; 174 | /** ----------------------------------------- 175 | - The window automatically does layout every time its moved or resized, which means that the traffic lights and content view get reset at the original positions, so we need to put them back in place 176 | - NSWindow is hardcoded to redraw the traffic lights in a specific rect, so when they are moved down, only part of the buttons get redrawn, causing graphical artifacts. Therefore, the window must be force redrawn every time it becomes key/resigns key 177 | ----------------------------------------- **/ 178 | NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; 179 | [nc addObserver:self selector:@selector(_layoutTrafficLightsAndContent) name:NSWindowDidResizeNotification object:self]; 180 | [nc addObserver:self selector:@selector(_layoutTrafficLightsAndContent) name:NSWindowDidMoveNotification object:self]; 181 | [nc addObserver:self selector:@selector(display) name:NSWindowDidResignKeyNotification object:self]; 182 | [nc addObserver:self selector:@selector(display) name:NSWindowDidBecomeKeyNotification object:self]; 183 | [self _createTitlebarView]; 184 | [self _layoutTrafficLightsAndContent]; 185 | 186 | } 187 | 188 | - (void)_layoutTrafficLightsAndContent 189 | { 190 | NSView *contentView = [self contentView]; 191 | NSButton *close = [self standardWindowButton:NSWindowCloseButton]; 192 | NSButton *minimize = [self standardWindowButton:NSWindowMiniaturizeButton]; 193 | NSButton *zoom = [self standardWindowButton:NSWindowZoomButton]; 194 | 195 | // Set the frame of the window buttons 196 | NSRect closeFrame = [close frame]; 197 | NSRect minimizeFrame = [minimize frame]; 198 | NSRect zoomFrame = [zoom frame]; 199 | float buttonOrigin = floor(NSMidY([_titleBarView frame]) - (closeFrame.size.height / 2.0)); 200 | closeFrame.origin.y = buttonOrigin; 201 | minimizeFrame.origin.y = buttonOrigin; 202 | zoomFrame.origin.y = buttonOrigin; 203 | [close setFrame:closeFrame]; 204 | [minimize setFrame:minimizeFrame]; 205 | [zoom setFrame:zoomFrame]; 206 | 207 | // Reposition the content view 208 | NSRect windowFrame = [self frame]; 209 | NSRect newFrame = [contentView frame]; 210 | float titleHeight = windowFrame.size.height - newFrame.size.height; 211 | float extraHeight = _titleBarHeight - titleHeight; 212 | newFrame.size.height -= extraHeight; 213 | [contentView setFrame:newFrame]; 214 | } 215 | 216 | - (void)_createTitlebarView 217 | { 218 | // Create the title bar view 219 | self.titleBarView = [[[INTitlebarView alloc] initWithFrame:NSZeroRect] autorelease]; 220 | } 221 | 222 | - (void)_recalculateFrameForTitleBarView 223 | { 224 | NSView *contentView = [self contentView]; 225 | NSView *themeFrame = [contentView superview]; 226 | NSRect themeFrameRect = [themeFrame frame]; 227 | NSRect titleFrame = NSMakeRect(0.0, NSMaxY(themeFrameRect) - _titleBarHeight, themeFrameRect.size.width, _titleBarHeight); 228 | [_titleBarView setFrame:titleFrame]; 229 | } 230 | 231 | - (float)_minimumTitlebarHeight 232 | { 233 | static float minTitleHeight = 0.0; 234 | if (!minTitleHeight) { 235 | NSRect frameRect = [self frame]; 236 | NSRect contentRect = [self contentRectForFrameRect:frameRect]; 237 | minTitleHeight = (frameRect.size.height - contentRect.size.height); 238 | } 239 | return minTitleHeight; 240 | } 241 | @end 242 | -------------------------------------------------------------------------------- /Sample/Sample/Resources/FilterNone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/decors/ANSegmentedControl/96844ff87246b9d9fade1fce90392aef1f5aa7f0/Sample/Sample/Resources/FilterNone.png -------------------------------------------------------------------------------- /Sample/Sample/Resources/FilterStarred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/decors/ANSegmentedControl/96844ff87246b9d9fade1fce90392aef1f5aa7f0/Sample/Sample/Resources/FilterStarred.png -------------------------------------------------------------------------------- /Sample/Sample/Resources/FilterUnread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/decors/ANSegmentedControl/96844ff87246b9d9fade1fce90392aef1f5aa7f0/Sample/Sample/Resources/FilterUnread.png -------------------------------------------------------------------------------- /Sample/Sample/Sample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.decors1215.${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 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Sample/Sample/Sample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Sample' target in the 'Sample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Sample/Sample/SampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SampleAppDelegate.h 3 | // Sample 4 | // 5 | // Created by Decors on 11/04/25. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ANSegmentedControl.h" 11 | 12 | @interface SampleAppDelegate : NSObject { 13 | @private 14 | NSWindow *window; 15 | IBOutlet NSView *titleBar; 16 | ANSegmentedControl *segment; 17 | } 18 | 19 | @property (assign) IBOutlet NSWindow *window; 20 | @property (assign) IBOutlet ANSegmentedControl *segment; 21 | 22 | - (IBAction)clickButton1:(id)sender; 23 | - (IBAction)clickButton2:(id)sender; 24 | - (IBAction)clickButton3:(id)sender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Sample/Sample/SampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SampleAppDelegate.m 3 | // Sample 4 | // 5 | // Created by Decors on 11/04/25. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "SampleAppDelegate.h" 10 | #import "INAppStoreWindow.h" 11 | 12 | @implementation SampleAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize segment; 16 | 17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 18 | { 19 | INAppStoreWindow *aWindow = (INAppStoreWindow *)self.window; 20 | aWindow.titleBarHeight = 40.0; 21 | [aWindow.titleBarView addSubview:titleBar]; 22 | } 23 | 24 | - (IBAction)clickButton1:(id)sender 25 | { 26 | [segment setSelectedSegment:0]; 27 | } 28 | 29 | - (IBAction)clickButton2:(id)sender 30 | { 31 | [segment setSelectedSegment:1]; 32 | } 33 | 34 | - (IBAction)clickButton3:(id)sender 35 | { 36 | [segment setSelectedSegment:2]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Sample/Sample/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 | -------------------------------------------------------------------------------- /Sample/Sample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Sample/Sample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Sample 4 | // 5 | // Created by Decors on 11/04/25. 6 | // Copyright 2011 __MyCompanyName__. 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 | --------------------------------------------------------------------------------