This file contains 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
- (CPString)bundleLocaleWithUserLanguage:(CPString)aUserLanguage | |
{ | |
var defaultLocale = [self objectForInfoDictionaryKey:@"CPBundleDevelopmentRegion"]; | |
var availableLocales = [self objectForInfoDictionaryKey:@"CPBundleLocalizedResourceKeys"]; | |
var bestMatch, myLocale= nil; | |
UserLanguage = aUserLanguage; | |
// First try matching against the UserLanguage | |
if (UserLanguage && [UserLanguage length]) |
This file contains 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
- (CPString)browserLanguage | |
{ | |
// IE uses userLanguage to return the code. For now, we'll just deal with | |
// the "base" language (e.g. "en" vs. "en-GB" | |
var userLang = (navigator.language) ? navigator.language : navigator.userLanguage; | |
return userLang.substring(0,2) | |
} |
This file contains 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
- (CPString)pathForLocalizedResource:(CPString)aResourceName | |
{ | |
var mainBundle = [CPBundle mainBundle]; | |
return [mainBundle pathForResource:[mainBundle bundleLocale] + ".lproj/" +aResourceName]; | |
} | |
+ (CPCib)loadLocalizedCibNamed:(CPString)aName | |
owner:(id)anOwner | |
loadDelegate:(id)aDelegate | |
{ |
This file contains 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
/* | |
* CPBundle.j | |
* AppKit | |
* | |
* Created by Nicholas Small, extended by John C. Fox | |
* Copyright 2009, 280 North, Inc. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either |
This file contains 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
/* | |
* MMSSimpleWhiteScroller.j | |
* | |
* Created by John C. Fox on 04/29/2010. | |
* Copyright 2010 GroupSmarts, LLC. All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import <AppKit/CPTheme.j> |
This file contains 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
- (void)drawRect:(CGRect)aRect | |
{ | |
log('here in MMSGradientView drawRect'); | |
var myContext = [[CPGraphicsContext currentContext] graphicsPort]; | |
var myGradient = CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [1, 1, 1,1.0, .5, .5, .5,1.0], [0,1], 2); | |
var startPoint = CGPointMake(0, 0); | |
var endPoint = CGPointMake(0, [self bounds].size.height); | |
CGContextDrawLinearGradient(myContext, myGradient, startPoint, endPoint, 0); |
This file contains 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
- (void)setAnchorPoint:(CGPoint)anAnchorPoint | |
inPhotoLayer:(CALayer)aPhotoLayer | |
{ | |
log('anAnchorPoint is ' +CPStringFromPoint(anAnchorPoint)); | |
if (aPhotoLayer._DOMContentsElement == null) | |
{ | |
log('aPhotoLayer has no _DOMContentsElement cannot set its anchor point, bail'); | |
return; |
This file contains 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
- (void)setAnchorPoint:(CGPoint)anAnchorPoint | |
inPhotoLayer:(CALayer)aPhotoLayer | |
{ | |
log('anAnchorPoint is ' +CPStringFromPoint(anAnchorPoint)); | |
if (aPhotoLayer._DOMContentsElement == null) | |
{ | |
log('aPhotoLayer has no _DOMContentsElement cannot set its anchor point, bail'); | |
return; |
This file contains 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
- (void)setFrame:(CGRect)aFrame | |
{ | |
log('here in MKMapView setFrame aFrame is ' +CPStringFromRect(aFrame)); | |
[super setFrame:aFrame]; | |
log('[_frameView frame] is ' +CPStringFromRect([_frameView frame])); | |
var bounds = [self bounds]; |
This file contains 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
// Time/Place markersTable View | |
var tableViewRect = CPRectCreateCopy([notesTextView frame]); | |
tableViewRect.origin.y += ([notesTextView frame].size.height + 10); | |
tableViewRect.size.width = ([containerView frame].size.width - (2 * margin)); | |
// We want to fill the space between the bottom of the notes text view and the top of the buttons on the | |
// bottom of this form | |
var tableHeight = ([containerView frame].size.height - [createNewButton frame].size.height | |
- margin - 3 - tableViewRect.origin.y); |
NewerOlder