Skip to content

Commit

Permalink
Some very basic UI for the application.
Browse files Browse the repository at this point in the history
  • Loading branch information
sammcd committed Jan 7, 2010
1 parent eb4a227 commit 506a066
Show file tree
Hide file tree
Showing 10 changed files with 875 additions and 93 deletions.
2 changes: 1 addition & 1 deletion BusinessTimeAppDelegate.h → BTBusinessTimeAppDelegate.h
Expand Up @@ -8,7 +8,7 @@

#import <Cocoa/Cocoa.h>

@interface BusinessTimeAppDelegate : NSObject <NSApplicationDelegate> {
@interface BTBusinessTimeAppDelegate : NSObject <NSApplicationDelegate> {
NSWindow *window;
}

Expand Down
27 changes: 27 additions & 0 deletions BTBusinessTimeAppDelegate.m
@@ -0,0 +1,27 @@
//
// BusinessTimeAppDelegate.m
// BusinessTime
//
// Created by Sam Mcdonald on 1/7/10.
// Copyright 2010 141312 LLC. All rights reserved.
//

#import "BTBusinessTimeAppDelegate.h"
#import "BTMainWindowController.h"

@implementation BTBusinessTimeAppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
}


- (void)awakeFromNib {
// This nib has awoken lets create our main window.
BTMainWindowController* mainWindowController = [[BTMainWindowController alloc] initWithWindowNibName:@"MainWindow"];
[[mainWindowController window] makeKeyAndOrderFront:self];
}

@end
19 changes: 19 additions & 0 deletions BTMainWindowController.h
@@ -0,0 +1,19 @@
//
// MainWindowController.h
// BusinessTime
//
// Created by Sam Mcdonald on 1/7/10.
// Copyright 2010 141312 LLC. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface BTMainWindowController : NSWindowController {


}

- (IBAction)toggleBusinessTime:(id)sender;

@end
22 changes: 22 additions & 0 deletions BTMainWindowController.m
@@ -0,0 +1,22 @@
//
// MainWindowController.m
// BusinessTime
//
// Created by Sam Mcdonald on 1/7/10.
// Copyright 2010 141312 LLC. All rights reserved.
//

#import "BTMainWindowController.h"
#import "BTStatusWindow.h"


@implementation BTMainWindowController

- (IBAction)toggleBusinessTime:(id)sender {
BTStatusWindow* windowController = [[BTStatusWindow alloc] init];
[[windowController window] makeKeyAndOrderFront:self];

}


@end
18 changes: 18 additions & 0 deletions BTStatusWindow.h
@@ -0,0 +1,18 @@
//
// untitled.h
// BusinessTime
//
// Created by Sam Mcdonald on 1/7/10.
// Copyright 2010 141312 LLC. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface BTStatusWindow : NSWindowController {

}

- (id)init;

@end
38 changes: 38 additions & 0 deletions BTStatusWindow.m
@@ -0,0 +1,38 @@
//
// untitled.m
// BusinessTime
//
// Created by Sam Mcdonald on 1/7/10.
// Copyright 2010 141312 LLC. All rights reserved.
//

#import "BTStatusWindow.h"


@implementation BTStatusWindow


- (id)init {

// Size of screen
NSRect screenRect = [[NSScreen mainScreen] frame];

NSRect windowRect;
windowRect.size.width = 200;
windowRect.size.height = 100;
windowRect.origin.x = screenRect.size.width - windowRect.size.width - 20;
windowRect.origin.y = screenRect.size.height - windowRect.size.height - 40;

NSWindow* window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];


self = [super initWithWindow:window];
if (self) {


}
return self;
}


