Adding-on to our -in progress- work on Collection View.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36211 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Frank Le Grand 2013-03-01 00:04:56 +00:00
parent f62f56695d
commit d1bb44a910
5 changed files with 380 additions and 58 deletions

View file

@ -83,12 +83,22 @@
- (void)dealloc
{
DESTROY (textField);
DESTROY (imageView);
[super dealloc];
}
- (void)setSelected:(BOOL)shouldBeSelected
- (NSCollectionView *)collectionView
{
_isSelected = shouldBeSelected;
return (NSCollectionView *)[[self view] superview];
}
- (void)setSelected:(BOOL)flag
{
if (_isSelected != flag)
{
_isSelected = flag;
}
}
- (id)representedObject
@ -102,6 +112,32 @@
[textField setStringValue:[self representedObject]];
}
- (NSTextField *)textField
{
return textField;
}
- (void)setTextField:(NSTextField *)aTextField
{
if (textField != aTextField)
{
textField = aTextField;
}
}
- (NSImageView *)imageView
{
return imageView;
}
- (void)setImageView:(NSImageView *)anImageView
{
if (imageView != anImageView)
{
imageView = anImageView;
}
}
- (id)initWithCoder:(NSCoder *)aCoder
{
self = [super initWithCoder:aCoder];
@ -122,4 +158,11 @@
[aCoder encodeObject:imageView forKey:@"imageView"];
}
- (id) copyWithZone:(NSZone *)zone
{
NSData *itemAsData = [NSKeyedArchiver archivedDataWithRootObject:self];
NSCollectionViewItem *newItem = [NSKeyedUnarchiver unarchiveObjectWithData:itemAsData];
return newItem;
}
@end