1996-05-30 20:03:15 +00:00
|
|
|
/*
|
|
|
|
NSBrowserCell.m
|
|
|
|
|
|
|
|
Cell class for the NSBrowser
|
|
|
|
|
1997-10-31 01:24:08 +00:00
|
|
|
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
|
|
|
Date: 1996
|
1998-11-25 17:16:48 +00:00
|
|
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
|
|
|
Date: October 1998
|
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.
|
|
|
|
|
|
|
|
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.
|
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>
|
|
|
|
#include <AppKit/NSImage.h>
|
1998-11-25 17:16:48 +00:00
|
|
|
#include <AppKit/NSEvent.h>
|
|
|
|
|
* 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
|
|
|
// Class variables
|
* 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
|
|
|
static NSImage *branch_image;
|
|
|
|
static NSImage *highlight_image;
|
|
|
|
|
* 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
|
|
|
// Private methods
|
* 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
|
|
|
@interface NSBrowserCell (Private)
|
|
|
|
- (void)setBranchImageCell:aCell;
|
|
|
|
- (void)setHighlightBranchImageCell:aCell;
|
|
|
|
- (void)setTextFieldCell:aCell;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation NSBrowserCell (Private)
|
|
|
|
|
* 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
|
|
|
- (void)setTextFieldCell:aCell { ASSIGN(_browserText, aCell); }
|
|
|
|
- (void)setBranchImageCell:aCell { ASSIGN(_branchImage, aCell); }
|
|
|
|
- (void)setHighlightBranchImageCell:aCell
|
|
|
|
{
|
|
|
|
ASSIGN(_highlightBranchImage, aCell);
|
|
|
|
}
|
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
|
|
|
|
|
|
|
//*****************************************************************************
|
1997-10-31 01:24:08 +00:00
|
|
|
//
|
* 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
|
|
|
// NSBrowserCell
|
1997-10-31 01:24:08 +00:00
|
|
|
//
|
* 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
|
|
|
|
|
|
|
|
//
|
|
|
|
// Class methods
|
|
|
|
//
|
|
|
|
+ (void)initialize
|
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
if (self == [NSBrowserCell class])
|
|
|
|
{
|
* 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
|
|
|
[self setVersion:1]; // The default images
|
|
|
|
ASSIGN(branch_image, [NSImage imageNamed: @"common_ArrowRight"]);
|
|
|
|
ASSIGN(highlight_image, [NSImage imageNamed: @"common_ArrowRightH"]);
|
1998-11-25 17:16:48 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Accessing Graphic Attributes
|
|
|
|
//
|
1998-11-25 17:16:48 +00:00
|
|
|
+ (NSImage *)branchImage { return branch_image; }
|
|
|
|
+ (NSImage *)highlightedBranchImage { return highlight_image; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Instance methods
|
|
|
|
//
|
1998-11-25 17:16:48 +00:00
|
|
|
- init
|
|
|
|
{
|
|
|
|
return [self initTextCell: @"aTitle"];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- initTextCell:(NSString *)aString
|
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
[super initTextCell: aString];
|
|
|
|
// create image cells
|
* 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
|
|
|
_branchImage = [[NSBrowserCell branchImage] retain];
|
|
|
|
_highlightBranchImage = [[NSBrowserCell highlightedBranchImage] retain];
|
1998-11-25 17:16:48 +00:00
|
|
|
// create the text cell
|
* 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
|
|
|
_browserText = [[[NSCell alloc] initTextCell: aString] retain];
|
1998-11-25 17:16:48 +00:00
|
|
|
[_browserText setEditable: NO];
|
|
|
|
[_browserText setBordered: NO];
|
* 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
|
|
|
[_browserText setAlignment:NSLeftTextAlignment];
|
1998-11-25 17:16:48 +00:00
|
|
|
|
|
|
|
_alternateImage = nil;
|
|
|
|
_isLeaf = NO;
|
|
|
|
_isLoaded = NO;
|
|
|
|
|
|
|
|
[self setEditable: YES];
|
|
|
|
|
|
|
|
return self;
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
[_branchImage release];
|
|
|
|
[_highlightBranchImage release];
|
* 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
|
|
|
if(_alternateImage)
|
|
|
|
[_alternateImage release];
|
1998-11-25 17:16:48 +00:00
|
|
|
[_browserText release];
|
|
|
|
|
|
|
|
[super dealloc];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id)copyWithZone:(NSZone*)zone
|
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
NSBrowserCell* c = [super copyWithZone:zone];
|
|
|
|
// Copy the image cells
|
* 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
|
|
|
c->_branchImage = [_branchImage retain];
|
|
|
|
if(_alternateImage)
|
|
|
|
c->_alternateImage = [_alternateImage retain];
|
|
|
|
c->_highlightBranchImage = [_highlightBranchImage retain];
|
|
|
|
c->_browserText = [[_browserText copy] retain]; // Copy the text cell
|
|
|
|
c->_isLeaf = _isLeaf;
|
|
|
|
c->_isLoaded = _isLoaded;
|
1998-11-25 17:16:48 +00:00
|
|
|
|
|
|
|
return c;
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
|
|
|
// Accessing Graphic Attributes
|
|
|
|
//
|
1998-11-25 17:16:48 +00:00
|
|
|
- (NSImage *)alternateImage { return _alternateImage; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setAlternateImage:(NSImage *)anImage
|
* 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
|
|
|
{ // set image to display
|
|
|
|
ASSIGN(_alternateImage, anImage); // when highlighted
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Placing in the Browser Hierarchy
|
|
|
|
//
|
1998-11-25 17:16:48 +00:00
|
|
|
- (BOOL)isLeaf { return _isLeaf; }
|
|
|
|
- (void)setLeaf:(BOOL)flag { _isLeaf = flag; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Determining Loaded Status
|
|
|
|
//
|
1998-11-25 17:16:48 +00:00
|
|
|
- (BOOL)isLoaded { return _isLoaded; }
|
|
|
|
- (void)setLoaded:(BOOL)flag { _isLoaded = flag; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Setting State
|
|
|
|
//
|
|
|
|
- (void)reset
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
cell_highlighted = NO;
|
|
|
|
cell_state = NO;
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)set
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
cell_highlighted = YES;
|
|
|
|
cell_state = YES;
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
1998-11-25 17:16:48 +00:00
|
|
|
// Setting and accessing the NSCell's Value
|
1997-10-31 01:24:08 +00:00
|
|
|
//
|
1998-11-25 17:16:48 +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]; }
|
|
|
|
|
|
|
|
- (void)setDoubleValue:(double)aDouble
|
|
|
|
{
|
|
|
|
[_browserText setDoubleValue:aDouble];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:16:48 +00:00
|
|
|
- (void)setFloatValue:(float)aFloat
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
[_browserText setFloatValue: aFloat];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:16:48 +00:00
|
|
|
- (void)setStringValue:(NSString *)aString
|
|
|
|
{
|
|
|
|
[_browserText setStringValue: aString];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:16:48 +00:00
|
|
|
//
|
|
|
|
// Displaying
|
|
|
|
//
|
|
|
|
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
NSRect title_rect = cellFrame;
|
|
|
|
NSRect image_rect = cellFrame;
|
|
|
|
NSImage *image = nil;
|
|
|
|
|
|
|
|
control_view = controlView; // remember last view
|
|
|
|
// cell was drawn in
|
|
|
|
if (cell_highlighted || cell_state) // temporary hack FAR FIX ME?
|
|
|
|
{
|
|
|
|
NSColor *white = [NSColor whiteColor];
|
|
|
|
|
|
|
|
[white set];
|
* 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
|
|
|
// [_browserText setBackgroundColor: white];
|
1998-11-25 17:16:48 +00:00
|
|
|
if (!_isLeaf)
|
|
|
|
{
|
* 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
|
|
|
image = _highlightBranchImage;
|
1998-11-25 17:16:48 +00:00
|
|
|
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
|
|
|
|
{
|
|
|
|
NSColor *backColor = [[controlView window] backgroundColor];
|
|
|
|
|
|
|
|
[backColor set];
|
* 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
|
|
|
// [_browserText setBackgroundColor:backColor];
|
1998-11-25 17:16:48 +00:00
|
|
|
if (!_isLeaf)
|
|
|
|
{
|
* 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
|
|
|
image = _branchImage;
|
1998-11-25 17:16:48 +00:00
|
|
|
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) // Draw the image
|
1999-02-15 12:50:49 +00:00
|
|
|
[self _drawImage:image inFrame:image_rect];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:16:48 +00:00
|
|
|
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
|
|
|
|
{ // no border so just
|
|
|
|
// draw the interior
|
|
|
|
[self drawInteriorWithFrame: cellFrame inView: controlView];
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Editing Text
|
|
|
|
//
|
|
|
|
- (void)editWithFrame:(NSRect)aRect
|
|
|
|
inView:(NSView *)controlView
|
|
|
|
editor:(NSText *)textObject
|
|
|
|
delegate:(id)anObject
|
|
|
|
event:(NSEvent *)theEvent
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
NSPoint location = [controlView convertPoint:[theEvent locationInWindow]
|
|
|
|
fromView:nil];
|
|
|
|
|
|
|
|
fprintf(stderr, " NSBrowserCell: editWithFrame --- ");
|
|
|
|
|
|
|
|
[_browserText _setCursorLocation:location];
|
|
|
|
[_browserText _setCursorVisibility: YES];
|
|
|
|
|
|
|
|
if ([[controlView window] makeFirstResponder:controlView])
|
|
|
|
fprintf(stderr, " XRBrowserCell: we are now first responder --- ");
|
|
|
|
|
|
|
|
[self drawInteriorWithFrame: aRect inView: controlView];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:16:48 +00:00
|
|
|
- (void)endEditing:(NSText *)textObject
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
[_browserText _setCursorVisibility: NO];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:16:48 +00:00
|
|
|
- (void)_handleKeyEvent:(NSEvent*)keyEvent
|
1997-10-31 01:24:08 +00:00
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
fprintf(stderr, " NSBrowserCell: _handleKeyEvent --- ");
|
|
|
|
|
|
|
|
[_browserText _handleKeyEvent:keyEvent];
|
|
|
|
|
|
|
|
// [self drawInteriorWithFrame: aRect inView: controlView];
|
1997-10-31 01:24:08 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// NSCoding protocol
|
|
|
|
//
|
|
|
|
- (void)encodeWithCoder:aCoder
|
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
[super encodeWithCoder:aCoder];
|
|
|
|
|
|
|
|
[aCoder encodeObject: _browserText];
|
|
|
|
[aCoder encodeObject: _branchImage];
|
|
|
|
[aCoder encodeObject: _highlightBranchImage];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLeaf];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLoaded];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- initWithCoder:aDecoder
|
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
[super initWithCoder:aDecoder];
|
|
|
|
|
|
|
|
_browserText = [aDecoder decodeObject];
|
|
|
|
_branchImage = [aDecoder decodeObject];
|
|
|
|
_highlightBranchImage = [aDecoder decodeObject];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLeaf];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLoaded];
|
|
|
|
|
|
|
|
return self;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|