mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 06:40:38 +00:00
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:
parent
9532564638
commit
93a9b4e1ad
2 changed files with 66 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue