// // OutlinedView.m // // Created by Tyler Neylon on 6/30/09. // Copyright 2009 Bynomial. All rights reserved. // #import "OutlinedView.h" @implementation OutlinedView - (id) initWithFrame: (CGRect) frame_ { NSLog(@"OutlinedView::initWithFrame:"); self = [super initWithFrame:CGRectMake(frame_.origin.x - 1, frame_.origin.y - 1, frame_.size.width + 2, frame_.size.height + 2)]; if (self == nil) return nil; self.backgroundColor = [UIColor greenColor]; whiteView = [[UIView be] initWithFrame:CGRectMake(1, 1, frame_.size.width, frame_.size.height)]; whiteView.backgroundColor = [UIColor whiteColor]; whiteView.clipsToBounds = YES; [super addSubview:whiteView]; return self; } - (void) setFrame: (CGRect) frame_ { NSLog(@"OutlinedView::setFrame:"); [super setFrame:CGRectMake(frame_.origin.x - 1, frame_.origin.y - 1, frame_.size.width + 2, frame_.size.height + 2)]; whiteView.frame = CGRectMake(1, 1, frame_.size.width, frame_.size.height); } - (void) addSubview: (UIView*) subview { NSLog(@"OutlinedView::addSubview:"); NSLog(@"new view has frame (%f, %f, %f, %f)", subview.frame.origin.x, subview.frame.origin.y, subview.frame.size.width, subview.frame.size.height); [whiteView addSubview:subview]; } @end