* Source/NSTabView.m: Corrections in initWithCoder: and

encodeWithCoder: to properly encode items and tabview orientation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23298 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-08-16 04:54:25 +00:00
parent b87d2a64cd
commit f4e0785e42
2 changed files with 43 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2006-08-16 00:53-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSTabView.m: Corrections in initWithCoder: and
encodeWithCoder: to properly encode items and tabview orientation.
2006-08-15 01:02-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added oids method.

View file

@ -768,12 +768,29 @@
[super encodeWithCoder: aCoder];
if ([aCoder allowsKeyedCoding])
{
unsigned int type = 0;
switch(_type)
{
case NSTopTabsBezelBorder:
type = 0;
break;
case NSLeftTabsBezelBorder:
type = 1;
break;
case NSBottomTabsBezelBorder:
type = 2;
break;
case NSRightTabsBezelBorder:
type = 3;
break;
}
[aCoder encodeBool: [self allowsTruncatedLabels] forKey: @"NSAllowTruncatedLabels"];
[aCoder encodeBool: [self drawsBackground] forKey: @"NSDrawsBackground"];
[aCoder encodeObject: [self font] forKey: @"NSFont"];
[aCoder encodeObject: _items forKey: @"NSTabViewItems"];
[aCoder encodeObject: [self selectedTabViewItem] forKey: @"NSSelectedTabViewItem"];
[aCoder encodeInt: 0 forKey: @"NSTvFlags"]; // no flags set...
[aCoder encodeInt: type forKey: @"NSTvFlags"]; // no flags set...
}
else
{
@ -809,14 +826,7 @@
}
if ([aDecoder containsValueForKey: @"NSTabViewItems"])
{
NSArray *items = [aDecoder decodeObjectForKey: @"NSTabViewItems"];
NSEnumerator *enumerator = [items objectEnumerator];
NSTabViewItem *item;
while ((item = [enumerator nextObject]) != nil)
{
[self addTabViewItem: item];
}
ASSIGN(_items, [aDecoder decodeObjectForKey: @"NSTabViewItems"]);
}
if ([aDecoder containsValueForKey: @"NSSelectedTabViewItem"])
{
@ -825,7 +835,25 @@
}
if ([aDecoder containsValueForKey: @"NSTvFlags"])
{
//int flags = [aDecoder decodeObjectForKey: @"NSTvFlags"]];
unsigned int type = [aDecoder decodeIntForKey: @"NSTvFlags"];
switch(type)
{
case 0:
_type = NSTopTabsBezelBorder;
break;
case 1:
_type = NSLeftTabsBezelBorder;
break;
case 2:
_type = NSBottomTabsBezelBorder;
break;
case 3:
_type = NSRightTabsBezelBorder;
break;
default:
_type = NSTopTabsBezelBorder;
break;
}
}
}
else