Skip to content
Browse files

Cleanup. Edits. File organization.

  • Loading branch information...
1 parent a8ce2cf commit 5830a049b70a3b6e4cd916e12b3a9c93fac19e5b @joericioppo committed Jan 16, 2011
View
3 MyStyledViewAppDelegate.h → Controller/MyStyledViewAppDelegate.h
@@ -3,10 +3,9 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/9/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
-#import <Cocoa/Cocoa.h>
@class MyWindowController;
View
6 MyStyledViewAppDelegate.m → Controller/MyStyledViewAppDelegate.m
@@ -3,19 +3,21 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/9/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
#import "MyStyledViewAppDelegate.h"
#import "MyWindowController.h"
+static NSString * const kMyWindowXibName = @"MyWindow";
+
@implementation MyStyledViewAppDelegate
@synthesize windowController;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
- self.windowController = [[[MyWindowController alloc] initWithWindowNibName:@"MyWindow"] autorelease];
+ self.windowController = [[[MyWindowController alloc] initWithWindowNibName:kMyWindowXibName] autorelease];
[self.windowController showWindow:self];
}
View
3 MyWindowController.h → Controller/MyWindowController.h
@@ -3,10 +3,9 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/10/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
-#import <Cocoa/Cocoa.h>
@class MyStyledView;
View
6 MyWindowController.m → Controller/MyWindowController.m
@@ -3,7 +3,7 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/10/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
#import "MyWindowController.h"
@@ -39,9 +39,9 @@ - (void)awakeFromNib {
self.background.bottomEdgeColor = [NSColor colorWithCalibratedWhite:0.27 alpha:1.0];
//--
- self.popUpThing.backgroundImage = [NSImage imageNamed:@"dark_popup.png"];
+ self.popUpThing.backgroundImage = [NSImage imageNamed:@"dark_popup.png"]; // image is copywrite, because it's not pixel correct. draw your own mofo.
self.popUpThing.leftCapWidth = 80.0;
- self.popUpThing.topCapHeight = 55.0;
+ self.popUpThing.topCapHeight = 60.0;
//--
self.toolBar.gradient = [NSGradient gradientWithStartingColor:[NSColor colorWithCalibratedHue:0.625 saturation:0.0 brightness:0.7 alpha:1.0]
View
118 MyStyledView.xcodeproj/project.pbxproj
@@ -8,15 +8,15 @@
/* Begin PBXBuildFile section */
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
- 256AC3DA0F4B6AC300CF3369 /* MyStyledViewAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* MyStyledViewAppDelegate.m */; };
- 5D17FCE012DBABC200F1F6D3 /* NSGraphicsContext+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D17FCDF12DBABC200F1F6D3 /* NSGraphicsContext+Additions.m */; };
- 5DE7986812DC06DC006A4C0A /* NSImage+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE7986712DC06DC006A4C0A /* NSImage+Additions.m */; };
- 5DE7992A12DC3EDB006A4C0A /* dark_popup.png in Resources */ = {isa = PBXBuildFile; fileRef = 5DE7992912DC3EDB006A4C0A /* dark_popup.png */; };
- 5DF8E71512DAEF99001A7779 /* MyStyledView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF8E71412DAEF99001A7779 /* MyStyledView.m */; };
- 5DF8E72512DAF275001A7779 /* NSGradient+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF8E72412DAF275001A7779 /* NSGradient+Additions.m */; };
- 5DF8E72812DAF417001A7779 /* NSBezierPath+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF8E72712DAF417001A7779 /* NSBezierPath+Additions.m */; };
- 5DF8E73712DAF66D001A7779 /* NSShadow+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF8E73612DAF66D001A7779 /* NSShadow+Additions.m */; };
- 5DF8E73E12DAF7A1001A7779 /* MyWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF8E73D12DAF7A1001A7779 /* MyWindowController.m */; };
+ 5DE79C1912E3DC56006A4C0A /* MyStyledView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE79C1812E3DC56006A4C0A /* MyStyledView.m */; };
+ 5DE79C2412E3DC69006A4C0A /* NSBezierPath+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE79C1B12E3DC69006A4C0A /* NSBezierPath+Additions.m */; };
+ 5DE79C2512E3DC69006A4C0A /* NSGradient+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE79C1D12E3DC69006A4C0A /* NSGradient+Additions.m */; };
+ 5DE79C2612E3DC69006A4C0A /* NSGraphicsContext+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE79C1F12E3DC69006A4C0A /* NSGraphicsContext+Additions.m */; };
+ 5DE79C2712E3DC69006A4C0A /* NSImage+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE79C2112E3DC69006A4C0A /* NSImage+Additions.m */; };
+ 5DE79C2812E3DC69006A4C0A /* NSShadow+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE79C2312E3DC69006A4C0A /* NSShadow+Additions.m */; };
+ 5DE79C3912E3DC8E006A4C0A /* MyStyledViewAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE79C3612E3DC8E006A4C0A /* MyStyledViewAppDelegate.m */; };
+ 5DE79C3A12E3DC8E006A4C0A /* MyWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE79C3812E3DC8E006A4C0A /* MyWindowController.m */; };
+ 5DE79E1012E42259006A4C0A /* dark_popup.png in Resources */ = {isa = PBXBuildFile; fileRef = 5DE79E0F12E42259006A4C0A /* dark_popup.png */; };
5DF8E74012DAF7D0001A7779 /* MyWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DF8E73F12DAF7D0001A7779 /* MyWindow.xib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
@@ -28,27 +28,27 @@
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
- 256AC3D80F4B6AC300CF3369 /* MyStyledViewAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyStyledViewAppDelegate.h; sourceTree = "<group>"; };
- 256AC3D90F4B6AC300CF3369 /* MyStyledViewAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyStyledViewAppDelegate.m; sourceTree = "<group>"; };
256AC3F00F4B6AF500CF3369 /* MyStyledView_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyStyledView_Prefix.pch; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
- 5D17FCDE12DBABC200F1F6D3 /* NSGraphicsContext+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSGraphicsContext+Additions.h"; sourceTree = "<group>"; };
- 5D17FCDF12DBABC200F1F6D3 /* NSGraphicsContext+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSGraphicsContext+Additions.m"; sourceTree = "<group>"; };
- 5DE7986612DC06DC006A4C0A /* NSImage+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+Additions.h"; sourceTree = "<group>"; };
- 5DE7986712DC06DC006A4C0A /* NSImage+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSImage+Additions.m"; sourceTree = "<group>"; };
- 5DE7992912DC3EDB006A4C0A /* dark_popup.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dark_popup.png; sourceTree = "<group>"; };
- 5DF8E71312DAEF99001A7779 /* MyStyledView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyStyledView.h; sourceTree = "<group>"; };
- 5DF8E71412DAEF99001A7779 /* MyStyledView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyStyledView.m; sourceTree = "<group>"; };
- 5DF8E72312DAF275001A7779 /* NSGradient+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSGradient+Additions.h"; sourceTree = "<group>"; };
- 5DF8E72412DAF275001A7779 /* NSGradient+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSGradient+Additions.m"; sourceTree = "<group>"; };
- 5DF8E72612DAF417001A7779 /* NSBezierPath+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBezierPath+Additions.h"; sourceTree = "<group>"; };
- 5DF8E72712DAF417001A7779 /* NSBezierPath+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBezierPath+Additions.m"; sourceTree = "<group>"; };
- 5DF8E73512DAF66D001A7779 /* NSShadow+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSShadow+Additions.h"; sourceTree = "<group>"; };
- 5DF8E73612DAF66D001A7779 /* NSShadow+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSShadow+Additions.m"; sourceTree = "<group>"; };
- 5DF8E73C12DAF7A1001A7779 /* MyWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyWindowController.h; sourceTree = "<group>"; };
- 5DF8E73D12DAF7A1001A7779 /* MyWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyWindowController.m; sourceTree = "<group>"; };
+ 5DE79C1712E3DC56006A4C0A /* MyStyledView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MyStyledView.h; path = StyledView/MyStyledView.h; sourceTree = "<group>"; };
+ 5DE79C1812E3DC56006A4C0A /* MyStyledView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MyStyledView.m; path = StyledView/MyStyledView.m; sourceTree = "<group>"; };
+ 5DE79C1A12E3DC69006A4C0A /* NSBezierPath+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSBezierPath+Additions.h"; path = "StyledView/Categories/NSBezierPath+Additions.h"; sourceTree = "<group>"; };
+ 5DE79C1B12E3DC69006A4C0A /* NSBezierPath+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSBezierPath+Additions.m"; path = "StyledView/Categories/NSBezierPath+Additions.m"; sourceTree = "<group>"; };
+ 5DE79C1C12E3DC69006A4C0A /* NSGradient+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSGradient+Additions.h"; path = "StyledView/Categories/NSGradient+Additions.h"; sourceTree = "<group>"; };
+ 5DE79C1D12E3DC69006A4C0A /* NSGradient+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSGradient+Additions.m"; path = "StyledView/Categories/NSGradient+Additions.m"; sourceTree = "<group>"; };
+ 5DE79C1E12E3DC69006A4C0A /* NSGraphicsContext+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSGraphicsContext+Additions.h"; path = "StyledView/Categories/NSGraphicsContext+Additions.h"; sourceTree = "<group>"; };
+ 5DE79C1F12E3DC69006A4C0A /* NSGraphicsContext+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSGraphicsContext+Additions.m"; path = "StyledView/Categories/NSGraphicsContext+Additions.m"; sourceTree = "<group>"; };
+ 5DE79C2012E3DC69006A4C0A /* NSImage+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSImage+Additions.h"; path = "StyledView/Categories/NSImage+Additions.h"; sourceTree = "<group>"; };
+ 5DE79C2112E3DC69006A4C0A /* NSImage+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSImage+Additions.m"; path = "StyledView/Categories/NSImage+Additions.m"; sourceTree = "<group>"; };
+ 5DE79C2212E3DC69006A4C0A /* NSShadow+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSShadow+Additions.h"; path = "StyledView/Categories/NSShadow+Additions.h"; sourceTree = "<group>"; };
+ 5DE79C2312E3DC69006A4C0A /* NSShadow+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSShadow+Additions.m"; path = "StyledView/Categories/NSShadow+Additions.m"; sourceTree = "<group>"; };
+ 5DE79C3512E3DC8E006A4C0A /* MyStyledViewAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MyStyledViewAppDelegate.h; path = Controller/MyStyledViewAppDelegate.h; sourceTree = "<group>"; };
+ 5DE79C3612E3DC8E006A4C0A /* MyStyledViewAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MyStyledViewAppDelegate.m; path = Controller/MyStyledViewAppDelegate.m; sourceTree = "<group>"; };
+ 5DE79C3712E3DC8E006A4C0A /* MyWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MyWindowController.h; path = Controller/MyWindowController.h; sourceTree = "<group>"; };
+ 5DE79C3812E3DC8E006A4C0A /* MyWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MyWindowController.m; path = Controller/MyWindowController.m; sourceTree = "<group>"; };
+ 5DE79E0F12E42259006A4C0A /* dark_popup.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dark_popup.png; sourceTree = "<group>"; };
5DF8E73F12DAF7D0001A7779 /* MyWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyWindow.xib; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* MyStyledView-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MyStyledView-Info.plist"; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* MyStyledView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyStyledView.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -66,17 +66,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 080E96DDFE201D6D7F000001 /* Classes */ = {
+ 080E96DDFE201D6D7F000001 /* Controller */ = {
isa = PBXGroup;
children = (
- 256AC3D80F4B6AC300CF3369 /* MyStyledViewAppDelegate.h */,
- 256AC3D90F4B6AC300CF3369 /* MyStyledViewAppDelegate.m */,
- 5DF8E73C12DAF7A1001A7779 /* MyWindowController.h */,
- 5DF8E73D12DAF7A1001A7779 /* MyWindowController.m */,
- 5DF8E71312DAEF99001A7779 /* MyStyledView.h */,
- 5DF8E71412DAEF99001A7779 /* MyStyledView.m */,
+ 5DE79C3512E3DC8E006A4C0A /* MyStyledViewAppDelegate.h */,
+ 5DE79C3612E3DC8E006A4C0A /* MyStyledViewAppDelegate.m */,
+ 5DE79C3712E3DC8E006A4C0A /* MyWindowController.h */,
+ 5DE79C3812E3DC8E006A4C0A /* MyWindowController.m */,
);
- name = Classes;
+ name = Controller;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
@@ -108,7 +106,8 @@
29B97314FDCFA39411CA2CEA /* MyStyledView */ = {
isa = PBXGroup;
children = (
- 080E96DDFE201D6D7F000001 /* Classes */,
+ 080E96DDFE201D6D7F000001 /* Controller */,
+ 5DE79C2912E3DC79006A4C0A /* Styled View */,
5DF8E73912DAF73E001A7779 /* Categories */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
@@ -134,7 +133,7 @@
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
5DF8E73F12DAF7D0001A7779 /* MyWindow.xib */,
- 5DE7992912DC3EDB006A4C0A /* dark_popup.png */,
+ 5DE79E0F12E42259006A4C0A /* dark_popup.png */,
);
name = Resources;
sourceTree = "<group>";
@@ -148,19 +147,28 @@
name = Frameworks;
sourceTree = "<group>";
};
+ 5DE79C2912E3DC79006A4C0A /* Styled View */ = {
+ isa = PBXGroup;
+ children = (
+ 5DE79C1712E3DC56006A4C0A /* MyStyledView.h */,
+ 5DE79C1812E3DC56006A4C0A /* MyStyledView.m */,
+ );
+ name = "Styled View";
+ sourceTree = "<group>";
+ };
5DF8E73912DAF73E001A7779 /* Categories */ = {
isa = PBXGroup;
children = (
- 5DF8E72312DAF275001A7779 /* NSGradient+Additions.h */,
- 5DF8E72412DAF275001A7779 /* NSGradient+Additions.m */,
- 5DF8E73512DAF66D001A7779 /* NSShadow+Additions.h */,
- 5DF8E73612DAF66D001A7779 /* NSShadow+Additions.m */,
- 5DF8E72612DAF417001A7779 /* NSBezierPath+Additions.h */,
- 5DF8E72712DAF417001A7779 /* NSBezierPath+Additions.m */,
- 5DE7986612DC06DC006A4C0A /* NSImage+Additions.h */,
- 5DE7986712DC06DC006A4C0A /* NSImage+Additions.m */,
- 5D17FCDE12DBABC200F1F6D3 /* NSGraphicsContext+Additions.h */,
- 5D17FCDF12DBABC200F1F6D3 /* NSGraphicsContext+Additions.m */,
+ 5DE79C1A12E3DC69006A4C0A /* NSBezierPath+Additions.h */,
+ 5DE79C1B12E3DC69006A4C0A /* NSBezierPath+Additions.m */,
+ 5DE79C1C12E3DC69006A4C0A /* NSGradient+Additions.h */,
+ 5DE79C1D12E3DC69006A4C0A /* NSGradient+Additions.m */,
+ 5DE79C1E12E3DC69006A4C0A /* NSGraphicsContext+Additions.h */,
+ 5DE79C1F12E3DC69006A4C0A /* NSGraphicsContext+Additions.m */,
+ 5DE79C2012E3DC69006A4C0A /* NSImage+Additions.h */,
+ 5DE79C2112E3DC69006A4C0A /* NSImage+Additions.m */,
+ 5DE79C2212E3DC69006A4C0A /* NSShadow+Additions.h */,
+ 5DE79C2312E3DC69006A4C0A /* NSShadow+Additions.m */,
);
name = Categories;
sourceTree = "<group>";
@@ -218,7 +226,7 @@
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
5DF8E74012DAF7D0001A7779 /* MyWindow.xib in Resources */,
- 5DE7992A12DC3EDB006A4C0A /* dark_popup.png in Resources */,
+ 5DE79E1012E42259006A4C0A /* dark_popup.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -230,14 +238,14 @@
buildActionMask = 2147483647;
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
- 256AC3DA0F4B6AC300CF3369 /* MyStyledViewAppDelegate.m in Sources */,
- 5DF8E71512DAEF99001A7779 /* MyStyledView.m in Sources */,
- 5DF8E72512DAF275001A7779 /* NSGradient+Additions.m in Sources */,
- 5DF8E72812DAF417001A7779 /* NSBezierPath+Additions.m in Sources */,
- 5DF8E73712DAF66D001A7779 /* NSShadow+Additions.m in Sources */,
- 5DF8E73E12DAF7A1001A7779 /* MyWindowController.m in Sources */,
- 5D17FCE012DBABC200F1F6D3 /* NSGraphicsContext+Additions.m in Sources */,
- 5DE7986812DC06DC006A4C0A /* NSImage+Additions.m in Sources */,
+ 5DE79C1912E3DC56006A4C0A /* MyStyledView.m in Sources */,
+ 5DE79C2412E3DC69006A4C0A /* NSBezierPath+Additions.m in Sources */,
+ 5DE79C2512E3DC69006A4C0A /* NSGradient+Additions.m in Sources */,
+ 5DE79C2612E3DC69006A4C0A /* NSGraphicsContext+Additions.m in Sources */,
+ 5DE79C2712E3DC69006A4C0A /* NSImage+Additions.m in Sources */,
+ 5DE79C2812E3DC69006A4C0A /* NSShadow+Additions.m in Sources */,
+ 5DE79C3912E3DC8E006A4C0A /* MyStyledViewAppDelegate.m in Sources */,
+ 5DE79C3A12E3DC8E006A4C0A /* MyWindowController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
2 NSBezierPath+Additions.h → ...dView/Categories/NSBezierPath+Additions.h
@@ -2,7 +2,7 @@
// NSBezierPath+Additions.h
// MyStyledView
//
-// http://www.seanpatrickobrien.com/journal/posts/3
+// http://www.seanpatrickobrien.com/journal/posts/3
//
View
4 NSBezierPath+Additions.m → ...dView/Categories/NSBezierPath+Additions.m
@@ -2,7 +2,7 @@
// NSBezierPath+Additions.m
// MyStyledView
//
-// http://www.seanpatrickobrien.com/journal/posts/3
+// http://www.seanpatrickobrien.com/journal/posts/3
//
#import "NSBezierPath+Additions.h"
@@ -22,7 +22,7 @@ - (void)fillWithInnerShadow:(NSShadow *)shadow {
offset.height += bounds.size.height;
shadow.shadowOffset = offset;
NSAffineTransform *transform = [NSAffineTransform transform];
- if ([[NSGraphicsContext currentContext] isFlipped])
+ if ([currentContext isFlipped])
[transform translateXBy:0 yBy:bounds.size.height];
else
[transform translateXBy:0 yBy:-bounds.size.height];
View
2 NSGradient+Additions.h → StyledView/Categories/NSGradient+Additions.h
@@ -3,7 +3,7 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/9/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
View
2 NSGradient+Additions.m → StyledView/Categories/NSGradient+Additions.m
@@ -3,7 +3,7 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/9/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
#import "NSGradient+Additions.h"
View
4 NSGraphicsContext+Additions.h → .../Categories/NSGraphicsContext+Additions.h
@@ -2,11 +2,9 @@
// NSGraphicsContext+Additions.h
// MyStyledView
//
-// http://jonathandann.wordpress.com/2009/09/09/forget-the-code/
+// http://jonathandann.wordpress.com/2009/09/09/forget-the-code/
//
-#import <Cocoa/Cocoa.h>
-
@interface NSGraphicsContext (Additions)
View
2 NSGraphicsContext+Additions.m → .../Categories/NSGraphicsContext+Additions.m
@@ -2,7 +2,7 @@
// NSGraphicsContext+Additions.m
// MyStyledView
//
-// http://jonathandann.wordpress.com/2009/09/09/forget-the-code/
+// http://jonathandann.wordpress.com/2009/09/09/forget-the-code/
//
#import "NSGraphicsContext+Additions.h"
View
6 NSImage+Additions.h → StyledView/Categories/NSImage+Additions.h
@@ -3,15 +3,13 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/10/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
-#import <Cocoa/Cocoa.h>
-
@interface NSImage (Additions)
-- (void)drawInRect:(NSRect)rect withLeftCapWidth:(CGFloat)leftCap topCapHeight:(CGFloat)topCap;
+- (void)drawInRect:(NSRect)rect withLeftCapWidth:(CGFloat)leftCapWidth topCapHeight:(CGFloat)topCapHeight;
- (void)drawInRect:(NSRect)rect withContentStretch:(NSRect)contentStretch; // 1.0 == 1pt
@end
View
13 NSImage+Additions.m → StyledView/Categories/NSImage+Additions.m
@@ -3,17 +3,17 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/10/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
#import "NSImage+Additions.h"
#import "NSGraphicsContext+Additions.h"
@implementation NSImage (Additions)
-- (void)drawInRect:(NSRect)rect withLeftCapWidth:(CGFloat)leftCap topCapHeight:(CGFloat)topCap {
+- (void)drawInRect:(NSRect)rect withLeftCapWidth:(CGFloat)leftCapWidth topCapHeight:(CGFloat)topCapHeight {
- NSRect contentStretch = NSMakeRect(leftCap, rect.size.height - topCap, 1.0, 1.0);
+ NSRect contentStretch = NSMakeRect(leftCapWidth, rect.size.height - topCapHeight, 1.0, 1.0);
[self drawInRect:rect withContentStretch:contentStretch];
}
@@ -22,8 +22,7 @@ - (void)drawInRect:(NSRect)rect withContentStretch:(NSRect)contentStretch {
NSSize imageSize = self.size;
if (imageSize.width > rect.size.width || imageSize.height > rect.size.height || contentStretch.origin.x == NSNotFound) {
- NSRect imageRect = NSMakeRect(0.0, 0.0, imageSize.width, imageSize.height);
- [self drawInRect:rect fromRect:imageRect operation:NSCompositeSourceOver fraction:1.0];
+ [self drawInRect:rect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
return;
}
@@ -39,11 +38,11 @@ - (void)drawInRect:(NSRect)rect withContentStretch:(NSRect)contentStretch {
CGFloat topSliceSourceOriginY = imageSize.height - (imageSize.height - NSMaxY(contentStretch));
CGFloat topSliceAdjustedOriginY = NSMinY(contentStretch) + middleFillHeight;
- CGFloat topSliceHeight = self.size.height - topSliceSourceOriginY;
+ CGFloat topSliceHeight = imageSize.height - topSliceSourceOriginY;
CGFloat rightSliceSourceOriginX = NSMaxX(contentStretch);
CGFloat rightSliceAdjustedOriginX = NSMinX(contentStretch) + middleFillWidth;
- CGFloat rightSliceWidth = self.size.width - rightSliceSourceOriginX;
+ CGFloat rightSliceWidth = imageSize.width - rightSliceSourceOriginX;
NSRect bottomLeftCornerRect = NSMakeRect(0.0, 0.0, contentStretch.origin.x, contentStretch.origin.y);
[self drawInRect:bottomLeftCornerRect fromRect:bottomLeftCornerRect operation:NSCompositeSourceOver fraction:1.0];
View
0 NSShadow+Additions.h → StyledView/Categories/NSShadow+Additions.h
File renamed without changes.
View
0 NSShadow+Additions.m → StyledView/Categories/NSShadow+Additions.m
File renamed without changes.
View
6 MyStyledView.h → StyledView/MyStyledView.h
@@ -3,11 +3,9 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/9/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
-#import <Cocoa/Cocoa.h>
-
@interface MyStyledView : NSView {}
@@ -28,8 +26,8 @@
@property (nonatomic, retain) NSColor *bottomHighlightColor;
@property (nonatomic, retain) NSColor *bottomEdgeColor;
-@property (nonatomic, retain) NSGradient *rightEdgeGradient;
@property (nonatomic, retain) NSGradient *leftEdgeGradient;
+@property (nonatomic, retain) NSGradient *rightEdgeGradient;
@property (nonatomic, retain) NSShadow *innerShadow;
@property (nonatomic, retain) NSShadow *innerGlow;
View
56 MyStyledView.m → StyledView/MyStyledView.m
@@ -3,7 +3,7 @@
// MyStyledView
//
// Created by Joe Ricioppo on 1/9/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
#import "MyStyledView.h"
@@ -26,8 +26,8 @@ @implementation MyStyledView
@synthesize topHighlightColor;
@synthesize bottomHighlightColor;
@synthesize bottomEdgeColor;
-@synthesize rightEdgeGradient;
@synthesize leftEdgeGradient;
+@synthesize rightEdgeGradient;
@synthesize innerShadow;
@synthesize innerGlow;
@@ -44,8 +44,8 @@ - (void)dealloc {
self.topHighlightColor = nil;
self.bottomHighlightColor = nil;
self.bottomEdgeColor = nil;
+ self.leftEdgeGradient = nil;
self.rightEdgeGradient = nil;
- self.leftEdgeGradient = nil;
self.innerShadow = nil;
self.innerGlow = nil;
[super dealloc];
@@ -73,22 +73,17 @@ - (void)drawRect:(NSRect)dirtyRect {
if (self.leftCapWidth != NSNotFound || self.topCapHeight != NSNotFound) {
[backgroundImageToDraw drawInRect:rect withLeftCapWidth:self.leftCapWidth topCapHeight:self.topCapHeight];
} else {
- NSRect imageRect = NSMakeRect(0.0, 0.0, backgroundImageToDraw.size.width, backgroundImageToDraw.size.height);
- [backgroundImageToDraw drawInRect:rect fromRect:imageRect operation:NSCompositeSourceOver fraction:1.0];
+ [backgroundImageToDraw drawInRect:rect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
}
}
- if (self.innerShadow) {
- NSBezierPath *innerShadowPath = [NSBezierPath bezierPathWithRect:rect];
- [innerShadowPath fillWithInnerShadow:self.innerShadow];
- }
-
- if (self.innerGlow) {
- NSBezierPath *innerGlowPath = [NSBezierPath bezierPathWithRect:rect];
- [innerGlowPath fillWithInnerShadow:self.innerGlow];
- }
+ CGFloat topInset = 0.0;
+ CGFloat bottomInset = 0.0;
+ CGFloat leftInset = 0.0;
+ CGFloat rightInset = 0.0;
if (self.topEdgeColor) {
+ topInset += 1.0;
NSBezierPath *topHighlightPath = [NSBezierPath bezierPath];
[topHighlightPath setLineWidth:0.0];
[topHighlightPath moveToPoint:NSPointFromCGPoint(CGPointMake(rect.origin.x, NSMaxY(rect) -0.5))];
@@ -100,6 +95,7 @@ - (void)drawRect:(NSRect)dirtyRect {
}
if (self.topHighlightColor) {
+ topInset += 1.0;
NSBezierPath *topHighlightPath = [NSBezierPath bezierPath];
[topHighlightPath setLineWidth:0.0];
[topHighlightPath moveToPoint:NSPointFromCGPoint(CGPointMake(rect.origin.x, NSMaxY(rect) -1.5))];
@@ -111,6 +107,7 @@ - (void)drawRect:(NSRect)dirtyRect {
}
if (self.bottomHighlightColor) {
+ bottomInset += 1.0;
NSBezierPath *bottomHighlightPath = [NSBezierPath bezierPath];
[bottomHighlightPath setLineWidth:1.0];
[bottomHighlightPath moveToPoint:NSPointFromCGPoint(CGPointMake(rect.origin.x, rect.origin.y + 1.5))];
@@ -122,6 +119,7 @@ - (void)drawRect:(NSRect)dirtyRect {
}
if (self.bottomEdgeColor) {
+ bottomInset += 1.0;
NSBezierPath *bottomEdgePath = [NSBezierPath bezierPath];
[bottomEdgePath setLineWidth:1.0];
[bottomEdgePath moveToPoint:NSPointFromCGPoint(CGPointMake(rect.origin.x, rect.origin.y + 0.5))];
@@ -132,15 +130,37 @@ - (void)drawRect:(NSRect)dirtyRect {
[bottomEdgePath stroke];
}
+ if (self.leftEdgeGradient) {
+ leftInset += 1.0;
+ NSRect edgeRect = NSMakeRect(0.0, 0.0, 1.0, NSMaxY(rect));
+ edgeRect.origin.y += bottomInset;
+ edgeRect.size.height -= (bottomInset + topInset);
+ [self.leftEdgeGradient drawInRect:edgeRect angle:self.isFlipped ? 90 : -90];
+ }
+
if (self.rightEdgeGradient) {
- NSRect edgeRect = NSMakeRect((NSMaxX(rect) - 1.5), 0.0, 1.0, NSMaxY(rect));
+ rightInset += 1.0;
+ NSRect edgeRect = NSMakeRect((NSMaxX(rect) - 1.0), 0.0, 1.0, NSMaxY(rect));
+ edgeRect.origin.y += bottomInset;
+ edgeRect.size.height -= (bottomInset + topInset);
[self.rightEdgeGradient drawInRect:edgeRect angle:self.isFlipped ? 90 : -90];
}
- if (self.leftEdgeGradient) {
- NSRect edgeRect = NSMakeRect(0.0, 0.0, 1.0, NSMaxY(rect));
- [self.leftEdgeGradient drawInRect:edgeRect angle:self.isFlipped ? 90 : -90];
+ CGRect shadowRect = rect;
+ shadowRect.origin.x += leftInset;
+ shadowRect.size.width -= (leftInset + rightInset);
+ shadowRect.origin.y += bottomInset;
+ shadowRect.size.height -= (bottomInset + topInset);
+
+ if (self.innerShadow) {
+ NSBezierPath *innerShadowPath = [NSBezierPath bezierPathWithRect:shadowRect];
+ [innerShadowPath fillWithInnerShadow:self.innerShadow];
}
+
+ if (self.innerGlow) {
+ NSBezierPath *innerGlowPath = [NSBezierPath bezierPathWithRect:shadowRect];
+ [innerGlowPath fillWithInnerShadow:self.innerGlow];
+ }
}
@end
View
BIN dark_popup.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 main.m
@@ -3,7 +3,7 @@
// MyStyledView
//
// Created by notebook on 1/9/11.
-// Copyright 2011 __MyCompanyName__. All rights reserved.
+// BSD License
//
#import <Cocoa/Cocoa.h>

0 comments on commit 5830a04

Please sign in to comment.
Something went wrong with that request. Please try again.