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 --------------- */ | |
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 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 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
// Delegate method for the locationListView | |
- (void)collectionViewDidChangeSelection:(CPCollectionView)aCollectionView | |
{ | |
var loc = [locationsController selectedLocation]; | |
[mapController moveMapToLat:[loc latitude] andLng:[loc 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
- (void)addLocation { | |
if (!locations) { | |
locations = [[CPArray alloc] init]; | |
} | |
loc = [[Location alloc] init]; | |
[loc setDescription:@""]; | |
[loc setPosition:([locations count] + 1)]; | |
[locations addObject:loc]; | |
[locationListView setContent:locations]; |
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 "MapController.j" | |
@import "LocationsController.j" | |
@import "LocationDetailView.j" | |
@implementation LocationDetailController : CPObject | |
{ | |
Location location; | |
MapController mapController @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
// Delegate method for the locationListView | |
- (void)collectionViewDidChangeSelection:(CPCollectionView)aCollectionView | |
{ | |
[locationDetailController setLocation:[self selectedLocation]]; | |
} |
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)controlTextDidEndEditing:(id)sender { | |
if ([sender object] == searchField) { | |
[self searchLocation]; | |
} | |
} | |
- (void)searchLocation { | |
if ([searchField stringValue]) { | |
[mapController moveMapToAddress:[searchField stringValue]]; | |
[locationDetailController setNameIfEmpty:[searchField stringValue]]; |
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
class Foo < ActiveRecord::Base | |
def self.test_big_text | |
text = %{<r:trip> | |
<h1><r:countries/></h1> | |
<div class="dtIntro clearfix"> | |
<div class="grid g460"> | |
<h2 class="bold"><r:title/></h2> | |
<h3><r:trip_kind_description/> ab <strong>€ <r:baseprice/></strong></h3> | |
</div> |
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
@interface IconViewBox : NSBox | |
{ | |
IBOutlet id delegate; | |
} | |
@end |
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
@implementation IconViewBox | |
// ------------------------------------------------------------------------------- | |
// hitTest:aPoint | |
// ------------------------------------------------------------------------------- | |
- (NSView *)hitTest:(NSPoint)aPoint | |
{ | |
// don't allow any mouse clicks for subviews in this view | |
if(NSPointInRect(aPoint,[self convertRect:[self bounds] toView:[self superview]])) { | |
return self; |