Created
May 4, 2010 00:43
-
-
Save justingraves/388797 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* AppController.j | |
* Social Radar | |
* | |
* Created by You on April 25, 2010. | |
* Copyright 2010, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import <AppKit/CPTabView.j> | |
@import <SocialRadar/SRRibbon.j> | |
@import <SocialRadar/SRPageView.j> | |
@implementation AppController : CPObject | |
{ | |
CPWindow mainWindow; | |
CPView mainContentView; | |
SRRibbon ribbon; // Top toolbar | |
CPTabView tabBar; // Tab bar at the top of the page view | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var mainWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask], | |
mainContentView = [mainWindow contentView]; | |
ribbon = [[SRRibbon alloc] initWithIdentifier:"Ribbon"]; | |
[ribbon setDelegate:self]; | |
[ribbon setVisible:YES]; | |
[mainWindow setToolbar:ribbon]; | |
[mainWindow orderFront:self]; | |
} | |
// Return an array of toolbar item identifier (all the toolbar items that may be present in the toolbar) | |
- (CPArray)toolbarAllowedItemIdentifiers:(CPToolbar)aToolbar | |
{ | |
return [CPToolbarFlexibleSpaceItemIdentifier, CPToolbarFlexibleSpaceItemIdentifier]; | |
} | |
// Return an array of toolbar item identifier (the default toolbar items that are present in the toolbar) | |
- (CPArray)toolbarDefaultItemIdentifiers:(CPToolbar)aToolbar | |
{ | |
return [self toolbarAllowedItemIdentifiers:aToolbar]; | |
} | |
- (CPToolbarItem)toolbar:(CPToolbar)aToolbar itemForItemIdentifier:(CPString)anItemIdentifier willBeInsertedIntoToolbar:(BOOL)aFlag | |
{ | |
var toolbarItem = [[CPToolbarItem alloc] initWithItemIdentifier:anItemIdentifier]; | |
var mainBundle = [CPBundle mainBundle]; | |
return toolbarItem; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment