Skip to content

Instantly share code, notes, and snippets.

View j4johnfox's full-sized avatar

John C Fox j4johnfox

View GitHub Profile
- (void)drawRect:(CGRect)aRect
{
[super drawRect:aRect];
CPLog("MMSImageAnnotationView here in drawRect");
//var myColor = CGColorCreateGenericRGB(1, .5, 1, .5);
var myRect = CGRectMake(0, 0, 320, 240);
var myContext = CGBitmapGraphicsContextCreate();
@import <AppKit/CPImageView.j>
@import <AppKit/CPGraphicsContext.j>
@import <AppKit/CGContext.j>
@import <AppKit/CPColor.j>
@implementation MMSImageAnnotationView : CPImageView
{
CPArray markerInfoDictArray;
BOOL showMarkers;
}
@import <AppKit/CPButton.j>
@implementation MMSToolbarButton : CPButton
{
CPString identifier @accessors;
CPString buttonType @accessors;
}
- (id)initWithFrame:(CPRect)frame
{
- (id)init
{
self = [self initWithContentRect:CGRectMake(0.0, 0.0, 500.0, 165.0) styleMask:CPHUDBackgroundWindowMask | CPClosableWindowMask | CPResizableWindowMask];
if (self)
{
[self setTitle:@"Photos"];
[self setFloatingPanel:YES];
captionView = [[CPTextField alloc] initWithFrame:myCaptionFrame];
var myShadow = [CPShadow shadowWithOffset:CGSizeMake(2, 2) blurRadius:3 color:[CPColor darkGrayColor]];
[captionView setTextShadow:myShadow];
captionView = [[CPTextField alloc] initWithFrame:myCaptionFrame];
var myShadow = [CPShadow shadowWithOffset:CGSizeMake(2, 2) blurRadius:3 color:[CPColor darkGrayColor]];
[captionView setTextShadow:myShadow];
[CPApp beginSheet:flickrAuthWindow
modalForWindow:[[CPApp delegate] mainWindow]
modalDelegate:self
didEndSelector:nil
contextInfo:nil];
- (void)configureThumbnailScroller
{
[thumbnailsContainerView setBackgroundColor:[CPColor blackColor]];
var photosListItem = [[CPCollectionViewItem alloc] init];
[photosListItem setView:[[MMSPhotoCell alloc] initWithFrame:CGRectMakeZero()]];
photosCollectionView = [[CPCollectionView alloc] initWithFrame:CGRectMake(0, 0,
([thumbnailsScrollView frame].size.width), [thumbnailsScrollView frame].size.height)];
@import <Foundation/CPString.j>
@implementation CPString (MMSCategories)
- (CPString)stringByEsapingHTMLEncoding
// Bruteforce way, stolen from Prototype for unescaping
// HTML encoded strings (e.g. convert &quote; to ")
{
var temp = document.createElement("div");
temp.innerHTML = self;
//
// MMSLoginToolbarItemView.j
// StepInsideWeb
//
// Created by John Fox on 10/8/09.
// Copyright GroupSmarts, LLC 2009. All rights reserved.
//
@import <AppKit/CPView.j>
@import "MMSAuthenticationController.j"