DnD fromViews palette into windows

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@5512 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-12-14 20:20:41 +00:00
parent 01100bd4b6
commit f6fb99002f
5 changed files with 30 additions and 13 deletions

View file

@ -1,6 +1,14 @@
Tue Dec 14 20:13:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
Enough for today.
* View/View.m: Added a single button to the 'View' palette.
* GormPaletteManager.m: improve DnD image ffset code.
* GormWindowEditor.m: accept dropped views in window.
Tue Dec 14 19:53:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
Removed GormResourcesManager - merged functionality into GormDocument
Loads of other minor changes too - hopefully all simplified a bit.
Tue Dec 14 17:33:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>

View file

@ -885,13 +885,6 @@ static NSImage *classesImage = nil;
[win setFrameTopLeftPoint: screenPoint];
}
}
else
{
NSLog(@"Pasting %@ not implemented", aType);
objects = nil;
/* FIXME */
}
[self attachObjects: objects toParent: parent];
[self touch];
return objects;

View file

@ -158,8 +158,8 @@ static NSImage *dragImage = nil;
NSImageRep *rep;
NSSize offset;
offset.width = mouseDownPoint.x - dragPoint.x;
offset.height = mouseDownPoint.y - dragPoint.y;
offset.width = rect.origin.x - dragPoint.x;
offset.height = rect.origin.y - dragPoint.y;
RELEASE(dragImage);
dragImage = [NSImage new];

View file

@ -436,7 +436,7 @@
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
{
NSPoint loc = [sender draggingLocation];
NSPoint loc = [sender draggedImageLocation];
NSPasteboard *pb = [sender draggingPasteboard];
NSArray *views;
NSEnumerator *enumerator;
@ -451,10 +451,9 @@
parent: edited];
/*
* Now make all the views subviews of ourself, setting their origin to be
* the point at which they were dropped (which we convert from screen
* coordinates to our own coordinates).
* the point at which they were dropped (converted from window coordinates
* to our own coordinates).
*/
loc = [[self window] convertScreenToBase: loc];
loc = [self convertPoint: loc fromView: nil];
enumerator = [views objectEnumerator];
while ((sub = [enumerator nextObject]) != nil)

View file

@ -32,5 +32,22 @@
@end
@implementation ViewPalette
- (void) finishInstantiate
{
NSView *contents;
id v;
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, 272, 192)
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreRetained
defer: NO];
contents = [window contentView];
v = [[NSButton alloc] initWithFrame: NSMakeRect(35, 60, 80, 20)];
[v setBordered: YES];
[v setTitle: @"Button"];
[contents addSubview: v];
RELEASE(v);
}
@end