Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.

SelectionCell



Inherits From: Cell : Object
Declared In: appkit/SelectionCell.h



Class Description

SelectionCell is a subclass of Cell used to implement the visualization of hierarchical lists of names.  If the cell is a leaf, it displays its text only; otherwise it also displays a right arrow, similar to the way MenuCell indicates submenus.



Instance Variables

None declared in this class.



Method Types

Initializing a SelectionCell init
initTextCell:
Determining component sizes calcCellSize:inRect:
Accessing graphic attributes setLeaf:
isLeaf
isOpaque
Displaying drawSelf:inView:
drawInside:inView:
highlight:inView:lit:
Archiving awake



Instance Methods

awake
awake

Caches the arrow images if they aren't already, and returns the receiver, a newly unarchived instance of SelectionCell.  You shouldn't invoke this method; it's invoked as part of the read: method used to unarchive objects from typed streams.

See also:  read: (Cell)



calcCellSize:inRect:
calcCellSize:(NXSize *)theSize inRect:(const NXRect *)aRect

Returns by reference the minimum width and height required for displaying the SelectionCell in aRect.  Always leaves enough space for a menu arrow.  Returns self.



drawInside:inView:
drawInside:(const NXRect *)cellFrame inView:controlView

Displays the SelectionCell within cellFrame in controlView.  You never invoke this method directly; it's invoked by the drawSelf:: method of controlView.  Override this method if you create a subclass of SelectionCell that does its own drawing. Returns self.

See also:  drawSelf:inView:, lockFocus (View)



drawSelf:inView:
drawSelf:(const NXRect *)cellFrame inView:controlView

Simply invokes drawInside:inView: since a SelectionCell has nothing to draw except its insides.  You never invoke this method directly; it's invoked by the drawSelf:: method of controlView.

See also:  drawInside:inView:



highlight:inView:lit:
highlight:(const NXRect *)cellFrame
inView:aView
lit:(BOOL)flag

Sets the SelectionCell's highlighted state to flag and redraws it within cellFrame in aView.  Returns self.

See also:  highlight:inView:lit: (Cell)



init
init

Initializes and returns the receiver, a new instance of SelectionCell, with the default title "ListItem".  The new instance is set as a leaf.

See also:  initTextCell:, setLeaf:



initTextCell:
initTextCell:(const char *)aString

Initializes and returns the receiver, a new instance of SelectionCell, with aString as its title. The new instance is set as a leaf. This method is the designated initializer for SelectionCell; override this method if you create a subclass of SelectionCell that performs its own initialization.

See also:  init, setLeaf:



isLeaf
(BOOL)isLeaf

Returns YES if the cell is a leaf, NO otherwise.  If the cell is a leaf, it displays its text only; otherwise, it also displays a right arrow like the one that MenuCell displays to indicate submenus.

See also:  setLeaf:



isOpaque
(BOOL)isOpaque

Returns YES, since SelectionCells draw over all the pixels in their frames.



setLeaf:
setLeaf:(BOOL)flag

If flag is YES, sets the Cell to be a leaf, if NO, sets it to be a branch.  Leaf SelectionCells display text only; branch SelectionCells also display a right arrow like that displayed by MenuCell to indicate submenu entries.  This method does not display the SelectionCell, even if autodisplay is on.  Returns self.

See also:  isLeaf: