mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 03:51:22 +00:00
Correction for Report#6890
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18430 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7914bf834d
commit
6cfc472fcf
6 changed files with 94 additions and 24 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
||||||
|
2004-01-17 23:07 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* GormViewEditor.[hm]: Addition of selection and makeSelectionVisible
|
||||||
|
methods to allow views to exist within a scrollview without a
|
||||||
|
containing NSView.
|
||||||
|
* GormViewWithContentViewEditor.m: Changed code in
|
||||||
|
groupSelectionInScrollView to not insert a NSView to contain the
|
||||||
|
subview being grouped in the case where there is only one
|
||||||
|
view selected. These fixes correct Report#6890.
|
||||||
|
|
||||||
|
2004-01-14 10:26 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* ClassInformation.plist: Added submenuAction: to the NSMenu
|
||||||
|
class.
|
||||||
|
|
||||||
2004-01-14 01:42 Gregory John Casamento <greg_casamento@yahoo.com>
|
2004-01-14 01:42 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* GormDocument.m: attachObject:toParent: when the connection
|
* GormDocument.m: attachObject:toParent: when the connection
|
||||||
|
|
|
@ -378,6 +378,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
NSMenu = {
|
NSMenu = {
|
||||||
|
Actions = (
|
||||||
|
submenuAction:
|
||||||
|
);
|
||||||
Super = NSObject;
|
Super = NSObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -603,7 +603,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation NSTextField (GormObjectAdditions)
|
@implementation NSTextField (GormObjectAdditions)
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
- (void) detachSubviews;
|
- (void) detachSubviews;
|
||||||
- (void) postDraw: (NSRect) rect;
|
- (void) postDraw: (NSRect) rect;
|
||||||
- (id) parent;
|
- (id) parent;
|
||||||
|
- (NSArray *)selection;
|
||||||
|
- (void) makeSelectionVisible: (BOOL) value;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GormViewEditor (EditingAdditions)
|
@interface GormViewEditor (EditingAdditions)
|
||||||
|
|
|
@ -1406,6 +1406,23 @@ static BOOL currently_displaying = NO;
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray*) selection
|
||||||
|
{
|
||||||
|
NSMutableArray *result = [NSMutableArray arrayWithCapacity: 1];
|
||||||
|
|
||||||
|
// add self to the result...
|
||||||
|
if ([self respondsToSelector: @selector(editedObject)])
|
||||||
|
[result addObject: [self editedObject]];
|
||||||
|
else
|
||||||
|
[result addObject: self];
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) makeSelectionVisible: (BOOL) value
|
||||||
|
{
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1061,42 +1061,76 @@ int _sortViews(id view1, id view2, void *context)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
enumerator = [selection objectEnumerator];
|
// if there is more than one view we must join them together.
|
||||||
|
if([selection count] > 1)
|
||||||
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];
|
superview = [subview superview];
|
||||||
rect = NSUnionRect(rect, [subview frame]);
|
rect = NSUnionRect(rect, [subview frame]);
|
||||||
[subview deactivate];
|
[subview deactivate];
|
||||||
}
|
|
||||||
|
|
||||||
view = [[NSView alloc] initWithFrame:
|
// create scroll view now.
|
||||||
NSMakeRect(0, 0, rect.size.width, rect.size.height)];
|
scrollView = [[NSScrollView alloc] initWithFrame: rect];
|
||||||
scrollView = [[NSScrollView alloc] initWithFrame: rect];
|
[scrollView setHasHorizontalScroller: YES];
|
||||||
[scrollView setHasHorizontalScroller: YES];
|
[scrollView setHasVerticalScroller: YES];
|
||||||
[scrollView setHasVerticalScroller: YES];
|
[scrollView setBorderType: NSBezelBorder];
|
||||||
[scrollView setBorderType: NSBezelBorder];
|
|
||||||
|
|
||||||
[document attachObject: scrollView
|
// attach the scroll view...
|
||||||
toParent: _editedObject];
|
[document attachObject: scrollView
|
||||||
|
toParent: _editedObject];
|
||||||
|
[superview addSubview: scrollView];
|
||||||
|
[scrollView setDocumentView: [subview editedObject]];
|
||||||
|
|
||||||
[superview addSubview: scrollView];
|
// set the origin..
|
||||||
[scrollView setDocumentView: view];
|
|
||||||
|
|
||||||
|
|
||||||
enumerator = [selection objectEnumerator];
|
|
||||||
|
|
||||||
while ((subview = [enumerator nextObject]) != nil)
|
|
||||||
{
|
|
||||||
NSPoint frameOrigin;
|
|
||||||
[view addSubview: [subview editedObject]];
|
|
||||||
frameOrigin = [[subview editedObject] frame].origin;
|
frameOrigin = [[subview editedObject] frame].origin;
|
||||||
frameOrigin.x -= rect.origin.x;
|
frameOrigin.x -= rect.origin.x;
|
||||||
frameOrigin.y -= rect.origin.y;
|
frameOrigin.y -= rect.origin.y;
|
||||||
[[subview editedObject] setFrameOrigin: frameOrigin];
|
[[subview editedObject] setFrameOrigin: frameOrigin];
|
||||||
[subview close];
|
[subview close];
|
||||||
}
|
}
|
||||||
|
|
||||||
editor = [document editorForObject: scrollView
|
editor = [document editorForObject: scrollView
|
||||||
inEditor: self
|
inEditor: self
|
||||||
create: YES];
|
create: YES];
|
||||||
|
|
Loading…
Reference in a new issue