1999-02-19 20:19:58 +00:00
|
|
|
/*
|
1996-05-30 20:03:15 +00:00
|
|
|
NSBrowserCell.m
|
|
|
|
|
|
|
|
Cell class for the NSBrowser
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
|
|
|
Date: 1996
|
1999-02-19 20:19:58 +00:00
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
1999-02-19 20:19:58 +00:00
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
This library 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
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
1996-10-18 17:14:13 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, write to the Free Software Foundation,
|
|
|
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1999-02-19 20:19:58 +00:00
|
|
|
*/
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1997-09-23 22:43:24 +00:00
|
|
|
#include <gnustep/gui/config.h>
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1997-02-18 00:29:25 +00:00
|
|
|
#include <AppKit/NSBrowserCell.h>
|
1997-10-31 01:24:08 +00:00
|
|
|
#include <AppKit/NSTextFieldCell.h>
|
1999-06-21 06:43:31 +00:00
|
|
|
#include <AppKit/NSColor.h>
|
1997-10-31 01:24:08 +00:00
|
|
|
#include <AppKit/NSImage.h>
|
1999-06-30 03:10:38 +00:00
|
|
|
#include <AppKit/NSGraphics.h>
|
1998-11-25 17:16:48 +00:00
|
|
|
#include <AppKit/NSEvent.h>
|
1999-06-30 03:10:38 +00:00
|
|
|
#include <AppKit/NSWindow.h>
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Class variables
|
|
|
|
*/
|
|
|
|
static NSImage *branch_image;
|
|
|
|
static NSImage *highlight_image;
|
|
|
|
|
|
|
|
static Class cellClass;
|
|
|
|
static Class colorClass;
|
1997-10-31 01:24:08 +00:00
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Private methods
|
|
|
|
*/
|
1997-10-31 01:24:08 +00:00
|
|
|
@interface NSBrowserCell (Private)
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) setBranchImageCell: aCell;
|
|
|
|
- (void) setHighlightBranchImageCell: aCell;
|
|
|
|
- (void) setTextFieldCell: aCell;
|
1997-10-31 01:24:08 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation NSBrowserCell (Private)
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) setTextFieldCell: aCell
|
|
|
|
{
|
|
|
|
ASSIGN(_browserText, aCell);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setBranchImageCell: aCell
|
|
|
|
{
|
|
|
|
ASSIGN(_branchImage, aCell);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setHighlightBranchImageCell: aCell
|
|
|
|
{
|
|
|
|
ASSIGN(_highlightBranchImage, aCell);
|
* NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS),
various methods add fieldEditor support.
* GSContext.m/GSContext.h revert to previous code as solution discussed
with Adam Fedor regarding backends had problems I had not forseen.
* NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image
cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious
dealloc bug), highlight: eliminate method (fixes dup display bug).
* NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN
* NSStringDrawing.h/.m remove unimplemented draw methods from Category
(these are backend specific, can't be defined twice and are already
implemented in xraw).
* NSApplication.h redefine initialize_gnustep_backend () per Adam's
redefinition in the backend.
* Functions.m/.h remove initialize_gnustep_backend()
* NSCell.m preliminary implementation of fieldEditor mechanism,
copyWithZone: optimize and eliminate use of ASSIGN
* NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS
* NSMatrix.m implement NSControl's updateCell: to prevent unecessary
matrix drawing if possible.
* NSView.m -resizeWithOldSuperviewSize reverted code to my own once more
(fewer lines and no if/else logic), changed code to use view frame instead
of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale
adjustment unless view has been scaled.
* NSScrollView.m define as externs various PS* functions for use in
drawing, polish drawing, move all backend code to front.
* Tools/dummy.m define dummy PS* functions employed in gui.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3454 72102866-910b-0410-8b05-ffd578937521
1998-12-14 09:54:38 +00:00
|
|
|
}
|
1997-10-31 01:24:08 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
* NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS),
various methods add fieldEditor support.
* GSContext.m/GSContext.h revert to previous code as solution discussed
with Adam Fedor regarding backends had problems I had not forseen.
* NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image
cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious
dealloc bug), highlight: eliminate method (fixes dup display bug).
* NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN
* NSStringDrawing.h/.m remove unimplemented draw methods from Category
(these are backend specific, can't be defined twice and are already
implemented in xraw).
* NSApplication.h redefine initialize_gnustep_backend () per Adam's
redefinition in the backend.
* Functions.m/.h remove initialize_gnustep_backend()
* NSCell.m preliminary implementation of fieldEditor mechanism,
copyWithZone: optimize and eliminate use of ASSIGN
* NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS
* NSMatrix.m implement NSControl's updateCell: to prevent unecessary
matrix drawing if possible.
* NSView.m -resizeWithOldSuperviewSize reverted code to my own once more
(fewer lines and no if/else logic), changed code to use view frame instead
of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale
adjustment unless view has been scaled.
* NSScrollView.m define as externs various PS* functions for use in
drawing, polish drawing, move all backend code to front.
* Tools/dummy.m define dummy PS* functions employed in gui.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3454 72102866-910b-0410-8b05-ffd578937521
1998-12-14 09:54:38 +00:00
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* NSBrowserCell
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
* NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS),
various methods add fieldEditor support.
* GSContext.m/GSContext.h revert to previous code as solution discussed
with Adam Fedor regarding backends had problems I had not forseen.
* NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image
cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious
dealloc bug), highlight: eliminate method (fixes dup display bug).
* NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN
* NSStringDrawing.h/.m remove unimplemented draw methods from Category
(these are backend specific, can't be defined twice and are already
implemented in xraw).
* NSApplication.h redefine initialize_gnustep_backend () per Adam's
redefinition in the backend.
* Functions.m/.h remove initialize_gnustep_backend()
* NSCell.m preliminary implementation of fieldEditor mechanism,
copyWithZone: optimize and eliminate use of ASSIGN
* NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS
* NSMatrix.m implement NSControl's updateCell: to prevent unecessary
matrix drawing if possible.
* NSView.m -resizeWithOldSuperviewSize reverted code to my own once more
(fewer lines and no if/else logic), changed code to use view frame instead
of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale
adjustment unless view has been scaled.
* NSScrollView.m define as externs various PS* functions for use in
drawing, polish drawing, move all backend code to front.
* Tools/dummy.m define dummy PS* functions employed in gui.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3454 72102866-910b-0410-8b05-ffd578937521
1998-12-14 09:54:38 +00:00
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
@implementation NSBrowserCell
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Class methods
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
+ (void) initialize
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-02-19 20:19:58 +00:00
|
|
|
if (self == [NSBrowserCell class])
|
|
|
|
{
|
|
|
|
[self setVersion: 1];
|
1999-04-27 14:56:43 +00:00
|
|
|
ASSIGN(branch_image, [NSImage imageNamed: @"common_3DArrowRight"]);
|
|
|
|
ASSIGN(highlight_image, [NSImage imageNamed: @"common_3DArrowRightH"]);
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Cache classes to avoid overheads of poor compiler implementation.
|
|
|
|
*/
|
|
|
|
cellClass = [NSCell class];
|
|
|
|
colorClass = [NSColor class];
|
1999-02-19 20:19:58 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Accessing Graphic Attributes
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
+ (NSImage*) branchImage
|
|
|
|
{
|
|
|
|
return branch_image;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSImage*) highlightedBranchImage
|
|
|
|
{
|
|
|
|
return highlight_image;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Instance methods
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (id) init
|
|
|
|
{
|
|
|
|
return [self initTextCell: @"aTitle"];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (id) initTextCell: (NSString *)aString
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-02-19 20:19:58 +00:00
|
|
|
[super initTextCell: aString];
|
|
|
|
// create image cells
|
1999-09-04 16:09:17 +00:00
|
|
|
_branchImage = RETAIN([isa branchImage]);
|
|
|
|
_highlightBranchImage = RETAIN([isa highlightedBranchImage]);
|
1999-02-19 20:19:58 +00:00
|
|
|
// create the text cell
|
1999-09-04 16:09:17 +00:00
|
|
|
_browserText = [[cellClass alloc] initTextCell: aString];
|
1999-02-19 20:19:58 +00:00
|
|
|
[_browserText setEditable: NO];
|
|
|
|
[_browserText setBordered: NO];
|
|
|
|
[_browserText setAlignment: NSLeftTextAlignment];
|
|
|
|
|
|
|
|
_alternateImage = nil;
|
|
|
|
_isLeaf = NO;
|
|
|
|
_isLoaded = NO;
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
[self setEditable: NO];
|
1999-02-19 20:19:58 +00:00
|
|
|
|
|
|
|
return self;
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) dealloc
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-09-04 16:09:17 +00:00
|
|
|
RELEASE(_branchImage);
|
|
|
|
RELEASE(_highlightBranchImage);
|
|
|
|
TEST_RELEASE(_alternateImage);
|
|
|
|
RELEASE(_browserText);
|
1999-02-19 20:19:58 +00:00
|
|
|
|
|
|
|
[super dealloc];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (id) copyWithZone: (NSZone*)zone
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-03-02 08:58:30 +00:00
|
|
|
NSBrowserCell *c = [super copyWithZone: zone];
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
c->_branchImage = RETAIN(_branchImage);
|
1999-02-19 20:19:58 +00:00
|
|
|
if (_alternateImage)
|
1999-09-04 16:09:17 +00:00
|
|
|
c->_alternateImage = RETAIN(_alternateImage);
|
|
|
|
c->_highlightBranchImage = RETAIN(_highlightBranchImage);
|
1999-03-02 08:58:30 +00:00
|
|
|
c->_browserText = [_browserText copyWithZone: zone]; // Copy the text cell
|
1999-02-19 20:19:58 +00:00
|
|
|
c->_isLeaf = _isLeaf;
|
|
|
|
c->_isLoaded = _isLoaded;
|
|
|
|
|
|
|
|
return c;
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Accessing Graphic Attributes
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (NSImage*) alternateImage
|
|
|
|
{
|
|
|
|
return _alternateImage;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) setAlternateImage: (NSImage *)anImage
|
|
|
|
{
|
|
|
|
ASSIGN(_alternateImage, anImage);
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Placing in the Browser Hierarchy
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (BOOL) isLeaf
|
|
|
|
{
|
|
|
|
return _isLeaf;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setLeaf: (BOOL)flag
|
|
|
|
{
|
|
|
|
_isLeaf = flag;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Determining Loaded Status
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (BOOL) isLoaded
|
|
|
|
{
|
|
|
|
return _isLoaded;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setLoaded: (BOOL)flag
|
|
|
|
{
|
|
|
|
_isLoaded = flag;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Setting State
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) reset
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-02-19 20:19:58 +00:00
|
|
|
cell_highlighted = NO;
|
|
|
|
cell_state = NO;
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) set
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-02-19 20:19:58 +00:00
|
|
|
cell_highlighted = YES;
|
|
|
|
cell_state = YES;
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Setting and accessing the NSCell's Value
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (double) doubleValue
|
|
|
|
{
|
|
|
|
return [_browserText doubleValue];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (float) floatValue
|
|
|
|
{
|
|
|
|
return [_browserText floatValue];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (int) intValue
|
|
|
|
{
|
|
|
|
return [_browserText intValue];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*) stringValue
|
|
|
|
{
|
|
|
|
return [_browserText stringValue];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setIntValue: (int)anInt
|
|
|
|
{
|
|
|
|
[_browserText setIntValue: anInt];
|
|
|
|
}
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) setDoubleValue: (double)aDouble
|
|
|
|
{
|
|
|
|
[_browserText setDoubleValue: aDouble];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) setFloatValue: (float)aFloat
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-02-19 20:19:58 +00:00
|
|
|
[_browserText setFloatValue: aFloat];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) setStringValue: (NSString*)aString
|
|
|
|
{
|
|
|
|
[_browserText setStringValue: aString];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Displaying
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-05-02 18:27:38 +00:00
|
|
|
NSRect title_rect = cellFrame;
|
|
|
|
NSRect image_rect = cellFrame;
|
|
|
|
NSImage *image = nil;
|
|
|
|
NSColor *backColor;
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1999-05-02 18:27:38 +00:00
|
|
|
control_view = controlView; // remember last view cell was drawn in
|
1999-02-19 20:19:58 +00:00
|
|
|
if (cell_highlighted || cell_state) // temporary hack FAR FIX ME?
|
|
|
|
{
|
1999-09-04 16:09:17 +00:00
|
|
|
backColor = [colorClass selectedControlColor];
|
1999-04-06 14:09:13 +00:00
|
|
|
[backColor set];
|
1999-02-19 20:19:58 +00:00
|
|
|
if (!_isLeaf)
|
|
|
|
{
|
|
|
|
image = _highlightBranchImage;
|
|
|
|
image_rect.size.height = cellFrame.size.height;
|
|
|
|
image_rect.size.width = image_rect.size.height;
|
|
|
|
// Right justify
|
|
|
|
image_rect.origin.x += cellFrame.size.width- image_rect.size.width;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
image_rect = NSZeroRect;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-05-02 18:27:38 +00:00
|
|
|
backColor = [[controlView window] backgroundColor];
|
1999-02-19 20:19:58 +00:00
|
|
|
[backColor set];
|
|
|
|
if (!_isLeaf)
|
|
|
|
{
|
|
|
|
image = _branchImage;
|
|
|
|
image_rect.size.height = cellFrame.size.height;
|
|
|
|
image_rect.size.width = image_rect.size.height;
|
|
|
|
// Right justify
|
|
|
|
image_rect.origin.x += cellFrame.size.width- image_rect.size.width;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
image_rect = NSZeroRect;
|
|
|
|
}
|
|
|
|
NSRectFill(cellFrame); // Clear the background
|
|
|
|
|
|
|
|
title_rect.size.width -= image_rect.size.width + 4; // draw the title cell
|
|
|
|
[_browserText drawWithFrame: title_rect inView: controlView];
|
|
|
|
|
|
|
|
if (image)
|
1999-05-02 18:27:38 +00:00
|
|
|
{
|
|
|
|
[image setBackgroundColor: backColor];
|
|
|
|
[self _drawImage: image inFrame: image_rect];
|
|
|
|
}
|
1999-02-19 20:19:58 +00:00
|
|
|
}
|
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* Editing Text
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) editWithFrame: (NSRect)aRect
|
|
|
|
inView: (NSView *)controlView
|
|
|
|
editor: (NSText *)textObject
|
|
|
|
delegate: (id)anObject
|
|
|
|
event: (NSEvent *)theEvent
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-02-19 20:19:58 +00:00
|
|
|
NSPoint location = [controlView convertPoint: [theEvent locationInWindow]
|
|
|
|
fromView: nil];
|
1998-11-25 17:16:48 +00:00
|
|
|
|
|
|
|
fprintf(stderr, " NSBrowserCell: editWithFrame --- ");
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
[_browserText _setCursorLocation: location];
|
|
|
|
[_browserText _setCursorVisibility: YES];
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
if ([[controlView window] makeFirstResponder: controlView])
|
|
|
|
fprintf(stderr, " XRBrowserCell: we are now first responder --- ");
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
[self drawInteriorWithFrame: aRect inView: controlView];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) endEditing: (NSText *)textObject
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-02-19 20:19:58 +00:00
|
|
|
[_browserText _setCursorVisibility: NO];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) _handleKeyEvent: (NSEvent*)keyEvent
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1999-02-19 20:19:58 +00:00
|
|
|
fprintf(stderr, " NSBrowserCell: _handleKeyEvent --- ");
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1999-02-19 20:19:58 +00:00
|
|
|
[_browserText _handleKeyEvent: keyEvent];
|
1998-11-25 17:16:48 +00:00
|
|
|
|
|
|
|
// [self drawInteriorWithFrame: aRect inView: controlView];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-09-04 16:09:17 +00:00
|
|
|
/*
|
|
|
|
* NSCoding protocol
|
|
|
|
*/
|
1999-02-19 20:19:58 +00:00
|
|
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
|
|
|
{
|
|
|
|
[super encodeWithCoder: aCoder];
|
|
|
|
|
|
|
|
[aCoder encodeObject: _browserText];
|
|
|
|
[aCoder encodeObject: _branchImage];
|
|
|
|
[aCoder encodeObject: _highlightBranchImage];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLeaf];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLoaded];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
|
|
|
{
|
|
|
|
[super initWithCoder: aDecoder];
|
|
|
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_browserText];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_branchImage];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_highlightBranchImage];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLeaf];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLoaded];
|
|
|
|
|
|
|
|
return self;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|