mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Backed out change to prevent crash. Will recommit once all functionality is working.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18443 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6cfc472fcf
commit
a98f69721a
2 changed files with 27 additions and 57 deletions
|
@ -1,3 +1,7 @@
|
|||
2004-01-20 08:53 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormViewWithContentViewEditor.m: Backing out previous change.
|
||||
|
||||
2004-01-17 23:07 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormViewEditor.[hm]: Addition of selection and makeSelectionVisible
|
||||
|
|
|
@ -1061,76 +1061,42 @@ int _sortViews(id view1, id view2, void *context)
|
|||
return;
|
||||
}
|
||||
|
||||
// if there is more than one view we must join them together.
|
||||
if([selection count] > 1)
|
||||
enumerator = [selection objectEnumerator];
|
||||
|
||||
while ((subview = [enumerator nextObject]) != nil)
|
||||
{
|
||||
// deactivate the editor for each subview.
|
||||
enumerator = [selection objectEnumerator];
|
||||
while ((subview = [enumerator nextObject]) != nil)
|
||||
{
|
||||
superview = [subview superview];
|
||||
rect = NSUnionRect(rect, [subview frame]);
|
||||
[subview deactivate];
|
||||
}
|
||||
|
||||
// create the containing view.
|
||||
view = [[NSView alloc] initWithFrame:
|
||||
NSMakeRect(0, 0, rect.size.width, rect.size.height)];
|
||||
// create scroll view now.
|
||||
scrollView = [[NSScrollView alloc] initWithFrame: rect];
|
||||
[scrollView setHasHorizontalScroller: YES];
|
||||
[scrollView setHasVerticalScroller: YES];
|
||||
[scrollView setBorderType: NSBezelBorder];
|
||||
|
||||
// attach the scroll view...
|
||||
[document attachObject: scrollView
|
||||
toParent: _editedObject];
|
||||
[superview addSubview: scrollView];
|
||||
[scrollView setDocumentView: view];
|
||||
|
||||
// add the views.
|
||||
enumerator = [selection objectEnumerator];
|
||||
while ((subview = [enumerator nextObject]) != nil)
|
||||
{
|
||||
NSPoint frameOrigin;
|
||||
[view addSubview: [subview editedObject]];
|
||||
frameOrigin = [[subview editedObject] frame].origin;
|
||||
frameOrigin.x -= rect.origin.x;
|
||||
frameOrigin.y -= rect.origin.y;
|
||||
[[subview editedObject] setFrameOrigin: frameOrigin];
|
||||
[subview close];
|
||||
}
|
||||
}
|
||||
else if([selection count] == 1)
|
||||
{
|
||||
NSPoint frameOrigin;
|
||||
|
||||
// since we have one view, it will be used as the document view.
|
||||
subview = [selection objectAtIndex: 0];
|
||||
superview = [subview superview];
|
||||
rect = NSUnionRect(rect, [subview frame]);
|
||||
[subview deactivate];
|
||||
}
|
||||
|
||||
// create scroll view now.
|
||||
scrollView = [[NSScrollView alloc] initWithFrame: rect];
|
||||
[scrollView setHasHorizontalScroller: YES];
|
||||
[scrollView setHasVerticalScroller: YES];
|
||||
[scrollView setBorderType: NSBezelBorder];
|
||||
view = [[NSView alloc] initWithFrame:
|
||||
NSMakeRect(0, 0, rect.size.width, rect.size.height)];
|
||||
scrollView = [[NSScrollView alloc] initWithFrame: rect];
|
||||
[scrollView setHasHorizontalScroller: YES];
|
||||
[scrollView setHasVerticalScroller: YES];
|
||||
[scrollView setBorderType: NSBezelBorder];
|
||||
|
||||
// attach the scroll view...
|
||||
[document attachObject: scrollView
|
||||
toParent: _editedObject];
|
||||
[superview addSubview: scrollView];
|
||||
[scrollView setDocumentView: [subview editedObject]];
|
||||
[document attachObject: scrollView
|
||||
toParent: _editedObject];
|
||||
|
||||
// set the origin..
|
||||
[superview addSubview: scrollView];
|
||||
[scrollView setDocumentView: view];
|
||||
|
||||
|
||||
enumerator = [selection objectEnumerator];
|
||||
|
||||
while ((subview = [enumerator nextObject]) != nil)
|
||||
{
|
||||
NSPoint frameOrigin;
|
||||
[view addSubview: [subview editedObject]];
|
||||
frameOrigin = [[subview editedObject] frame].origin;
|
||||
frameOrigin.x -= rect.origin.x;
|
||||
frameOrigin.y -= rect.origin.y;
|
||||
[[subview editedObject] setFrameOrigin: frameOrigin];
|
||||
[subview close];
|
||||
}
|
||||
|
||||
|
||||
editor = [document editorForObject: scrollView
|
||||
inEditor: self
|
||||
create: YES];
|
||||
|
|
Loading…
Reference in a new issue