Correction for problem found by Riccardo Mattolla. Cleanup.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@22676 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-03-19 01:16:18 +00:00
parent 270338574f
commit 5a923726a1
4 changed files with 26 additions and 22 deletions

View file

@ -1,3 +1,11 @@
2006-03-18 20:12 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormDocument.m: Generalize rule for adding documentView
objects from a scrollview.
* GormCore/GormInspectorsManager.m: Correct logic which selects the
object to send to the inspector.
* GormCore/GormScrollViewEditor.m: Cleanup code a little bit.
2006-03-16 06:33 Gregory John Casamento <greg_casamento@yahoo.com> 2006-03-16 06:33 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormViewWithContentViewEditor.m: Correction related to * GormCore/GormViewWithContentViewEditor.m: Correction related to

View file

@ -673,7 +673,7 @@ static NSImage *fileImage = nil;
toParent: tv]; toParent: tv];
} }
} }
else if ([[anObject documentView] isKindOfClass: [NSTextView class]] == YES) else // if ([[anObject documentView] isKindOfClass: [NSTextView class]] == YES)
{ {
[self attachObject: [anObject documentView] toParent: anObject]; [self attachObject: [anObject documentView] toParent: anObject];
} }

View file

@ -296,12 +296,12 @@
if ([obj isKindOfClass: [NSScrollView class]] && if ([obj isKindOfClass: [NSScrollView class]] &&
[(NSScrollView *)obj documentView]) [(NSScrollView *)obj documentView])
{ {
// && [[(NSScrollView *)obj documentView] conformsToProtocol: @protocol(IBEditors)] == NO) id docView = [(NSScrollView *)obj documentView];
obj = [(NSScrollView *)obj documentView]; // FIXME: Really need to find a more generalized way to do this.
// FIXME: Find a more generalized way to do this. if ([docView isKindOfClass: [NSTableView class]])
if ([obj isKindOfClass: [NSTableView class]])
{ {
obj = docView;
if ([obj selectedColumn] != -1) if ([obj selectedColumn] != -1)
{ {
obj = [[obj tableColumns] objectAtIndex: obj = [[obj tableColumns] objectAtIndex:

View file

@ -3,6 +3,7 @@
* Copyright (C) 2002 Free Software Foundation, Inc. * Copyright (C) 2002 Free Software Foundation, Inc.
* *
* Author: Pierre-Yves Rivaille <pyrivail@ens-lyon.fr> * Author: Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 2002 * Date: 2002
* *
* This file is part of GNUstep. * This file is part of GNUstep.
@ -23,11 +24,10 @@
*/ */
#include <AppKit/AppKit.h> #include <AppKit/AppKit.h>
#include <InterfaceBuilder/IBObjectAdditions.h>
#include "GormPrivate.h" #include "GormPrivate.h"
#include "GormBoxEditor.h" #include "GormBoxEditor.h"
#include "GormViewKnobs.h" #include "GormViewKnobs.h"
#include <InterfaceBuilder/IBObjectAdditions.h>
@implementation NSScrollView (IBObjectAdditions) @implementation NSScrollView (IBObjectAdditions)
- (NSString *) inspectorClassName - (NSString *) inspectorClassName
@ -153,16 +153,14 @@
if ((self = [super initWithObject: anObject if ((self = [super initWithObject: anObject
inDocument: aDocument]) == nil) inDocument: aDocument]) == nil)
{
return nil; return nil;
}
selection = [[NSMutableArray alloc] initWithCapacity: 5]; selection = [[NSMutableArray alloc] initWithCapacity: 5];
[self registerForDraggedTypes: [NSArray arrayWithObjects: [self registerForDraggedTypes: [NSArray arrayWithObjects:
IBViewPboardType, GormLinkPboardType, IBFormatterPboardType, nil]]; IBViewPboardType, GormLinkPboardType, IBFormatterPboardType, nil]];
return self; return self;
} }
@ -171,6 +169,7 @@
id documentView = [_EO documentView]; id documentView = [_EO documentView];
NSArray *subviews = [documentView subviews]; NSArray *subviews = [documentView subviews];
NSMutableArray *newSelection = [NSMutableArray array]; NSMutableArray *newSelection = [NSMutableArray array];
id thisView = nil;
if([documentView conformsToProtocol: @protocol(IBEditors)] == YES) if([documentView conformsToProtocol: @protocol(IBEditors)] == YES)
{ {
@ -200,16 +199,13 @@
frame = [parent convertRect: frame fromView: _EO]; frame = [parent convertRect: frame fromView: _EO];
[documentView setFrame: frame]; [documentView setFrame: frame];
[newSelection addObject: documentView]; [newSelection addObject: documentView];
[_EO setDocumentView: nil]; // remove any reference to the box. [_EO setDocumentView: nil];
// RELEASE(_EO);
} }
{ thisView = [self editedObject];
id thisView = [self editedObject];
[self close]; [self close];
[thisView removeFromSuperview]; [thisView removeFromSuperview];
[document detachObject: thisView]; [document detachObject: thisView];
}
return newSelection; return newSelection;
} }