2002-08-14 00:01:42 +00:00
|
|
|
/* GormTableViewEditor.m - Editor for matrices.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Free Software Foundation, Inc.
|
|
|
|
*
|
|
|
|
* Author: Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
|
|
|
|
* Date: 2002
|
|
|
|
*
|
|
|
|
* 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
|
2007-11-05 23:44:36 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2002-08-14 00:01:42 +00:00
|
|
|
* (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
|
2005-05-26 03:37:38 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
2002-08-14 00:01:42 +00:00
|
|
|
*/
|
|
|
|
|
2003-05-29 05:40:28 +00:00
|
|
|
#include <AppKit/AppKit.h>
|
2019-11-03 01:57:39 +00:00
|
|
|
|
2003-05-29 05:40:28 +00:00
|
|
|
#include <InterfaceBuilder/InterfaceBuilder.h>
|
2019-11-03 01:57:39 +00:00
|
|
|
#include <GormCore/GormCore.h>
|
|
|
|
|
2003-03-03 09:15:48 +00:00
|
|
|
#include "GormTableViewEditor.h"
|
|
|
|
#include "GormNSTableView.h"
|
2002-08-14 00:01:42 +00:00
|
|
|
|
|
|
|
NSString *IBTableColumnPboardType = @"IBTableColumnPboardType";
|
|
|
|
|
|
|
|
static NSCell *_editedCell;
|
|
|
|
static NSCell *_currentHeaderCell;
|
|
|
|
static NSText *_textObject;
|
|
|
|
|
|
|
|
@interface GormTableViewEditor (Private)
|
|
|
|
- (void) editHeader: (NSTableHeaderView*) th
|
|
|
|
withEvent: (NSEvent *) theEvent;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation GormTableViewEditor
|
2006-03-11 22:07:33 +00:00
|
|
|
- (void) setFrame: (NSRect)frame
|
|
|
|
{
|
|
|
|
if(tableView != nil)
|
2002-08-14 00:01:42 +00:00
|
|
|
{
|
2006-03-11 22:07:33 +00:00
|
|
|
[tableView deselectAll: self];
|
2002-08-14 00:01:42 +00:00
|
|
|
}
|
2006-03-11 22:07:33 +00:00
|
|
|
[super setFrame: frame];
|
|
|
|
}
|
2004-11-24 05:06:32 +00:00
|
|
|
|
2006-03-11 22:07:33 +00:00
|
|
|
/**
|
|
|
|
* Decide whether an editor can accept data from the pasteboard.
|
|
|
|
*/
|
|
|
|
- (BOOL) acceptsTypeFromArray: (NSArray*)types
|
|
|
|
{
|
|
|
|
return NO;
|
2002-08-14 00:01:42 +00:00
|
|
|
}
|
|
|
|
|
2004-09-08 01:04:03 +00:00
|
|
|
/**
|
2002-08-14 00:01:42 +00:00
|
|
|
* Activate an editor - inserts it into the view hierarchy or whatever is
|
|
|
|
* needed for the editor to be able to provide its functionality.
|
|
|
|
* This method should be called by the document when an editor is created
|
|
|
|
* or opened. It should be safe to call repeatedly.
|
|
|
|
*/
|
|
|
|
- (BOOL) activate
|
|
|
|
{
|
|
|
|
if ([super activate])
|
|
|
|
{
|
|
|
|
if ([_editedObject isKindOfClass: [NSScrollView class]])
|
|
|
|
tableView = [(NSScrollView *)_editedObject documentView];
|
|
|
|
else
|
|
|
|
tableView = (GormNSTableView *)_editedObject;
|
2004-09-08 01:04:03 +00:00
|
|
|
|
|
|
|
RETAIN(tableView); // FIXME: Temporary fix.
|
2002-08-14 00:01:42 +00:00
|
|
|
[tableView setAllowsColumnResizing: YES];
|
|
|
|
[tableView setAllowsColumnSelection: YES];
|
|
|
|
[tableView setAllowsMultipleSelection: NO];
|
|
|
|
[tableView setAllowsEmptySelection: YES];
|
|
|
|
[tableView setAllowsColumnReordering: YES];
|
|
|
|
[tableView setGormDelegate: self];
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2006-10-30 00:23:55 +00:00
|
|
|
- (void) scrollToPoint: (NSPoint)point
|
|
|
|
{
|
|
|
|
if ([_super_view respondsToSelector:@selector(scrollToPoint:)])
|
|
|
|
{
|
|
|
|
[(NSClipView *)_super_view scrollToPoint: point];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-10-27 21:38:14 +00:00
|
|
|
- (NSRect) documentVisibleRect
|
2006-10-21 15:48:47 +00:00
|
|
|
{
|
|
|
|
NSRect visRect = _bounds;
|
2006-10-27 21:38:14 +00:00
|
|
|
if ([_super_view respondsToSelector:@selector(documentVisibleRect)])
|
2006-10-21 15:48:47 +00:00
|
|
|
{
|
2006-10-27 21:38:14 +00:00
|
|
|
visRect = [(NSClipView *)_super_view documentVisibleRect];
|
2006-10-21 15:48:47 +00:00
|
|
|
}
|
|
|
|
return visRect;
|
|
|
|
}
|
2002-08-14 00:01:42 +00:00
|
|
|
|
2004-09-08 01:04:03 +00:00
|
|
|
/**
|
2002-08-14 00:01:42 +00:00
|
|
|
* Deactivate an editor - removes it from the view hierarchy so that objects
|
|
|
|
* can be archived without including the editor.
|
|
|
|
* This method should be called automatically by the 'close' method.
|
|
|
|
* It should be safe to call repeatedly.
|
|
|
|
*/
|
|
|
|
- (void) deactivate
|
|
|
|
{
|
|
|
|
if (activated == YES)
|
|
|
|
{
|
2004-11-24 05:06:32 +00:00
|
|
|
// [tableView unselect];
|
2002-08-14 00:01:42 +00:00
|
|
|
if ([tableView selectedColumn] != -1)
|
|
|
|
{
|
|
|
|
[tableView deselectColumn: [tableView selectedColumn]];
|
|
|
|
}
|
|
|
|
[tableView setAllowsColumnResizing:
|
|
|
|
[tableView gormAllowsColumnResizing]];
|
|
|
|
[tableView setAllowsColumnSelection:
|
|
|
|
[tableView gormAllowsColumnSelection]];
|
|
|
|
[tableView setAllowsMultipleSelection:
|
|
|
|
[tableView gormAllowsMultipleSelection]];
|
|
|
|
[tableView setAllowsEmptySelection:
|
|
|
|
[tableView gormAllowsEmptySelection]];
|
|
|
|
[tableView setAllowsColumnReordering:
|
|
|
|
[tableView gormAllowsColumnReordering]];
|
|
|
|
[tableView setGormDelegate: nil];
|
|
|
|
[tableView setNeedsDisplay: YES];
|
|
|
|
[super deactivate];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This method deletes all the objects in the current selection in the editor.
|
|
|
|
*/
|
|
|
|
- (void) deleteSelection
|
|
|
|
{
|
2004-02-21 06:35:17 +00:00
|
|
|
NSDebugLog(@"deleteSelection");
|
2002-08-14 00:01:42 +00:00
|
|
|
if ([selection count] == 0)
|
|
|
|
{
|
2004-02-21 06:35:17 +00:00
|
|
|
NSDebugLog(@"no column to delete");
|
2002-08-14 00:01:42 +00:00
|
|
|
}
|
2006-03-05 00:46:42 +00:00
|
|
|
else if([[selection objectAtIndex: 0] isKindOfClass: [NSTableColumn class]])
|
2002-08-14 00:01:42 +00:00
|
|
|
{
|
|
|
|
[tableView removeTableColumn: [selection objectAtIndex: 0]];
|
|
|
|
[tableView deselectAll: self];
|
|
|
|
[self selectObjects: [NSArray array]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This method places the current selection from the editor on the pasteboard.
|
|
|
|
*/
|
|
|
|
- (void) copySelection
|
|
|
|
{
|
2004-02-21 06:35:17 +00:00
|
|
|
NSDebugLog(@"copySelection");
|
2002-08-14 00:01:42 +00:00
|
|
|
if ([[[self selection] objectAtIndex: 0]
|
|
|
|
isKindOfClass: [NSTableColumn class]])
|
|
|
|
{
|
|
|
|
[document copyObjects: [self selection]
|
|
|
|
type: IBTableColumnPboardType
|
|
|
|
toPasteboard: [NSPasteboard generalPasteboard]];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-02-21 06:35:17 +00:00
|
|
|
NSDebugLog(@"no paste");
|
2002-08-14 00:01:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This method is used to add the contents of the pasteboard to the current
|
|
|
|
* selection of objects within the editor.
|
|
|
|
*/
|
|
|
|
- (void) pasteInSelection
|
|
|
|
{
|
|
|
|
NSArray *objects;
|
2004-02-21 06:35:17 +00:00
|
|
|
NSDebugLog(@"pasteInSelection");
|
2002-08-14 00:01:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
objects = [document pasteType: IBTableColumnPboardType
|
|
|
|
fromPasteboard: [NSPasteboard generalPasteboard]
|
2005-08-11 00:56:36 +00:00
|
|
|
parent: _editedObject];
|
2002-08-14 00:01:42 +00:00
|
|
|
|
|
|
|
if (objects == nil)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if ([objects count] == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if ([objects count] > 1)
|
|
|
|
{
|
2004-02-21 06:35:17 +00:00
|
|
|
NSDebugLog(@"warning strange behaviour : GormTableViewEditor pasteInSelection");
|
2002-08-14 00:01:42 +00:00
|
|
|
}
|
|
|
|
else if ([[objects objectAtIndex: 0] isKindOfClass: [NSTableColumn class]]
|
|
|
|
== NO)
|
|
|
|
{
|
2004-02-21 06:35:17 +00:00
|
|
|
NSDebugLog(@"invalid data in IBTableColumnPboardType");
|
2002-08-14 00:01:42 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
[tableView addTableColumn: [objects objectAtIndex: 0]];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void) mouseDown:(NSEvent*)theEvent
|
|
|
|
{
|
|
|
|
BOOL onKnob = NO;
|
|
|
|
id hitView;
|
|
|
|
|
|
|
|
{
|
|
|
|
if ([parent respondsToSelector: @selector(selection)] &&
|
|
|
|
[[parent selection] containsObject: _editedObject])
|
|
|
|
{
|
|
|
|
IBKnobPosition knob = IBNoneKnobPosition;
|
|
|
|
NSPoint mouseDownPoint =
|
|
|
|
[self convertPoint: [theEvent locationInWindow]
|
|
|
|
fromView: nil];
|
|
|
|
knob = GormKnobHitInRect([self bounds],
|
|
|
|
mouseDownPoint);
|
|
|
|
if (knob != IBNoneKnobPosition)
|
|
|
|
onKnob = YES;
|
|
|
|
}
|
|
|
|
if (onKnob == YES)
|
|
|
|
{
|
|
|
|
if (parent)
|
|
|
|
return [parent mouseDown: theEvent];
|
|
|
|
else
|
|
|
|
return [self noResponderFor: @selector(mouseDown:)];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (opened == NO)
|
|
|
|
{
|
2004-02-21 06:35:17 +00:00
|
|
|
NSDebugLog(@"not opened");
|
2002-08-14 00:01:42 +00:00
|
|
|
[super mouseDown: theEvent];
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
hitView =
|
|
|
|
[[tableView enclosingScrollView]
|
|
|
|
hitTest:
|
|
|
|
[[[tableView enclosingScrollView] superview]
|
|
|
|
convertPoint: [theEvent locationInWindow]
|
|
|
|
fromView: nil]];
|
|
|
|
|
|
|
|
if (hitView == [tableView headerView])
|
|
|
|
{
|
|
|
|
if ([theEvent clickCount] == 2)
|
|
|
|
{
|
|
|
|
[self editHeader: hitView
|
|
|
|
withEvent: theEvent];
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[hitView mouseDown: theEvent];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ([hitView isKindOfClass: [NSScroller class]])
|
|
|
|
{
|
|
|
|
[hitView mouseDown: theEvent];
|
|
|
|
}
|
|
|
|
else if (hitView == tableView)
|
|
|
|
{
|
2005-04-15 06:39:21 +00:00
|
|
|
if ([theEvent modifierFlags] & NSControlKeyMask)
|
|
|
|
{
|
|
|
|
[super mouseDown: theEvent];
|
|
|
|
}
|
|
|
|
else if ([tableView selectedColumn] != -1)
|
2002-08-14 00:01:42 +00:00
|
|
|
{
|
|
|
|
[tableView deselectColumn: [tableView selectedColumn]];
|
|
|
|
}
|
|
|
|
}
|
2006-12-04 09:51:03 +00:00
|
|
|
else if (hitView == self && [theEvent modifierFlags] & NSControlKeyMask)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* see if we're making a connection from the selected column.
|
|
|
|
* not useful in vanilla gorm as they have no outlets or actions,
|
|
|
|
* but palettes might find it useful.
|
|
|
|
*/
|
|
|
|
int selectedColumn = [tableView selectedColumn];
|
|
|
|
|
|
|
|
if (selectedColumn != -1)
|
|
|
|
{
|
|
|
|
NSPoint pt = [theEvent locationInWindow];
|
|
|
|
NSRect r = [tableView rectOfColumn: selectedColumn];
|
|
|
|
|
|
|
|
pt = [tableView convertPoint:pt fromView:nil];
|
|
|
|
|
|
|
|
if (NSMouseInRect(pt, r, [tableView isFlipped]))
|
|
|
|
{
|
|
|
|
/* mouse was inside the selected column */
|
|
|
|
NSPasteboard *pb;
|
|
|
|
NSPoint dragPoint = [theEvent locationInWindow];
|
|
|
|
NSTableColumn *col = [[tableView tableColumns]
|
|
|
|
objectAtIndex: selectedColumn];
|
|
|
|
NSString *name = [document nameForObject: col];
|
|
|
|
|
|
|
|
pb = [NSPasteboard pasteboardWithName: NSDragPboard];
|
|
|
|
[pb declareTypes:
|
|
|
|
[NSArray arrayWithObject: GormLinkPboardType]
|
|
|
|
owner: self];
|
|
|
|
[pb setString: name forType: GormLinkPboardType];
|
|
|
|
[NSApp displayConnectionBetween: col and: nil];
|
|
|
|
[NSApp startConnecting];
|
|
|
|
|
|
|
|
[self dragImage: [NSApp linkImage]
|
|
|
|
at: dragPoint
|
|
|
|
offset: NSZeroSize
|
|
|
|
event: theEvent
|
|
|
|
pasteboard: pb
|
|
|
|
source: self
|
|
|
|
slideBack: YES];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-08-14 00:01:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) tableViewSelectionDidChange: (id) tv
|
|
|
|
{
|
|
|
|
if ([tableView selectedColumn] != -1)
|
|
|
|
{
|
|
|
|
[self selectObjects:
|
|
|
|
[NSArray arrayWithObject:
|
|
|
|
[[tableView tableColumns]
|
|
|
|
objectAtIndex: [tableView selectedColumn]]]];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[self selectObjects:
|
|
|
|
[NSArray arrayWithObject: tableView]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void) outlineViewSelectionDidChange: (id) tv
|
|
|
|
{
|
|
|
|
if ([tableView selectedColumn] != -1)
|
|
|
|
{
|
|
|
|
[self selectObjects:
|
|
|
|
[NSArray arrayWithObject:
|
|
|
|
[[tableView tableColumns]
|
|
|
|
objectAtIndex: [tableView selectedColumn]]]];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[self selectObjects:
|
|
|
|
[NSArray arrayWithObject: tableView]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) editHeader: (NSTableHeaderView*) th
|
|
|
|
withEvent: (NSEvent *) theEvent
|
|
|
|
{
|
|
|
|
NSText *t;
|
|
|
|
NSTableColumn *tc;
|
|
|
|
NSRect drawingRect;
|
|
|
|
|
2012-04-20 06:12:32 +00:00
|
|
|
NSUInteger columnIndex = [th columnAtPoint:
|
2002-08-14 00:01:42 +00:00
|
|
|
[th convertPoint:[theEvent locationInWindow]
|
|
|
|
fromView: nil]];
|
|
|
|
|
|
|
|
if (columnIndex == NSNotFound)
|
|
|
|
return;
|
|
|
|
|
|
|
|
_textObject = nil;
|
|
|
|
|
|
|
|
[[th tableView] scrollColumnToVisible: columnIndex];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t = [[th window] fieldEditor: YES forObject: self];
|
|
|
|
|
|
|
|
if ([t superview] != nil)
|
|
|
|
{
|
|
|
|
if ([t resignFirstResponder] == NO)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Prepare the cell
|
|
|
|
tc = [[tableView tableColumns] objectAtIndex: columnIndex];
|
|
|
|
// NB: need to be released when no longer used
|
|
|
|
_editedCell = [[tc headerCell] copy];
|
|
|
|
_currentHeaderCell = [tc headerCell];
|
|
|
|
[_editedCell setStringValue: [[tc headerCell] stringValue]];
|
|
|
|
[_editedCell setEditable: YES];
|
|
|
|
_textObject = [_editedCell setUpFieldEditorAttributes: t];
|
|
|
|
|
|
|
|
drawingRect = [th headerRectOfColumn: columnIndex];
|
|
|
|
[_editedCell editWithFrame: drawingRect
|
|
|
|
inView: th
|
|
|
|
editor: _textObject
|
|
|
|
delegate: self
|
|
|
|
event: theEvent];
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) textDidEndEditing: (NSNotification *)aNotification
|
|
|
|
{
|
|
|
|
[_editedCell endEditing: _textObject];
|
|
|
|
[_currentHeaderCell setStringValue: [[_textObject text] copy]];
|
|
|
|
|
|
|
|
RELEASE(_editedCell);
|
|
|
|
}
|
|
|
|
|
2013-02-23 08:07:56 +00:00
|
|
|
- (NSDragOperation) draggingEntered: (id<NSDraggingInfo>)sender
|
2002-09-21 15:24:59 +00:00
|
|
|
{
|
|
|
|
return [self draggingUpdated: sender];
|
|
|
|
}
|
|
|
|
|
2013-02-23 08:07:56 +00:00
|
|
|
- (NSDragOperation) draggingUpdated: (id<NSDraggingInfo>)sender
|
2002-09-21 15:24:59 +00:00
|
|
|
{
|
|
|
|
NSPasteboard *dragPb;
|
|
|
|
NSArray *types;
|
|
|
|
|
|
|
|
dragPb = [sender draggingPasteboard];
|
|
|
|
types = [dragPb types];
|
|
|
|
if ([types containsObject: GormLinkPboardType] == YES)
|
|
|
|
{
|
|
|
|
id destination = nil;
|
2006-10-02 02:47:22 +00:00
|
|
|
|
|
|
|
/*
|
2002-09-21 15:24:59 +00:00
|
|
|
NSView *hitView =
|
|
|
|
[[tableView enclosingScrollView]
|
|
|
|
hitTest:
|
|
|
|
[[[tableView enclosingScrollView] superview]
|
|
|
|
convertPoint: [sender draggingLocation]
|
|
|
|
fromView: nil]];
|
|
|
|
|
|
|
|
if (hitView == [tableView headerView])
|
|
|
|
{
|
|
|
|
NSPoint p = [hitView convertPoint: [sender draggingLocation]
|
|
|
|
fromView: nil];
|
|
|
|
int columnNumber =
|
|
|
|
[(NSTableHeaderView*) hitView columnAtPoint: p];
|
|
|
|
|
|
|
|
if (columnNumber != -1)
|
|
|
|
destination = [[tableView tableColumns]
|
|
|
|
objectAtIndex: columnNumber];
|
|
|
|
}
|
|
|
|
|
2002-09-22 14:40:57 +00:00
|
|
|
if (hitView == tableView)
|
2002-09-21 15:24:59 +00:00
|
|
|
destination = tableView;
|
2006-10-02 02:47:22 +00:00
|
|
|
*/
|
2002-09-21 15:24:59 +00:00
|
|
|
|
2002-09-22 14:40:57 +00:00
|
|
|
if (destination == nil)
|
2006-10-02 02:47:22 +00:00
|
|
|
{
|
|
|
|
int col = 0;
|
|
|
|
destination = _editedObject;
|
|
|
|
if((col = [_editedObject selectedColumn]) != -1)
|
|
|
|
{
|
|
|
|
destination = [[_editedObject tableColumns] objectAtIndex: col];
|
|
|
|
}
|
|
|
|
}
|
2002-09-22 14:40:57 +00:00
|
|
|
|
2002-09-21 15:24:59 +00:00
|
|
|
[NSApp displayConnectionBetween: [NSApp connectSource]
|
|
|
|
and: destination];
|
|
|
|
return NSDragOperationLink;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return NSDragOperationNone;
|
|
|
|
}
|
|
|
|
}
|
2006-03-11 22:07:33 +00:00
|
|
|
|
2002-09-21 15:24:59 +00:00
|
|
|
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
|
|
|
{
|
2006-10-02 02:47:22 +00:00
|
|
|
return ([self draggingUpdated: sender] == NSDragOperationLink);
|
2002-09-21 15:24:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSWindow *)windowAndRect: (NSRect *)prect
|
|
|
|
forObject: (id) object
|
|
|
|
{
|
|
|
|
if (object == tableView)
|
|
|
|
{
|
|
|
|
*prect = [tableView convertRect: [tableView visibleRect]
|
|
|
|
toView :nil];
|
|
|
|
return _window;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return [super windowAndRect: prect forObject: object];
|
|
|
|
}
|
|
|
|
}
|
2002-08-14 00:01:42 +00:00
|
|
|
@end
|