mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
* GormCore/GormInternalViewEditor.m
* GormCore/GormScrollViewEditor.m * GormCore/GormSplitViewEditor.m * GormCore/GormViewEditor.m * GormCore/GormViewWithContentViewEditor.m: Corrections for bug#18171. Fixes issues with grouping and ungrouping. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@26077 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
053d911cfe
commit
a253bae6ee
6 changed files with 46 additions and 62 deletions
|
@ -1,3 +1,12 @@
|
|||
2008-02-17 01:07-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormCore/GormInternalViewEditor.m
|
||||
* GormCore/GormScrollViewEditor.m
|
||||
* GormCore/GormSplitViewEditor.m
|
||||
* GormCore/GormViewEditor.m
|
||||
* GormCore/GormViewWithContentViewEditor.m: Corrections for bug#18171.
|
||||
Fixes issues with grouping and ungrouping.
|
||||
|
||||
2008-02-16 20:54-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Palettes/2Controls/GormSliderAttributesInspector.m: Cleaned up
|
||||
|
|
|
@ -905,43 +905,29 @@ static NSImage *horizontalImage;
|
|||
|
||||
- (NSArray *)destroyAndListSubviews
|
||||
{
|
||||
if ([parent isKindOfClass: [GormBoxEditor class]]
|
||||
&&
|
||||
([[parent parent] isKindOfClass:
|
||||
[GormViewWithContentViewEditor class]]
|
||||
|| [[parent parent] isKindOfClass:
|
||||
[GormSplitViewEditor class]]))
|
||||
NSEnumerator *enumerator = [[_editedObject subviews] objectEnumerator];
|
||||
GormViewEditor *subview;
|
||||
NSMutableArray *newSelection = [NSMutableArray array];
|
||||
|
||||
[[parent parent] makeSubeditorResign];
|
||||
|
||||
while ((subview = [enumerator nextObject]) != nil)
|
||||
{
|
||||
NSEnumerator *enumerator = [[_editedObject subviews] objectEnumerator];
|
||||
GormViewEditor *subview;
|
||||
NSMutableArray *newSelection = [NSMutableArray array];
|
||||
|
||||
[[parent parent] makeSubeditorResign];
|
||||
|
||||
while ((subview = [enumerator nextObject]) != nil)
|
||||
{
|
||||
id v;
|
||||
NSRect frame;
|
||||
v = [subview editedObject];
|
||||
frame = [v frame];
|
||||
frame = [[parent parent] convertRect: frame
|
||||
fromView: _editedObject];
|
||||
[subview deactivate];
|
||||
|
||||
[v setFrame: frame];
|
||||
[newSelection addObject: v];
|
||||
}
|
||||
|
||||
{
|
||||
id thisView = [parent editedObject];
|
||||
[parent close];
|
||||
[thisView removeFromSuperview];
|
||||
[document detachObject: thisView];
|
||||
}
|
||||
id v;
|
||||
NSRect frame;
|
||||
v = [subview editedObject];
|
||||
frame = [v frame];
|
||||
frame = [[parent parent] convertRect: frame
|
||||
fromView: _editedObject];
|
||||
[subview deactivate];
|
||||
|
||||
return newSelection;
|
||||
[v setFrame: frame];
|
||||
[newSelection addObject: v];
|
||||
}
|
||||
return nil;
|
||||
|
||||
[parent close];
|
||||
|
||||
return newSelection;
|
||||
}
|
||||
|
||||
- (void) deleteSelection: (id) sender
|
||||
|
|
|
@ -187,7 +187,6 @@
|
|||
id documentView = [_EO documentView];
|
||||
NSArray *subviews = [documentView subviews];
|
||||
NSMutableArray *newSelection = [NSMutableArray array];
|
||||
id thisView = nil;
|
||||
|
||||
if([documentView conformsToProtocol: @protocol(IBEditors)] == YES)
|
||||
{
|
||||
|
@ -195,6 +194,9 @@
|
|||
NSEnumerator *enumerator = [[internalView subviews] objectEnumerator];
|
||||
GormViewEditor *subview;
|
||||
|
||||
if([[documentView editedObject] isKindOfClass: [NSTextView class]])
|
||||
return newSelection;
|
||||
|
||||
[parent makeSubeditorResign];
|
||||
while ((subview = [enumerator nextObject]) != nil)
|
||||
{
|
||||
|
@ -213,6 +215,9 @@
|
|||
{
|
||||
NSRect frame = [documentView frame];
|
||||
|
||||
if([documentView isKindOfClass: [NSTextView class]])
|
||||
return newSelection;
|
||||
|
||||
// In this case the view editor is the documentView and
|
||||
// we need to add the internal view back into the superview
|
||||
frame = [parent convertRect: frame fromView: _EO];
|
||||
|
@ -221,11 +226,7 @@
|
|||
[_EO setDocumentView: nil];
|
||||
}
|
||||
|
||||
thisView = [self editedObject];
|
||||
[self close];
|
||||
[thisView removeFromSuperview];
|
||||
[document detachObject: thisView];
|
||||
|
||||
return newSelection;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -361,6 +361,7 @@
|
|||
NSEnumerator *enumerator = [[_EO subviews] objectEnumerator];
|
||||
GormViewEditor *subview;
|
||||
NSMutableArray *newSelection = [NSMutableArray array];
|
||||
id thisView = [self editedObject];
|
||||
|
||||
[parent makeSubeditorResign];
|
||||
|
||||
|
@ -378,12 +379,7 @@
|
|||
[newSelection addObject: v];
|
||||
}
|
||||
|
||||
{
|
||||
id thisView = [self editedObject];
|
||||
[self close];
|
||||
[thisView removeFromSuperview];
|
||||
[document detachObject: thisView];
|
||||
}
|
||||
[self close];
|
||||
return newSelection;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -304,11 +304,13 @@ static BOOL currently_displaying = NO;
|
|||
|
||||
// if this window is nil when the editor is created, we know it's a
|
||||
// standalone view.
|
||||
/*
|
||||
if([anObject window] == nil)
|
||||
{
|
||||
NSDebugLog(@"#### Stand alone view: %@",_editedObject);
|
||||
viewWindow = [[GormViewWindow alloc] initWithView: _editedObject];
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
return self;
|
||||
|
|
|
@ -1153,24 +1153,14 @@ int _sortViews(id view1, id view2, void *context)
|
|||
|
||||
- (void) _addViewToDocument: (NSView *)view
|
||||
{
|
||||
NSEnumerator *en = nil;
|
||||
NSView *sub = nil;
|
||||
NSView *par = [view superview];
|
||||
|
||||
if([sub isKindOfClass: [GormViewEditor class]])
|
||||
return;
|
||||
|
||||
if([par isKindOfClass: [GormViewEditor class]])
|
||||
{
|
||||
par = [(GormViewEditor *)par editedObject];
|
||||
}
|
||||
|
||||
[document attachObject: view toParent: par];
|
||||
en = [[view subviews] objectEnumerator];
|
||||
while((sub = [en nextObject]) != nil)
|
||||
{
|
||||
[self _addViewToDocument: sub];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) ungroup
|
||||
|
@ -1186,12 +1176,10 @@ int _sortViews(id view1, id view2, void *context)
|
|||
|
||||
NSDebugLog(@"toUngroup = %@",[toUngroup description]);
|
||||
|
||||
if ([toUngroup isKindOfClass: [GormBoxEditor class]]
|
||||
|| [toUngroup isKindOfClass: [GormSplitViewEditor class]]
|
||||
|| [toUngroup isKindOfClass: [GormScrollViewEditor class]]
|
||||
)
|
||||
if ([toUngroup respondsToSelector: @selector(destroyAndListSubviews)])
|
||||
{
|
||||
id contentView = toUngroup;
|
||||
id eo = [contentView editedObject];
|
||||
|
||||
NSMutableArray *newSelection = [NSMutableArray array];
|
||||
NSArray *views;
|
||||
|
@ -1202,15 +1190,17 @@ int _sortViews(id view1, id view2, void *context)
|
|||
id v = [views objectAtIndex: i];
|
||||
[_editedObject addSubview: v];
|
||||
[self _addViewToDocument: v];
|
||||
|
||||
[newSelection addObject:
|
||||
[document editorForObject: v
|
||||
inEditor: self
|
||||
create: YES]];
|
||||
}
|
||||
[self selectObjects: newSelection];
|
||||
|
||||
}
|
||||
|
||||
[contentView close];
|
||||
[self selectObjects: newSelection];
|
||||
[eo removeFromSuperview];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) pasteInView: (NSView *)view
|
||||
|
|
Loading…
Reference in a new issue