1999-12-13 17:01:35 +00:00
|
|
|
|
/* GormWindowEditor.m
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 1999 Free Software Foundation, Inc.
|
|
|
|
|
*
|
|
|
|
|
* Author: Richard Frith-Macdonald <richard@brainstrom.co.uk>
|
|
|
|
|
* Date: 1999
|
|
|
|
|
*
|
|
|
|
|
* This file is part of GNUstep.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
2005-04-23 18:43:36 +00:00
|
|
|
|
#include <InterfaceBuilder/IBViewAdditions.h>
|
|
|
|
|
#include <InterfaceBuilder/IBObjectAdditions.h>
|
|
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
|
#include "GormPrivate.h"
|
2003-03-03 09:15:48 +00:00
|
|
|
|
#include "GormViewWithContentViewEditor.h"
|
2004-12-04 22:55:39 +00:00
|
|
|
|
#include "GormInternalViewEditor.h"
|
2005-04-23 18:43:36 +00:00
|
|
|
|
#include "GormViewKnobs.h"
|
|
|
|
|
|
2002-08-14 00:01:42 +00:00
|
|
|
|
#include <math.h>
|
2004-12-04 22:55:39 +00:00
|
|
|
|
|
2002-08-14 00:01:42 +00:00
|
|
|
|
#define _EO ((NSWindow *)_editedObject)
|
|
|
|
|
|
2004-12-04 22:55:39 +00:00
|
|
|
|
@implementation NSWindow (IBObjectAdditions)
|
1999-12-14 17:38:17 +00:00
|
|
|
|
- (NSString*) editorClassName
|
|
|
|
|
{
|
|
|
|
|
return @"GormWindowEditor";
|
|
|
|
|
}
|
2000-01-13 21:19:03 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Method to return the image that should be used to display windows within
|
|
|
|
|
* the matrix containing the objects in a document.
|
|
|
|
|
*/
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (NSImage*) imageForViewer
|
|
|
|
|
{
|
|
|
|
|
static NSImage *image = nil;
|
|
|
|
|
|
|
|
|
|
if (image == nil)
|
|
|
|
|
{
|
|
|
|
|
NSBundle *bundle = [NSBundle mainBundle];
|
|
|
|
|
NSString *path = [bundle pathForImageResource: @"GormWindow"];
|
|
|
|
|
image = [[NSImage alloc] initWithContentsOfFile: path];
|
|
|
|
|
}
|
|
|
|
|
return image;
|
|
|
|
|
}
|
2004-07-21 01:49:07 +00:00
|
|
|
|
@end
|
2002-01-14 04:19:01 +00:00
|
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
|
/*
|
|
|
|
|
* Default implementations of methods used for updating a view by
|
|
|
|
|
* direct action through an editor.
|
|
|
|
|
*/
|
2004-12-04 22:55:39 +00:00
|
|
|
|
@implementation NSView (IBViewAdditions)
|
1999-12-13 17:01:35 +00:00
|
|
|
|
|
|
|
|
|
- (BOOL) acceptsColor: (NSColor*)color atPoint: (NSPoint)point
|
|
|
|
|
{
|
|
|
|
|
return NO; /* Can the view accept a color drag-and-drop? */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) allowsAltDragging
|
|
|
|
|
{
|
|
|
|
|
return NO; /* Can the view be dragged into a matrix? */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) depositColor: (NSColor*)color atPoint: (NSPoint)point
|
|
|
|
|
{
|
|
|
|
|
/* Handle color drop in view. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSSize) maximumSizeFromKnobPosition: (IBKnobPosition)knobPosition
|
|
|
|
|
{
|
|
|
|
|
NSView *s = [self superview];
|
|
|
|
|
NSRect r = (s != nil) ? [s bounds] : [self bounds];
|
|
|
|
|
|
|
|
|
|
return r.size; /* maximum resize permitted */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSSize) minimumSizeFromKnobPosition: (IBKnobPosition)position
|
|
|
|
|
{
|
1999-12-16 18:06:22 +00:00
|
|
|
|
return NSMakeSize(5, 5); /* Minimum resize permitted */
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) placeView: (NSRect)newFrame
|
|
|
|
|
{
|
|
|
|
|
[self setFrame: newFrame]; /* View changed by editor. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
2004-12-04 22:55:39 +00:00
|
|
|
|
@interface NSWindow (GormWindowEditorAdditions)
|
|
|
|
|
- (void) unsetInitialFirstResponder;
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation NSWindow (GormWindowEditorAdditions)
|
|
|
|
|
/*
|
|
|
|
|
* The setFirstResponder method is used in this editor to allow it to
|
|
|
|
|
* respond to messages forwarded to the window appropriately.
|
|
|
|
|
* Unfortunately, once it's set to something, it cannot be set to nil.
|
|
|
|
|
* This method allows us to set it to nil, thus preventing a memory leak.
|
|
|
|
|
*/
|
|
|
|
|
- (void) unsetInitialFirstResponder
|
|
|
|
|
{
|
|
|
|
|
ASSIGN(_initialFirstResponder, nil);
|
|
|
|
|
}
|
|
|
|
|
@end
|
|
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
|
|
|
|
|
|
|
2002-08-14 00:01:42 +00:00
|
|
|
|
@interface GormWindowEditor : GormViewWithContentViewEditor
|
1999-12-13 17:01:35 +00:00
|
|
|
|
{
|
2001-06-07 03:57:51 +00:00
|
|
|
|
NSView *edit_view;
|
1999-12-14 17:38:17 +00:00
|
|
|
|
NSMutableArray *subeditors;
|
1999-12-18 11:08:18 +00:00
|
|
|
|
BOOL isLinkSource;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
NSPasteboard *dragPb;
|
1999-12-17 18:46:03 +00:00
|
|
|
|
NSString *dragType;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
- (BOOL) acceptsTypeFromArray: (NSArray*)types;
|
|
|
|
|
- (BOOL) activate;
|
|
|
|
|
- (id) initWithObject: (id)anObject inDocument: (id<IBDocuments>)aDocument;
|
2001-08-21 13:35:15 +00:00
|
|
|
|
- (void) changeFont: (id) sender;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (void) close;
|
|
|
|
|
- (void) closeSubeditors;
|
2000-01-03 11:00:14 +00:00
|
|
|
|
- (void) deactivate;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (void) deleteSelection;
|
|
|
|
|
- (id<IBDocuments>) document;
|
1999-12-14 17:38:17 +00:00
|
|
|
|
- (void) draggedImage: (NSImage*)i endedAt: (NSPoint)p deposited: (BOOL)f;
|
|
|
|
|
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (void) makeSelectionVisible: (BOOL)flag;
|
|
|
|
|
- (id<IBEditors>) openSubeditorForObject: (id)anObject;
|
|
|
|
|
- (void) orderFront;
|
|
|
|
|
- (void) pasteInSelection;
|
|
|
|
|
- (void) resetObject: (id)anObject;
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation GormWindowEditor
|
|
|
|
|
|
2000-01-05 16:34:53 +00:00
|
|
|
|
- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent
|
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"acceptsFirstMouse");
|
2000-01-05 16:34:53 +00:00
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
|
2001-08-21 13:35:15 +00:00
|
|
|
|
- (BOOL) acceptsFirstResponder
|
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"acceptsFirstResponder");
|
2001-08-21 13:35:15 +00:00
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-22 12:50:11 +00:00
|
|
|
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
|
|
|
|
{
|
2000-01-03 11:00:14 +00:00
|
|
|
|
[NSException raise: NSInternalInconsistencyException
|
|
|
|
|
format: @"Argh - encoding window editor"];
|
1999-12-22 12:50:11 +00:00
|
|
|
|
}
|
2000-01-03 11:00:14 +00:00
|
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (BOOL) acceptsTypeFromArray: (NSArray*)types
|
|
|
|
|
{
|
1999-12-14 17:38:17 +00:00
|
|
|
|
/*
|
1999-12-17 17:22:18 +00:00
|
|
|
|
* A window editor can accept views pasted in to the window.
|
1999-12-14 17:38:17 +00:00
|
|
|
|
*/
|
|
|
|
|
return [types containsObject: IBViewPboardType];
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) activate
|
|
|
|
|
{
|
2002-08-14 00:01:42 +00:00
|
|
|
|
if (activated == NO)
|
|
|
|
|
{
|
|
|
|
|
NSView *contentView = [_EO contentView];
|
2004-04-04 16:37:16 +00:00
|
|
|
|
contentViewEditor = (GormInternalViewEditor *)[document editorForObject: contentView
|
|
|
|
|
inEditor: self
|
|
|
|
|
create: YES];
|
2004-07-21 01:49:07 +00:00
|
|
|
|
[_EO setInitialFirstResponder: self];
|
2002-08-14 00:01:42 +00:00
|
|
|
|
[self setOpened: YES];
|
|
|
|
|
activated = YES;
|
|
|
|
|
return YES;
|
1999-12-14 17:38:17 +00:00
|
|
|
|
}
|
2002-08-14 00:01:42 +00:00
|
|
|
|
|
|
|
|
|
return NO;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-29 16:30:48 +00:00
|
|
|
|
- (void) changeFont: (id)sender
|
2001-08-21 13:35:15 +00:00
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"changeFont");
|
2001-08-21 13:35:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (void) close
|
|
|
|
|
{
|
2002-08-14 00:01:42 +00:00
|
|
|
|
NSAssert(closed == NO, NSInternalInconsistencyException);
|
|
|
|
|
closed = YES;
|
2000-01-03 11:00:14 +00:00
|
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
1999-12-14 17:38:17 +00:00
|
|
|
|
|
2000-01-03 11:00:14 +00:00
|
|
|
|
[self makeSelectionVisible: NO];
|
1999-12-14 17:38:17 +00:00
|
|
|
|
if ([(id<IB>)NSApp selectionOwner] == self)
|
|
|
|
|
{
|
|
|
|
|
[document resignSelectionForEditor: self];
|
|
|
|
|
}
|
2000-01-03 11:00:14 +00:00
|
|
|
|
|
|
|
|
|
[self closeSubeditors];
|
|
|
|
|
[self deactivate];
|
2004-07-21 01:49:07 +00:00
|
|
|
|
[document editor: self didCloseForObject: _EO];
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) closeSubeditors
|
|
|
|
|
{
|
1999-12-14 17:38:17 +00:00
|
|
|
|
while ([subeditors count] > 0)
|
|
|
|
|
{
|
|
|
|
|
id<IBEditors> sub = [subeditors lastObject];
|
|
|
|
|
|
|
|
|
|
[sub close];
|
|
|
|
|
[subeditors removeObjectIdenticalTo: sub];
|
|
|
|
|
}
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) copySelection
|
|
|
|
|
{
|
2004-04-30 22:34:43 +00:00
|
|
|
|
NSLog(@"copySelection");
|
1999-12-14 17:38:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-01-03 11:00:14 +00:00
|
|
|
|
- (void) deactivate
|
|
|
|
|
{
|
2002-08-14 00:01:42 +00:00
|
|
|
|
if (activated == YES)
|
2000-01-03 11:00:14 +00:00
|
|
|
|
{
|
2002-08-14 00:01:42 +00:00
|
|
|
|
[contentViewEditor deactivate];
|
2004-07-21 01:49:07 +00:00
|
|
|
|
[_EO unsetInitialFirstResponder];
|
2002-08-14 00:01:42 +00:00
|
|
|
|
activated = NO;
|
2000-01-03 11:00:14 +00:00
|
|
|
|
}
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return;
|
2000-01-03 11:00:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-14 17:38:17 +00:00
|
|
|
|
- (void) dealloc
|
|
|
|
|
{
|
2002-08-14 00:01:42 +00:00
|
|
|
|
if (closed == NO)
|
2000-01-03 11:00:14 +00:00
|
|
|
|
[self close];
|
2004-05-13 05:13:36 +00:00
|
|
|
|
|
1999-12-14 17:38:17 +00:00
|
|
|
|
RELEASE(selection);
|
|
|
|
|
RELEASE(subeditors);
|
2004-07-21 01:49:07 +00:00
|
|
|
|
|
1999-12-14 17:38:17 +00:00
|
|
|
|
[super dealloc];
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) deleteSelection
|
|
|
|
|
{
|
1999-12-14 17:38:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-07-21 01:49:07 +00:00
|
|
|
|
/*
|
|
|
|
|
- (id) retain
|
|
|
|
|
{
|
|
|
|
|
NSLog(@"Being retained... %d: %@", [self retainCount], self);
|
|
|
|
|
return [super retain];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (oneway void) release
|
|
|
|
|
{
|
|
|
|
|
NSLog(@"Being released... %d: %@", [self retainCount], self);
|
|
|
|
|
[super release];
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
1999-12-14 17:38:17 +00:00
|
|
|
|
/*
|
|
|
|
|
* Dragging source protocol implementation
|
|
|
|
|
*/
|
|
|
|
|
- (void) draggedImage: (NSImage*)i endedAt: (NSPoint)p deposited: (BOOL)f
|
|
|
|
|
{
|
|
|
|
|
/*
|
1999-12-17 17:22:18 +00:00
|
|
|
|
* Notification that a drag failed/succeeded.
|
1999-12-14 17:38:17 +00:00
|
|
|
|
*/
|
2004-09-06 21:41:32 +00:00
|
|
|
|
|
|
|
|
|
NSDebugLog(@"draggedImage");
|
|
|
|
|
|
|
|
|
|
if(f == NO)
|
|
|
|
|
{
|
2004-12-18 15:06:18 +00:00
|
|
|
|
NSRunAlertPanel(nil, _(@"Window drag failed."),
|
|
|
|
|
_(@"OK"), nil, nil);
|
2004-09-06 21:41:32 +00:00
|
|
|
|
}
|
1999-12-14 17:38:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag
|
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"draggingSourceOperationMaskForLocal");
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return NSDragOperationNone;
|
1999-12-14 17:38:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (unsigned) draggingEntered: (id<NSDraggingInfo>)sender
|
|
|
|
|
{
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return NSDragOperationNone;
|
2002-09-21 15:24:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-17 18:46:03 +00:00
|
|
|
|
- (unsigned) draggingUpdated: (id<NSDraggingInfo>)sender
|
|
|
|
|
{
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return NSDragOperationNone;
|
2002-09-21 15:24:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (void) drawSelection
|
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"drawSelection");
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (id<IBDocuments>) document
|
|
|
|
|
{
|
|
|
|
|
return document;
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-14 00:01:42 +00:00
|
|
|
|
- (id) initWithObject: (id)anObject
|
|
|
|
|
inDocument: (id<IBDocuments>)aDocument
|
1999-12-14 17:38:17 +00:00
|
|
|
|
{
|
2004-05-13 05:13:36 +00:00
|
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
|
|
|
|
|
2002-08-14 00:01:42 +00:00
|
|
|
|
if ((self = [super initWithFrame: NSZeroRect]) == nil)
|
1999-12-14 17:38:17 +00:00
|
|
|
|
return nil;
|
|
|
|
|
|
2004-05-13 05:13:36 +00:00
|
|
|
|
[nc addObserver: self
|
|
|
|
|
selector: @selector(handleNotification:)
|
|
|
|
|
name: IBWillCloseDocumentNotification
|
|
|
|
|
object: aDocument];
|
|
|
|
|
|
|
|
|
|
_displaySelection = YES;
|
2004-07-21 01:49:07 +00:00
|
|
|
|
ASSIGN(_editedObject, anObject);
|
|
|
|
|
|
2004-05-13 05:13:36 +00:00
|
|
|
|
// we don't retain the document...
|
|
|
|
|
document = aDocument;
|
|
|
|
|
|
2002-08-14 00:01:42 +00:00
|
|
|
|
[self registerForDraggedTypes: [NSArray arrayWithObjects:
|
|
|
|
|
GormLinkPboardType, IBViewPboardType, nil]];
|
2001-08-21 13:35:15 +00:00
|
|
|
|
|
1999-12-14 17:38:17 +00:00
|
|
|
|
selection = [NSMutableArray new];
|
|
|
|
|
subeditors = [NSMutableArray new];
|
|
|
|
|
|
2002-08-14 00:01:42 +00:00
|
|
|
|
activated = NO;
|
|
|
|
|
closed = NO;
|
2002-04-07 22:02:41 +00:00
|
|
|
|
|
2002-08-14 00:01:42 +00:00
|
|
|
|
[self activate];
|
|
|
|
|
|
1999-12-14 17:38:17 +00:00
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (void) makeSelectionVisible: (BOOL)flag
|
|
|
|
|
{
|
1999-12-15 21:43:57 +00:00
|
|
|
|
if (flag == NO)
|
|
|
|
|
{
|
1999-12-16 18:06:22 +00:00
|
|
|
|
if ([selection count] > 0)
|
1999-12-15 21:43:57 +00:00
|
|
|
|
{
|
|
|
|
|
NSEnumerator *enumerator = [selection objectEnumerator];
|
1999-12-16 06:56:02 +00:00
|
|
|
|
NSView *view;
|
1999-12-15 21:43:57 +00:00
|
|
|
|
|
|
|
|
|
[[self window] disableFlushWindow];
|
|
|
|
|
while ((view = [enumerator nextObject]) != nil)
|
|
|
|
|
{
|
|
|
|
|
NSRect rect = GormExtBoundsForRect([view frame]);
|
|
|
|
|
|
2001-06-07 03:57:51 +00:00
|
|
|
|
[edit_view displayRect: rect];
|
1999-12-15 21:43:57 +00:00
|
|
|
|
}
|
|
|
|
|
[[self window] enableFlushWindow];
|
1999-12-16 06:56:02 +00:00
|
|
|
|
[[self window] flushWindowIfNeeded];
|
1999-12-15 21:43:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
[self drawSelection];
|
|
|
|
|
[[self window] flushWindow];
|
|
|
|
|
}
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (id<IBEditors>) openSubeditorForObject: (id)anObject
|
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"openSubeditorForObject");
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return nil;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) orderFront
|
|
|
|
|
{
|
2004-07-21 01:49:07 +00:00
|
|
|
|
[_EO orderFront: self];
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) pasteInSelection
|
|
|
|
|
{
|
2004-04-30 22:34:43 +00:00
|
|
|
|
NSLog(@"pasteInSelection");
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-14 17:38:17 +00:00
|
|
|
|
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"performDragOperation");
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return NO;
|
1999-12-14 17:38:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) prepareForDragOperation: (id<NSDraggingInfo>)sender
|
|
|
|
|
{
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return NO;
|
2002-09-21 15:24:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-13 17:01:35 +00:00
|
|
|
|
- (void) resetObject: (id)anObject
|
|
|
|
|
{
|
1999-12-23 07:49:27 +00:00
|
|
|
|
[[self window] makeKeyAndOrderFront: self];
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-08 09:43:11 +00:00
|
|
|
|
- (id) selectAllItems: (id)sender
|
1999-12-17 21:53:06 +00:00
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"selectAllItems");
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return nil;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (unsigned) selectionCount
|
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"selectionCount");
|
2002-08-14 00:01:42 +00:00
|
|
|
|
return 0;
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) validateEditing
|
|
|
|
|
{
|
2004-04-18 21:05:20 +00:00
|
|
|
|
NSDebugLog(@"validateEditing");
|
1999-12-13 17:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-04-07 22:02:41 +00:00
|
|
|
|
- (void)windowDidBecomeMain: (id) aNotification
|
|
|
|
|
{
|
2004-02-21 18:48:48 +00:00
|
|
|
|
NSDebugLog(@"windowDidBecomeMain %@", selection);
|
2002-04-07 22:02:41 +00:00
|
|
|
|
if ([NSApp isConnecting] == NO)
|
|
|
|
|
{
|
|
|
|
|
[document setSelectionFromEditor: self];
|
2004-02-21 18:48:48 +00:00
|
|
|
|
NSDebugLog(@"windowDidBecomeMain %@", selection);
|
2002-04-07 22:02:41 +00:00
|
|
|
|
[self makeSelectionVisible: YES];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)windowDidResignMain: (id) aNotification
|
|
|
|
|
{
|
2004-02-21 18:48:48 +00:00
|
|
|
|
NSDebugLog(@"windowDidResignMain");
|
2002-04-07 22:02:41 +00:00
|
|
|
|
// [document setSelectionFromEditor: self];
|
|
|
|
|
[self makeSelectionVisible: NO];
|
|
|
|
|
}
|
1999-12-13 17:01:35 +00:00
|
|
|
|
@end
|