From 08f846d1dff5fbfd5f83259c46450f2592238641 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 19 Aug 2005 01:05:46 +0000 Subject: [PATCH] parent->child connection fixes. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21658 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 12 +++++++++++- GormCore/GormDocument.m | 18 +++++++++--------- GormCore/GormViewWithContentViewEditor.m | 4 ++++ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d0940ea..fa1b1206 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-08-18 21:02 Gregory John Casamento + + * 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 * 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 * GormCore/GormClassEditor.m: Correction for crash when loading diff --git a/GormCore/GormDocument.m b/GormCore/GormDocument.m index c28e8e3c..91710b75 100644 --- a/GormCore/GormDocument.m +++ b/GormCore/GormDocument.m @@ -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)) diff --git a/GormCore/GormViewWithContentViewEditor.m b/GormCore/GormViewWithContentViewEditor.m index 88f84c29..4802c625 100644 --- a/GormCore/GormViewWithContentViewEditor.m +++ b/GormCore/GormViewWithContentViewEditor.m @@ -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]; } }