@end
42 changes: 33 additions & 9 deletions BusinessTime.xcodeproj/project.pbxproj
Expand Up @@ -7,20 +7,28 @@
objects = {

/* Begin PBXBuildFile section */
0279F12010F676CC00542AB3 /* BTMainWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0279F11F10F676CC00542AB3 /* BTMainWindowController.m */; };
0279F12610F676F400542AB3 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0279F12510F676F400542AB3 /* MainWindow.xib */; };
0279F16510F67A7000542AB3 /* BTStatusWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 0279F16410F67A7000542AB3 /* BTStatusWindow.m */; };
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
256AC3DA0F4B6AC300CF3369 /* BusinessTimeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* BusinessTimeAppDelegate.m */; };
256AC3DA0F4B6AC300CF3369 /* BTBusinessTimeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* BTBusinessTimeAppDelegate.m */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0279F11E10F676CC00542AB3 /* BTMainWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTMainWindowController.h; sourceTree = "<group>"; };
0279F11F10F676CC00542AB3 /* BTMainWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTMainWindowController.m; sourceTree = "<group>"; };
0279F12510F676F400542AB3 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
0279F16310F67A7000542AB3 /* BTStatusWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTStatusWindow.h; sourceTree = "<group>"; };
0279F16410F67A7000542AB3 /* BTStatusWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTStatusWindow.m; sourceTree = "<group>"; };
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
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 /* BusinessTimeAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BusinessTimeAppDelegate.h; sourceTree = "<group>"; };
256AC3D90F4B6AC300CF3369 /* BusinessTimeAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BusinessTimeAppDelegate.m; sourceTree = "<group>"; };
256AC3D80F4B6AC300CF3369 /* BTBusinessTimeAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTBusinessTimeAppDelegate.h; sourceTree = "<group>"; };
256AC3D90F4B6AC300CF3369 /* BTBusinessTimeAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTBusinessTimeAppDelegate.m; sourceTree = "<group>"; };
256AC3F00F4B6AF500CF3369 /* BusinessTime_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BusinessTime_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>"; };
Expand All @@ -41,13 +49,24 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
0279F10E10F6763600542AB3 /* Window Controllers */ = {
isa = PBXGroup;
children = (
256AC3D80F4B6AC300CF3369 /* BusinessTimeAppDelegate.h */,
256AC3D90F4B6AC300CF3369 /* BusinessTimeAppDelegate.m */,
0279F11E10F676CC00542AB3 /* BTMainWindowController.h */,
0279F11F10F676CC00542AB3 /* BTMainWindowController.m */,
0279F16310F67A7000542AB3 /* BTStatusWindow.h */,
0279F16410F67A7000542AB3 /* BTStatusWindow.m */,
);
name = Classes;
name = "Window Controllers";
sourceTree = "<group>";
};
080E96DDFE201D6D7F000001 /* Application */ = {
isa = PBXGroup;
children = (
256AC3D80F4B6AC300CF3369 /* BTBusinessTimeAppDelegate.h */,
256AC3D90F4B6AC300CF3369 /* BTBusinessTimeAppDelegate.m */,
);
name = Application;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
Expand Down Expand Up @@ -79,7 +98,8 @@
29B97314FDCFA39411CA2CEA /* BusinessTime */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
0279F10E10F6763600542AB3 /* Window Controllers */,
080E96DDFE201D6D7F000001 /* Application */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
Expand All @@ -103,6 +123,7 @@
8D1107310486CEB800E47090 /* BusinessTime-Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
0279F12510F676F400542AB3 /* MainWindow.xib */,
);
name = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -161,6 +182,7 @@
files = (
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
0279F12610F676F400542AB3 /* MainWindow.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -172,7 +194,9 @@
buildActionMask = 2147483647;
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
256AC3DA0F4B6AC300CF3369 /* BusinessTimeAppDelegate.m in Sources */,
256AC3DA0F4B6AC300CF3369 /* BTBusinessTimeAppDelegate.m in Sources */,
0279F12010F676CC00542AB3 /* BTMainWindowController.m in Sources */,
0279F16510F67A7000542AB3 /* BTStatusWindow.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
19 changes: 0 additions & 19 deletions BusinessTimeAppDelegate.m

This file was deleted.

80 changes: 16 additions & 64 deletions English.lproj/MainMenu.xib
Expand Up @@ -2,18 +2,16 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">10A324</string>
<string key="IBDocument.InterfaceBuilderVersion">719</string>
<string key="IBDocument.AppKitVersion">1015</string>
<string key="IBDocument.HIToolboxVersion">418.00</string>
<string key="IBDocument.SystemVersion">10C540</string>
<string key="IBDocument.InterfaceBuilderVersion">740</string>
<string key="IBDocument.AppKitVersion">1038.25</string>
<string key="IBDocument.HIToolboxVersion">458.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">719</string>
<string key="NS.object.0">740</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="371"/>
<integer value="29"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -1315,26 +1313,8 @@
</object>
<string key="NSName">_NSMainMenu</string>
</object>
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{335, 390}, {480, 360}}</string>
<int key="NSWTFlags">1954021376</int>
<string key="NSWindowTitle">BusinessTime</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{480, 360}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSCustomObject" id="976324537">
<string key="NSClassName">BusinessTimeAppDelegate</string>
<string key="NSClassName">BTBusinessTimeAppDelegate</string>
</object>
<object class="NSCustomObject" id="755631768">
<string key="NSClassName">NSFontManager</string>
Expand Down Expand Up @@ -2015,14 +1995,6 @@
</object>
<int key="connectionID">530</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="972006081"/>
</object>
<int key="connectionID">532</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -2564,20 +2536,6 @@
<reference key="object" ref="708854459"/>
<reference key="parent" ref="698887838"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">371</int>
<reference key="object" ref="972006081"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="439893737"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">372</int>
<reference key="object" ref="439893737"/>
<reference key="parent" ref="972006081"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">375</int>
<reference key="object" ref="302598603"/>
Expand Down Expand Up @@ -3199,13 +3157,6 @@
<string>351.ImportedFromIB2</string>
<string>354.IBPluginDependency</string>
<string>354.ImportedFromIB2</string>
<string>371.IBEditorWindowLastContentRect</string>
<string>371.IBPluginDependency</string>
<string>371.IBWindowTemplateEditedContentRect</string>
<string>371.NSWindowTemplate.visibleAtLaunch</string>
<string>371.editorWindowContentRectSynchronizationRect</string>
<string>371.windowTemplate.maxSize</string>
<string>372.IBPluginDependency</string>
<string>375.IBPluginDependency</string>
<string>376.IBEditorWindowLastContentRect</string>
<string>376.IBPluginDependency</string>
Expand Down Expand Up @@ -3452,13 +3403,6 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{380, 496}, {480, 360}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{380, 496}, {480, 360}}</string>
<integer value="1"/>
<string>{{33, 99}, {480, 360}}</string>
<string>{3.40282e+38, 3.40282e+38}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{591, 420}, {83, 43}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
Expand Down Expand Up @@ -3597,15 +3541,23 @@
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">BusinessTimeAppDelegate</string>
<string key="className">BTBusinessTimeAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">window</string>
<string key="NS.object.0">NSWindow</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">BusinessTimeAppDelegate.h</string>
<string key="minorKey">BTBusinessTimeAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">BTBusinessTimeAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
Expand Down

0 comments on commit 506a066

Please sign in to comment.