Corrected some of the classes in the .plist and improved usability.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18285 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2003-12-30 05:39:20 +00:00
parent 9d60ae2d2b
commit f72c2b677c
4 changed files with 106 additions and 14 deletions

View file

@ -1,3 +1,16 @@
2003-12-30 00:41 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: Removed uneeded method which was overriding
awakeWithContext:. This method is called from loadNibNamed: and, since
the GormDocument is a subclass, but is never loaded by that method
overriding the other implementation is uncessary.
* ClassInformation.plist: Some of the parent information was wrong, this
was corrected.
* Gorm.m: Added code in -validateMenuItem: to grey out certain menu
items under given conditions. This improves usability and prevents
the user from corrupting the .gorm file by doing something that's
not supported.
2003-12-25 00:55 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: -validateMenuItem: added code to grey out

View file

@ -335,7 +335,7 @@
Outlets = (
menu
);
Super = NSResponder;
Super = NSObject;
};
NSForm = {
@ -355,7 +355,7 @@
activateContextHelpMode:,
showHelp:
);
Super = NSResponder;
Super = NSObject;
};
NSImage = {
@ -418,7 +418,7 @@
startAnimation:,
stopAnimation:
);
Super = NSObject;
Super = NSView;
};
NSResponder = {

93
Gorm.m
View file

@ -722,7 +722,7 @@ NSString *GormWillDetachObjectFromDocumentNotification = @"GormWillDetachObjectF
if (testContainer != nil)
{
[testContainer awakeWithContext: nil];
RETAIN(testContainer);
// RETAIN(testContainer);
}
/*
@ -1288,7 +1288,7 @@ NSString *GormWillDetachObjectFromDocumentNotification = @"GormWillDetachObjectF
{
return NO;
}
else if(![(GormDocument *)[self activeDocument] isTopLevelObject: o])
else if(![active isTopLevelObject: o])
{
return NO;
}
@ -1300,23 +1300,102 @@ NSString *GormWillDetachObjectFromDocumentNotification = @"GormWillDetachObjectF
sel_eq(action, @selector(addAttributeToClass:)) ||
sel_eq(action, @selector(remove:)))
{
id document = [(id<IB>)NSApp activeDocument];
if(document == nil)
if(active == nil)
{
return NO;
}
if(![document isEditingClasses])
if(![active isEditingClasses])
{
return NO;
}
if(sel_eq(action, @selector(instantiateClass:)))
{
NSArray *s = [selectionOwner selection];
id o = nil;
NSString *name = nil;
if ([s count] == 0)
{
return NO;
}
if ([s count] > 1)
{
return NO;
}
o = [s objectAtIndex: 0];
name = [o className];
if(name != nil)
{
id cm = [self classManager];
// there are some classes which can't be instantiated directly
// in Gorm.
if([cm isSuperclass: @"NSCell" linkedToClass: name] ||
[name isEqualToString: @"NSCell"])
{
return NO;
}
else if([name isEqualToString: @"NSDocument"])
{
return NO;
}
else if([name isEqualToString: @"NSDocumentController"])
{
return NO;
}
else if([name isEqualToString: @"NSFontManager"])
{
return NO;
}
else if([name isEqualToString: @"NSHelpManager"])
{
return NO;
}
else if([name isEqualToString: @"NSImage"])
{
return NO;
}
else if([cm isSuperclass: @"NSMenuItem" linkedToClass: name] ||
[name isEqualToString: @"NSMenuItem"])
{
return NO;
}
else if([name isEqualToString: @"NSResponder"])
{
return NO;
}
else if([cm isSuperclass: @"NSSound" linkedToClass: name] ||
[name isEqualToString: @"NSSound"])
{
return NO;
}
else if([cm isSuperclass: @"NSTableColumn" linkedToClass: name] ||
[name isEqualToString: @"NSTableColumn"])
{
return NO;
}
else if([cm isSuperclass: @"NSTableViewItem" linkedToClass: name] ||
[name isEqualToString: @"NSTableViewItem"])
{
return NO;
}
else if([cm isSuperclass: @"NSView" linkedToClass: name] ||
[name isEqualToString: @"NSView"])
{
return NO;
}
NSDebugLog(@"Selection is %@",name);
}
}
}
else if(sel_eq(action, @selector(loadSound:)) ||
sel_eq(action, @selector(loadImage:)) ||
sel_eq(action, @selector(debug:)))
{
id document = [(id<IB>)NSApp activeDocument];
if(document == nil)
if(active == nil)
{
return NO;
}

View file

@ -175,12 +175,13 @@ static NSImage *classesImage = nil;
}
}
/*
- (void) awakeWithContext: (NSDictionary *)context
{
// do nothing.. This is defined to override the one in GSNibContainer.
RETAIN(self);
NSLog(@"In awakeWithContext");
}
*/
- (void) addConnector: (id<IBConnectors>)aConnector
{
@ -239,7 +240,6 @@ static NSImage *classesImage = nil;
* Add top-level objects to objectsView and open their editors.
*/
if ([anObject isKindOfClass: [NSWindow class]] == YES
// || [anObject isKindOfClass: [NSMenu class]] == YES
|| [anObject isKindOfClass: [GSNibItem class]] == YES)
{
[objectsView addObject: anObject];
@ -1892,14 +1892,14 @@ static NSImage *classesImage = nil;
* by the gui library are converted to their Gorm internal equivalents.
*/
u = AUTORELEASE([[NSUnarchiver alloc] initForReadingWithData: data]);
// classes
[u decodeClassName: @"GSNibContainer"
asClassName: @"GormDocument"];
[u decodeClassName: @"GSNibItem"
asClassName: @"GormObjectProxy"];
[u decodeClassName: @"GSCustomView"
asClassName: @"GormCustomView"];
// classes
[u decodeClassName: @"NSMenu"
asClassName: @"GormNSMenu"];
[u decodeClassName: @"NSWindow"