Fixed a bug with custom classes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@15591 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2003-01-14 06:29:34 +00:00
parent 8c0b18b4ab
commit b7931b0b4f
4 changed files with 22 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2003-01-14 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: replaceObjectsWithTemplates: added a
call to a new method in the class manager which returns
custom classes based on the name assigned to the object.
* GormClassManager.m: Added a method to pull the custom
class association by name. This corrected an issue
with custom classes.
2003-01-13 Gregory John Casamento <greg_casamento@yahoo.com>
* GModelDecoder.m: openGModel: added code to import

View file

@ -62,6 +62,7 @@
// custom class support...
- (NSString *) customClassForObject: (id)object;
- (NSString *) customClassForName: (NSString *)name;
- (void) setCustomClass: (NSString *)className
forObject: (id)object;
- (void) removeCustomClassForObject: (id) object;

View file

@ -1237,10 +1237,17 @@ NSString *IBClassNameChangedNotification = @"IBClassNameChangedNotification";
}
// custom class support...
- (NSString *) customClassForName: (NSString *)name
{
NSString *result = [customClassMap objectForKey: name];
return result;
}
- (NSString *) customClassForObject: (id)object
{
NSString *name = [[(id<IB>)NSApp activeDocument] nameForObject: object];
NSString *result = [customClassMap objectForKey: name];
NSString *result = [self customClassForName: name];
// NSString *result = [customClassMap objectForKey: name];
NSDebugLog(@"in customClassForObject: object = %@, name = %@, result = %@, customClassMap = %@",object, name, result, customClassMap);
return result;
}

View file

@ -309,10 +309,10 @@ static NSImage *classesImage = nil;
{
id obj = [nameTable objectForKey: key];
id template = nil;
NSString *className = [classManager customClassForObject: key];
NSString *className = [classManager customClassForName: key];
[tempNameTable setObject: obj forKey: key]; // save the old object
NSDebugLog(@"className = (%@), obj = (%@), key = (%@)",className,obj,key);
NSLog(@"className = (%@), obj = (%@), key = (%@)",className,obj,key);
if(className != nil)
{
// The order in which these are handled is important. The mutually
@ -322,6 +322,8 @@ static NSImage *classesImage = nil;
if([obj isKindOfClass: [NSWindow class]])
{
BOOL isVisible = [self objectIsVisibleAtLaunch: obj];
NSLog(@"In the window template if...");
template = [[GormNSWindowTemplate alloc] initWithObject: obj
className: className];
[self setObject: obj isVisibleAtLaunch: NO];