Implemented encoding/decoding

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7375 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 2000-09-04 22:59:23 +00:00
parent e0fa3900b9
commit d3f3e00f40
2 changed files with 66 additions and 0 deletions

View file

@ -136,10 +136,47 @@ static NSColor *scrollBarColor = nil;
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[super encodeWithCoder: aCoder];
[aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_arrowsPosition];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isEnabled];
[aCoder encodeConditionalObject: _target];
[aCoder encodeValueOfObjCType: @encode(SEL) at: &_action];
/* We do not save float value, knob proportion. */
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
self = [super initWithCoder: aDecoder];
if (_frame.size.width > _frame.size.height)
{
_isHorizontal = YES;
}
else
{
_isHorizontal = NO;
}
if (_isHorizontal)
{
_floatValue = 0.0;
}
else
{
_floatValue = 1.0;
}
_hitPart = NSScrollerNoPart;
[aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_arrowsPosition];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isEnabled];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_target];
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action];
[self drawParts];
[self checkSpaceForParts];
return self;
}