More changes for standalone views.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@19782 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-07-28 03:54:42 +00:00
parent ee2888370c
commit 055388add7
4 changed files with 27 additions and 7 deletions

View file

@ -1,3 +1,14 @@
2004-07-27 02:15 Gregory John Casamento <greg_casamento@yahoo.com>
* GormLib/IBInspector.m: Change the name of the method called
when receiving IBDocumentWillCloseNotification to _releaseObject:
instead of handleNotification:. This prevents confusion as some
of the subclasses define handleNotification for other
purposes.
* GormDocument.m: Modified the code in instantiateObject so that
NSView itself can be instantiated.
2004-07-27 02:15 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: Cleaned up some commented out code.

View file

@ -1448,7 +1448,7 @@ static NSImage *fileImage = nil;
[link setDestination: editor];
[connections addObject: link];
if(![openEditors containsObject: editor])
if(![openEditors containsObject: editor] && editor != nil)
{
[openEditors addObject: editor];
}
@ -1727,7 +1727,8 @@ static NSImage *fileImage = nil;
if([object isEqualToString: @"FirstResponder"])
return nil;
if([classManager isSuperclass: @"NSView" linkedToClass: object])
if([classManager isSuperclass: @"NSView" linkedToClass: object] ||
[object isEqual: @"NSView"])
{
Class cls;
NSString *className = object;

View file

@ -45,7 +45,7 @@ static NSNotificationCenter *nc = nil;
if((self = [super init]) != nil)
{
[nc addObserver: self
selector: @selector(handleNotification:)
selector: @selector(_releaseObject:)
name: IBWillCloseDocumentNotification
object: nil];
}
@ -60,7 +60,7 @@ static NSNotificationCenter *nc = nil;
[super dealloc];
}
- (void) handleNotification: (NSNotification *)notification
- (void) _releaseObject: (NSNotification *)notification
{
id<IBDocuments> doc = [notification object];
if([doc nameForObject: object] != nil)

View file

@ -1357,11 +1357,19 @@ static BOOL currently_displaying = NO;
- (void) resetObject: (id)anObject
{
/// NSLog(@"resetObject should not be called on GormViewEditor !");
if(viewWindow != nil)
NS_DURING
{
[viewWindow orderFront: self];
// display the view, if it's standalone.
if(viewWindow != nil)
{
[viewWindow orderFront: self];
}
}
NS_HANDLER
{
NSLog(@"Exception while trying to display standalone view: %@",[localException reason]);
}
NS_ENDHANDLER
}
- (void) orderFront