Corrections to prevent errors when loading nibs created by Gorm into IB.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@23229 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-08-09 06:31:12 +00:00
parent 3a12289000
commit 7a60003663
3 changed files with 32 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2006-08-09 02:29-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormCustomView.m: encodeWithCoder: changes to encode the
customview.
* GormCore/GormNibWrapperBuilder.m: Add oids for connectors and
also add one for the owner.
2006-08-06 00:37-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormFilesOwner.m: Remove implementation of initWithCoder:

View file

@ -110,10 +110,20 @@
*/
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[aCoder encodeObject: [self stringValue]];
[aCoder encodeRect: _frame];
[aCoder encodeValueOfObjCType: @encode(unsigned int)
at: &_autoresizingMask];
if([aCoder allowsKeyedCoding])
{
id cv = [[NSCustomView alloc] initWithFrame: [self frame]];
[cv setAutoresizingMask: [self autoresizingMask]];
[cv setClassName: className];
[cv encodeWithCoder: aCoder];
}
else
{
[aCoder encodeObject: [self stringValue]];
[aCoder encodeRect: _frame];
[aCoder encodeValueOfObjCType: @encode(unsigned int)
at: &_autoresizingMask];
}
}
- (id) initWithCoder: (NSCoder*)aCoder

View file

@ -51,11 +51,12 @@
NSEnumerator *en = [cons objectEnumerator];
id o = nil;
id owner = [document objectForName: @"NSOwner"];
int oid = 0;
int oid = 1;
// Create the container for the .nib file...
ASSIGN(_root, owner);
NSMapInsert(_names, owner, @"File's Owner");
NSMapInsert(_oids, owner, @"0");
ASSIGN(_framework, @"IBCocoaFramework");
[_topLevelObjects addObjectsFromArray: [[document topLevelObjects] allObjects]];
[_visibleWindows addObjectsFromArray: [[document visibleWindows] allObjects]];
@ -83,6 +84,10 @@
{
name = @"File's Owner";
}
if([name isEqual: @"NSMenu"])
{
name = @"MainMenu";
}
else if([name isEqual: @"NSFirst"])
{
// skip it...
@ -92,12 +97,16 @@
NSMapInsert(_objects, src, dst);
NSMapInsert(_names, src, name);
NSMapInsert(_oids, src, [NSString stringWithFormat: @"%d", oid]);
oid++;
}
else
{
[_connections addObject: o];
NSMapInsert(_oids, o, [NSString stringWithFormat: @"%d", oid]);
// NSMapInsert(_objects, o, owner);
}
// next...
oid++;
}
// set the next oid...