Silence warning and create editor for cell

This commit is contained in:
Gregory John Casamento 2022-03-26 13:57:30 -04:00
parent ca58e9480c
commit b36ec0e29a
3 changed files with 38 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2022-03-26 Gregory John Casamento <greg.casamento@gmail.com>
* GormCore/GormClassEditor.m: Add coercion to (id) to silence
warning.
* GormCore/GormDocument.m: Add editor when editing a class
with a cell. This will allow Gorm to bring up an inspector.
2021-10-19 Gregory John Casamento <greg.casamento@gmail.com>
* GormCore/GormNSSplitViewInspector.m: Correct crash happening

View file

@ -608,7 +608,7 @@ NSImage *browserImage = nil;
[self reloadData];
[nc postNotificationName: GormDidModifyClassNotification
object: classManager];
ASSIGN(selectedClass, nil); // don't keep the class we're pointing to.
ASSIGN(selectedClass, (id)nil); // don't keep the class we're pointing to.
}
}
}

View file

@ -4,10 +4,10 @@
* protocol plus additional methods which are useful for managing the
* contents of the document.
*
* Copyright (C) 1999,2002,2003,2004,2005 Free Software Foundation, Inc.
* Copyright (C) 1999,2002,2003,2004,2005,2020,2021 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 2002,2003,2004,2005
* Date: 2002,2003,2004,2005,2020,2021
* Author: Richard Frith-Macdonald <richard@brainstrom.co.uk>
* Date: 1999
*
@ -791,11 +791,27 @@ static NSImage *fileImage = nil;
// Add all subviews from the window, if any.
[self attachObjects: [view subviews] toParent: view];
}
/*
* Add columns to document hierarchy...
*/
else if ([anObject isKindOfClass: [NSTableView class]]) // this should include outline view
{
NSTableView *tblView = (NSTableView *)anObject;
NSArray *cols = [tblView tableColumns];
[self attachObjects: cols toParent: tblView];
}
else if ([anObject isKindOfClass: [NSSplitView class]])
{
NSSplitView *sp = (NSSplitView *)anObject;
[self attachObjects: [sp subviews] toParent: sp];
}
// Attach the cell of an item to the document so that it has a name and
// can be addressed.
if ([anObject respondsToSelector: @selector(cell)])
{
[self openEditorForObject: [anObject cell]];
[self attachObject: [anObject cell] toParent: anObject];
}
@ -879,6 +895,17 @@ static NSImage *fileImage = nil;
withName: nil];
}
/**
* Attach an object to parent object in document letting Gorm generate the name
* this method will add a top level object.
*/
- (void) attachObject: (id)object
{
[self attachObject: object
toParent: nil
withName: nil];
}
/**
* Attach all objects in anArray to the document with aParent.
*/
@ -1181,7 +1208,7 @@ static NSImage *fileImage = nil;
- (void) dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
ASSIGN(lastEditor, nil);
ASSIGN(lastEditor, (id)nil);
// [filePrefsWindow close];
// Get rid of the selection box.