mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 15:10:47 +00:00
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:
parent
f62f56695d
commit
d1bb44a910
5 changed files with 380 additions and 58 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue