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
@import <AppKit/CPCollectionView.j> | |
@implementation LocationListView : CPCollectionView | |
{ | |
CPCollectionViewItem itemPrototype; | |
} | |
- (id)initWithFrame:(CGRect)aFrame | |
{ | |
self = [super initWithFrame:aFrame]; |
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
@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 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" | |
@import "LocationListView.j" | |
@implementation LocationsController : CPObject | |
{ | |
CPArray locations; | |
LocationListView locationListView @accessors; | |
} |
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
@import <AppKit/CPView.j> | |
@implementation LocationsToolbar : CPView | |
{ | |
CPButton addButton; | |
CPButton removeButton; | |
id delegate @accessors; | |
} | |
- (id)initWithFrame:(CGRect)aFrame |
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
/* ---- Locations Toolbar ----- */ | |
locationsToolbar = [[LocationsToolbar alloc] initWithFrame:CGRectMake(10.0, 467.0, 226.0, 25.0)]; | |
[locationsToolbar setDelegate:locationsController]; | |
[contentView addSubview:locationsToolbar]; |
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
@import <AppKit/CPView.j> | |
@implementation LocationDetailView : CPView | |
{ | |
CPTextField locationNameField; | |
id delegate @accessors; | |
} | |
- (id)initWithFrame:(CGRect)aFrame | |
{ |
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
/* ------- Location Detail Controller ----- */ | |
locationDetailController = [[LocationDetailController alloc] init]; | |
locationDetailController.mapController = mapController; | |
locationsController.locationDetailController = locationDetailController; | |
[mapController setDelegate:locationDetailController]; | |
/* ------- Location Detail View ---------- */ | |
locationDetailView = [[LocationDetailView alloc] initWithFrame:CGRectMake(510, 490, 400, 90)]; | |
[locationDetailView setDelegate:locationDetailController]; | |
[locationDetailController setLocationDetailView:locationDetailView]; |
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
/* ------------ Search Field ------------- */ | |
searchField = [CPTextField roundedTextFieldWithStringValue:@"" placeholder:@"Location" width:200.0]; | |
[searchField setFrameOrigin:CGPointMake(510.0, 35.0)]; | |
[searchField setDelegate:self]; | |
[contentView addSubview:searchField]; | |
/* ----------- Search Button ------------------- */ | |
var searchButton = [[CPButton alloc] initWithFrame:CGRectMake(710.0, 37.0, 60.0, 24.0)]; | |
[searchButton setTitle:"Search"]; | |
[searchButton setTarget:self]; |
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
@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 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" |