Added keyed decoding.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18530 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2004-02-02 21:40:00 +00:00
parent 7ebc080da5
commit 108986ee7d
7 changed files with 171 additions and 61 deletions

View file

@ -198,14 +198,23 @@ static NSColor *txtCol;
- (id) initWithCoder: (NSCoder*)aDecoder
{
BOOL tmp;
[super initWithCoder: aDecoder];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_background_color];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_text_color];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp];
_textfieldcell_draws_background = tmp;
_textfieldcell_is_opaque = [self _isOpaque];
if ([aDecoder allowsKeyedCoding])
{
[self setBackgroundColor: [aDecoder decodeObjectForKey: @"NSBackgroundColor"]];
[self setTextColor: [aDecoder decodeObjectForKey: @"NSTextColor"]];
}
else
{
BOOL tmp;
[aDecoder decodeValueOfObjCType: @encode(id) at: &_background_color];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_text_color];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp];
_textfieldcell_draws_background = tmp;
_textfieldcell_is_opaque = [self _isOpaque];
}
return self;
}