parent->child connection fixes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21658 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-08-19 01:05:46 +00:00
parent 831d3256d2
commit 08f846d1df
3 changed files with 24 additions and 10 deletions

View file

@ -1,3 +1,12 @@
2005-08-18 21:02 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormDocument.m: attachObject:toParent: added code to insert
the content view into the nametable and the parent->child
connections.
* GormCore/GormViewWithContentViewEditor.m: in the group* methods added
code to "reparent" the objects so that the parent->child relationships
are reset to represent the reflect the new relationship.
2005-08-18 20:21 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormDocument.m: Remove commented out code.
@ -11,7 +20,8 @@
are added and deleted.
* Palettes/3Containers/GormTabViewEditor.m: Streamlined code in
delegate.
Corrects bug#14004.
2005-08-12 01:23 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormClassEditor.m: Correction for crash when loading

View file

@ -522,11 +522,14 @@ static NSImage *fileImage = nil;
{
[objectsView addObject: anObject];
[topLevelObjects addObject: anObject];
[[self openEditorForObject: anObject] activate];
if ([anObject isKindOfClass: [NSWindow class]] == YES)
{
// Turn off the release when closed flag, add the content view.
[anObject setReleasedWhenClosed: NO];
[self attachObject: [(NSWindow *)anObject contentView]
toParent: anObject];
}
[[self openEditorForObject: anObject] activate];
}
else if((aParent == filesOwner || aParent == nil) &&
[anObject isKindOfClass: [NSMenu class]] == NO)
@ -543,17 +546,15 @@ static NSImage *fileImage = nil;
[topLevelObjects addObject: anObject];
}
}
/*
* Check if it's a font manager.
*/
else if([anObject isKindOfClass: [NSFontManager class]])
{
// if someone tries to attach a font manager, we must attach
// If someone tries to attach a font manager, we must attach
// the proxy instead.
[self _instantiateFontManager];
}
/*
* Add the current menu and any submenus.
*/
@ -561,7 +562,7 @@ static NSImage *fileImage = nil;
{
BOOL isMainMenu = NO;
// if there is no main menu and a menu gets added, it
// If there is no main menu and a menu gets added, it
// will become the main menu.
if([self objectForName: @"NSMenu"] == nil)
{
@ -584,7 +585,7 @@ static NSImage *fileImage = nil;
[[self openEditorForObject: anObject] activate];
// if it's the main menu... locate it appropriately...
// If it's the main menu... locate it appropriately...
if(isMainMenu)
{
NSRect frame = [window frame];
@ -592,13 +593,12 @@ static NSImage *fileImage = nil;
origin.y += (frame.size.height + 150);
// place the main menu appropriately...
// Place the main menu appropriately...
[[anObject window] setFrameTopLeftPoint: origin];
}
}
/*
* if this a scrollview, it is interesting to add its contentview
* if it is a tableview or a textview
* If this a scrollview, it is interesting to add its contentview.
*/
else if (([anObject isKindOfClass: [NSScrollView class]] == YES)
&& ([(NSScrollView *)anObject documentView] != nil))

View file

@ -1034,6 +1034,8 @@ int _sortViews(id view1, id view2, void *context)
frameOrigin.x -= rect.origin.x;
frameOrigin.y -= rect.origin.y;
[[subview editedObject] setFrameOrigin: frameOrigin];
[document attachObject: [subview editedObject]
toParent: box];
[subview close];
}
@ -1096,6 +1098,8 @@ int _sortViews(id view1, id view2, void *context)
frameOrigin.x -= rect.origin.x;
frameOrigin.y -= rect.origin.y;
[[subview editedObject] setFrameOrigin: frameOrigin];
[document attachObject: [subview editedObject]
toParent: scrollView];
[subview close];
}
}