Correction for GSNibCompatibility. Added coding to classes for keyed archiving.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23225 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2006-08-09 01:37:32 +00:00
parent 2998c54fed
commit 1a8528922e
11 changed files with 227 additions and 91 deletions

View file

@ -52,6 +52,7 @@
#include "AppKit/NSSound.h"
#include "AppKit/NSWindow.h"
#include "GNUstepGUI/GSDrawFunctions.h"
#include "GNUstepGUI/GSNibCompatibility.h"
#include <math.h>
@ -1449,6 +1450,8 @@ typedef struct _GSButtonCellFlags
GSButtonCellFlags buttonCellFlags;
unsigned int bFlags = 0;
unsigned int bFlags2 = 0;
NSImage *image = nil;
NSButtonImageSource *bi = nil;
[aCoder encodeObject: [self keyEquivalent] forKey: @"NSKeyEquivalent"];
[aCoder encodeObject: [self image] forKey: @"NSNormalImage"];
@ -1469,6 +1472,25 @@ typedef struct _GSButtonCellFlags
bFlags2 != [self showsBorderOnlyWhileMouseInside] ? 0x8 : 0;
bFlags2 |= [self bezelStyle];
[aCoder encodeInt: bFlags2 forKey: @"NSButtonFlags2"];
// alternate image encoding...
image = [self image];
if ([image isKindOfClass: [NSImage class]])
{
if([NSImage imageNamed: @"NSSwitch"] == image)
{
bi = [[NSButtonImageSource alloc] initWithImageNamed: @"NSHighlightedSwitch"];
}
else if([NSImage imageNamed: @"NSRadioButton"] == image)
{
bi = [[NSButtonImageSource alloc] initWithImageNamed: @"NSHighlightedRadioButton"];
}
}
[aCoder encodeObject: bi forKey: @"NSAlternateImage"];
// repeat and delay
[aCoder encodeFloat: _delayInterval forKey: @"NSPeriodicDelay"];
[aCoder encodeFloat: _repeatInterval forKey: @"NSPeriodicInterval"];
}
else
{