mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 21:50:46 +00:00
* 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:
parent
db8a0f9a35
commit
c1e814a745
2 changed files with 43 additions and 10 deletions
|
@ -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>
|
2006-08-15 01:02-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added oids method.
|
* Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added oids method.
|
||||||
|
|
|
@ -768,12 +768,29 @@
|
||||||
[super encodeWithCoder: aCoder];
|
[super encodeWithCoder: aCoder];
|
||||||
if ([aCoder allowsKeyedCoding])
|
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 allowsTruncatedLabels] forKey: @"NSAllowTruncatedLabels"];
|
||||||
[aCoder encodeBool: [self drawsBackground] forKey: @"NSDrawsBackground"];
|
[aCoder encodeBool: [self drawsBackground] forKey: @"NSDrawsBackground"];
|
||||||
[aCoder encodeObject: [self font] forKey: @"NSFont"];
|
[aCoder encodeObject: [self font] forKey: @"NSFont"];
|
||||||
[aCoder encodeObject: _items forKey: @"NSTabViewItems"];
|
[aCoder encodeObject: _items forKey: @"NSTabViewItems"];
|
||||||
[aCoder encodeObject: [self selectedTabViewItem] forKey: @"NSSelectedTabViewItem"];
|
[aCoder encodeObject: [self selectedTabViewItem] forKey: @"NSSelectedTabViewItem"];
|
||||||
[aCoder encodeInt: 0 forKey: @"NSTvFlags"]; // no flags set...
|
[aCoder encodeInt: type forKey: @"NSTvFlags"]; // no flags set...
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -809,14 +826,7 @@
|
||||||
}
|
}
|
||||||
if ([aDecoder containsValueForKey: @"NSTabViewItems"])
|
if ([aDecoder containsValueForKey: @"NSTabViewItems"])
|
||||||
{
|
{
|
||||||
NSArray *items = [aDecoder decodeObjectForKey: @"NSTabViewItems"];
|
ASSIGN(_items, [aDecoder decodeObjectForKey: @"NSTabViewItems"]);
|
||||||
NSEnumerator *enumerator = [items objectEnumerator];
|
|
||||||
NSTabViewItem *item;
|
|
||||||
|
|
||||||
while ((item = [enumerator nextObject]) != nil)
|
|
||||||
{
|
|
||||||
[self addTabViewItem: item];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ([aDecoder containsValueForKey: @"NSSelectedTabViewItem"])
|
if ([aDecoder containsValueForKey: @"NSSelectedTabViewItem"])
|
||||||
{
|
{
|
||||||
|
@ -825,7 +835,25 @@
|
||||||
}
|
}
|
||||||
if ([aDecoder containsValueForKey: @"NSTvFlags"])
|
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
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue