Created
May 1, 2010 16:23
-
-
Save tingham/386466 to your computer and use it in GitHub Desktop.
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 ActionTableDataView : CPView | |
{ | |
} | |
- (void)setObjectValue:(id)value { | |
CPLog(value); | |
if( [value containsKey:@"image"] ){ | |
var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(0,0,22,22)]; | |
[iconView setImageScaling:CPScaleProportionally]; | |
[iconView setImage:[[CPImage alloc] initByReferencingFile:[value valueForKey:@"image"] size:CGSizeMake(22,22)]]; | |
var labelView = [[CPTextField alloc] initWithFrame:CGRectMake(0,0,178,22)]; | |
[labelView setStringValue:[value valueForKey:@"name"]]; | |
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
var wrapperView = [[CPView alloc] initWithFrame:CGRectMake(0,0,200,22)]; | |
[wrapperView addSubview:iconView]; | |
[wrapperView addSubview:labelView]; | |
CPLog(@"composite"); | |
return wrapperView; | |
}else{ | |
var labelView = [[CPTextField alloc] initWithFrame:CGRectMake(0,0,200,22)]; | |
[labelView setStringValue:[value valueForKey:@"name"]]; | |
CPLog(@"text"); | |
return labelView; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment