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
/* ----- Map Controller --------------- */ | |
mapController = [[MapController alloc] init]; | |
/* ------------- Map View ----------------- */ | |
mapView = [[MKMapView alloc] initWithFrame:CGRectMake(510, 65, 400, 400) apiKey:'']; | |
[mapView setDelegate:self]; | |
mapController.mapView = mapView; | |
[contentView addSubview:mapView]; | |
/* ---------- Coordinates Label -------------- */ |
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
@import <Foundation/CPObject.j> | |
@import <MapKit/MKMapView.j> | |
@import "Location.j" | |
@implementation MapController : CPObject | |
{ | |
MKMapView mapView @accessors; | |
CPTextField coordinatesLabel @accessors; | |
CPString latitude; | |
CPString longitude; |
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
/* ------------ Locations --------------- */ | |
locationListView = [[LocationListView alloc] initWithFrame:CGRectMake(0.0, 0.0, 226.0, 400.0)]; | |
[locationListView setContent:[locationsController locations]]; | |
//1: we'll add something later | |
/* --------- Locations ScrollView ---------- */ | |
var locationScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(10.0, 65.0, 243.0, 400.0)]; | |
[locationScrollView setDocumentView:locationListView]; | |
[locationScrollView setAutohidesScrollers:YES]; | |
[[locationScrollView contentView] setBackgroundColor:[CPColor whiteColor]]; |
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
@import <AppKit/CPCollectionView.j> | |
@implementation LocationListView : CPCollectionView | |
{ | |
CPCollectionViewItem itemPrototype; | |
} | |
- (id)initWithFrame:(CGRect)aFrame | |
{ | |
self = [super initWithFrame:aFrame]; |
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 | |
* Locations | |
* | |
* Created by Johannes Fahrenkrug on September 8, 2009. | |
* Copyright 2009, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import "Location.j" |
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
@import <Foundation/CPObject.j> | |
@import "Location.j" | |
@import "DemoData.j" | |
@implementation LocationsController : CPObject | |
{ | |
CPArray locations; | |
} | |
- (void)setLocations:(CPArray)someLocations { |
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
@implementation DemoData : CPObject | |
+ (CPString)exampleJSONString { | |
var string = @"[{\"id\": 1, \"latitude\": \"39.099470\", \"longitude\": \"-94.563500\", \"description\": \"Corner of Twelfth and Vine\", \"transportation_kind\": \"\"}, {\"id\": 2, \"latitude\": \"37.802109\", \"longitude\": \"-122.432691\", \"description\": \"Moscone Center West\", \"transportation_kind\": \"S\"}]"; | |
return string; | |
} | |
@end |
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
@import <Foundation/CPObject.j> | |
@implementation Location : CPObject | |
{ | |
// the id (I don't call it "id" because that's a type in Objective-J) | |
int identifier @accessors; | |
CPString description @accessors; | |
CPString latitude @accessors; | |
CPString longitude @accessors; | |
CPString transportationKind @accessors; |
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
@import <Foundation/CPObject.j> | |
@import "TripDaysController.j" | |
@import "Trip.j" | |
@import "DemoData.j" | |
@import "Settings.j" | |
@implementation TripsController : CPObject | |
{ | |
TripDaysController tripDaysController @accessors; | |
CPTextField tripLabel @accessors; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Module> | |
<ModulePrefs | |
title="Owner ID Test" | |
height="600"> | |
<Require feature="opensocial-0.7"/> | |
</ModulePrefs> | |
<Content type="html"> |