# NSCell

scottc@net-community.com

The abstract cell class

1996 Free Software Foundation, Inc.
Software documentation for the NSCell class
AppKit/NSCell.h
NSCopying
NSCoding

TODO Desctiption

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
defaultFocusRingType
Description forthcoming.
defaultMenu
Description forthcoming.
prefersTrackingUntilMouseUp

This class method returns `NO`. This method should be overrided by subclasses.

acceptsFirstResponder
Description forthcoming.
action

Implemented by subclasses to return the action method. The NSCell implementaiton returns NULL.

See Also: -setAction: -setTarget: -target

alignment

Returns the alignment of the text used in the NSCell. See NSTextAlignment for more informations. By default the text alignment is NSJustifiedTextAlignment

See Also: -setAlignment:

allowsEditingTextAttributes
Description forthcoming.
allowsMixedState
Description forthcoming.
allowsUndo
Description forthcoming.
attributedStringValue
Description forthcoming.
baseWritingDirection
Description forthcoming.
calcDrawInfo:
aRect

Does nothing. This method is used by subclasses to recalculate sizes

It is usally called from a NSControl object

See Also: [NSControl -calcSize]

cellAttribute:
aParameter

Returns some NSCell's attributes for the specified NSCellAttribute

See Also: -setCellAttribute:to:

cellSize
Returns the minimun size needed to display the NSCell. This size is calculate by adding : the borders (plain or bezeled) size the spacing between the border and inside the cell the TODO... if the cell is type of NSTextCellType or the image size if the cell has a NSImageCellType type.

This method returns NSZeroSize if the cell has a NSNullCellType type (Cocoa returns a very big size instead).

cellSizeForBounds:
aRect

TODO. Currently the GNUstep implementation returns -cellSize

See Also: -cellSize

compare:
otherCell
Compares the reciever to another to another NSCell. The argument must be an NSCell sublclass and have the NSCellType NSTextCellType. Returns the result of the comparison of each cell's stringValue.
continueTracking:
lastPoint
at:
currentPoint
inView:
controlView

Returns `YES`. Subclasses should overrided this method if you want stop tracking the mouse. This method is call in the -trackMouse:inRect:ofView:untilMouseUp: main loop.

See Also: -trackMouse:inRect:ofView:untilMouseUp:

controlSize
Description forthcoming.
controlTint
Description forthcoming.
controlView

This method is used by subclasses to get the control view. This method returns `nil`.

doubleValue

Returns the NSCell's value as a double.

See Also: -setDoubleValue:

drawInteriorWithFrame:
cellFrame
inView:
controlView

This drawing is minimal and with no background, to make it easier for subclass to customize drawing.

drawWithFrame:
cellFrame
inView:
controlView

Draws the cell in controlView

drawingRectForBounds:
theRect

TODO

editWithFrame:
aRect
inView:
controlView
editor:
textObject
delegate:
anObject
event:
theEvent

.This method does nothing if a the controlView is `nil`, if text object does not exist or if the cell's type is not NSTextCellType

endEditing:
textObject

Ends any text editing. This method sets the text object's delegate to `nil`, and remove the NSClipView and the text object used for editing

See Also: -editWithFrame:inView:editor:delegate:event:

entryType

TODO

floatValue

Returns the cell's value as a float.

See Also: -setFloatValue:

focusRingType
Description forthcoming.
font

Returns the font of the text used in the NSCell

See Also: -setFont:

formatter
Description forthcoming.
getPeriodicDelay:
delay
interval:
interval

Gets the NSCell's delay and the interval parameters used when NSCell sends continouly action messages. The NSCell implementation sets both delay and interval to 0.1.

See Also: -trackMouse:inRect:ofView:untilMouseUp:

hasValidObjectValue
Description forthcoming.
highlight:
lit
withFrame:
cellFrame
inView:
controlView

TODO explain

highlightColorWithFrame:
cellFrame
inView:
controlView
Description forthcoming.
image

Returns the NSCell's image if the NSCell's type is NSImageCellType , returns `nil` otherwise.

See Also: -setImage: -setType: -type

imageRectForBounds:
theRect

The GNUstep implementation returns -drawingRectForBounds:

importsGraphics
Description forthcoming.
initImageCell:
anImage

Initializes and returns a new NSCell with a NSImage anImage. This method sets the image position to NSImageOnly and the cell's type to NSImageCellType .

See Also: -initTextCell:

initTextCell:
aString

Initializes and returns a new NSCell with a NSString aString. This method sets the cell's type to NSTextCellType .

See Also: -initImageCell:

intValue

Returns the cell's value as an int.

See Also: -setIntValue:

isBezeled

Returns whether the NSCell has a bezeled border. By default a NSCell has no bezeled border

See Also: -setBezeled:

isBordered

Returns whether the NSCell has a border. By default a NSCell has border

See Also: -setBordered: -setBezeled: -isBezeled

isContinuous

Returns whether the cell can continuously send its action messages.

See Also: -setContinuous:

isEditable

Returns whether the cell is editable.By default a NSCell is not editable.

See Also: -setEditable:

isEnabled

Returns whether the NSCell can respond to mouse events.

See Also: -setEnabled:

isEntryAcceptable:
aString
Description forthcoming.
isHighlighted

Returns whether the cell is highlighted. By default `NO`

See Also: -setHighlighted:

isOpaque

Returns whether the cell is opaque. Return `NO` by default

isScrollable

Returns whether the NSCell is scrollable. By default a NSCell is not scrollable

See Also: -setScrollable:

isSelectable

Returns whether the cell is selectable. This method returns `YES` if the cell is selectable or editable. `NO` otherwise

See Also: -setSelectable: -isEditable -setEditable:

keyEquivalent

Implemented by subclasses to returns the key equivalent. The NSCell implementation returns an empty NSString.

lineBreakMode
Description forthcoming.
menu
Description forthcoming.
menuForEvent:
anEvent
inRect:
cellFrame
ofView:
aView
Description forthcoming.
mnemonic
Description forthcoming.
mnemonicLocation
Description forthcoming.
mouseDownFlags

Returns the mouse flags. This flags are usally sets in the -trackMouse:inRect:ofView:untilMouseUp: method

nextState
Description forthcoming.
objectValue
Description forthcoming.
performClick:
sender
Simulates a single click in the cell (only works with controls which have no more than one cell). This method is deprecated, performClickWithFrame:inView: is the right method to use now.
performClickWithFrame:
cellFrame
inView:
controlView
Simulates a single click in the cell. The display of the cell with this event occurs in the area delimited by cellFrame within controlView.
refusesFirstResponder
Description forthcoming.
representedObject

Returns the NSCell's represented object

See Also: -setRepresentedObject:

resetCursorRect:
cellFrame
inView:
controlView

TODO

selectWithFrame:
aRect
inView:
controlView
editor:
textObject
delegate:
anObject
start:
selStart
length:
selLength

This method does nothing if the controlView is `nil`, if text object does not exist or if the cell's type is not NSTextCellType

sendActionOn:
mask

TODO Explain

sendsActionOnEndEditing
Description forthcoming.
setAction:
aSelector

Implemented by subclasses to set the action method. The NSCell implementation raises a NSInternalInconsistencyException

See Also: -action -setTarget: -target

setAlignment:
mode

Sets the alignment of the text. See NSTextAlignment .

See Also: -alignment

setAllowsEditingTextAttributes:
flag
Description forthcoming.
setAllowsMixedState:
flag
Description forthcoming.
setAllowsUndo:
flag
Description forthcoming.
setAttributedStringValue:
attribStr
Description forthcoming.
setBaseWritingDirection:
direction
Description forthcoming.
setBezeled:
flag

Sets whether the cell has a bezeled border. If this method is called, the bordered flag is turn off. By default a NSCell has no bezeled border

See Also: -isBezeled -setBordered: -isBordered

setBordered:
flag

Sets whether the cell has a border. If this method is called, the bezeled flag is turn off. By default a NSCell has no border

See Also: -isBordered -setBezeled: -isBezeled

setCellAttribute:
aParameter
to:
value

TODO

See Also: -cellAttribute:

setContinuous:
flag

Sets whether the cell can continuously send its action messages.

See Also: -isContinuous

setControlSize:
controlSize
Description forthcoming.
setControlTint:
controlTint
Description forthcoming.
setControlView:
view

This method is used by subclasses to specify the control view.

setDoubleValue:
aDouble

Sets the NSCell's value to aDouble.

See Also: -doubleValue

setEditable:
flag

Sets whether the NSCell's text is editable.

See Also: -isEditable -setSelectable: -isSelectable

setEnabled:
flag

Sets whether the NSCell can respond to mouse events

See Also: -isEnabled

setEntryType:
aType

TODO

setFloatValue:
aFloat

Sets the NSCell's value to a aFloat. This used for example in NSSliderCell

See Also: -floatValue

setFloatingPointFormat:
autoRange
left:
leftDigits
right:
rightDigits
Description forthcoming.
setFocusRingType:
type
Description forthcoming.
setFont:
fontObject

Sets the text font. The NSCell's type is set to NSTextCellType if needed

See Also: -font -setType: -type

setFormatter:
newFormatter
Description forthcoming.
setHighlighted:
flag

Sets whether the NSCell is highlighted.

See Also: -isHighlighted

setImage:
anImage

Sets the NSCell's image to anImage. This method sets the cell's type to NSImageCellType if needed. Raises an NSInvalidArgumentException if the anImage is not an NSImage (sub)class. The new image is retained and the old one is released

See Also: -image

setImportsGraphics:
flag
Description forthcoming.
setIntValue:
anInt

Sets the NSCell's value to anInt.

See Also: -intValue

setLineBreakMode:
mode
Description forthcoming.
setMenu:
aMenu
Description forthcoming.
setMnemonicLocation:
location
Description forthcoming.
setNextState
Description forthcoming.
setObjectValue:
object
Description forthcoming.
setRefusesFirstResponder:
flag
Description forthcoming.
setRepresentedObject:
anObject

Sets the NSCell's represented object to anObject. anObject will be retain.

See Also: -representedObject

setScrollable:
flag

Sets whether the NCell is scrollable. By default a NSCell is not scrollable

See Also: -isSelectable

setSelectable:
flag

Sets whether the cell selectable. Making a cell unselectable also makes it uneditable until a -setEditable: re-enables it.

See Also: -isSelectable -setEditable: -isEditable

setSendsActionOnEndEditing:
flag
Description forthcoming.
setShowsFirstResponder:
flag
Description forthcoming.
setState:
value

Sets the NSCell's state. Please use always symbolic constants when calling this method. The integer values could be changed in the this implementation. (Currently they match the Cocoa values but they are quite strange)

See Also: -state

setStringValue:
aString

Sets the cell's value to a NSString. The NSCell's type is set to NSTextCellType if needed

See Also: -stringValue

setTag:
anInt

Implemented by sublclasses to assigns the tag anInt. The NSCell implementation raises an NSInvalidArgumentException.

See Also: -tag

setTarget:
anObject

Implemented by subclasses to set the target object. The NSCell implementation raises a NSInternalInconsistencyException

See Also: -target -setAction: -action

setTitle:
aString
Description forthcoming.
setTitleWithMnemonic:
aString
Description forthcoming.
setType:
aType

Sets the NSCell's type. See NSCellType .If the cell is set to NSTextCellType, the cell is given a default title and is reset to the default system font.

See Also: -type

setUpFieldEditorAttributes:
textObject
Description forthcoming.
setWraps:
flag
Description forthcoming.
showsFirstResponder
Description forthcoming.
startTrackingAt:
startPoint
inView:
controlView

Returns whether tracking starts. The NSCell implementation returns `YES` when the startPoint is into the control view retangle, `NO` otherwise. This method is call at the early stage of -trackMouse:inRect:ofView:untilMouseUp:

See Also: [NSView -mouse:inRect:] -trackMouse:inRect:ofView:untilMouseUp:

state

Returns the NSCell's state

See Also: -setState:

stopTracking:
lastPoint
at:
stopPoint
inView:
controlView
mouseIsUp:
flag

TODO

stringValue

Returns the cell's value as a NSString.

See Also: -setStringValue:

tag

Implemented by subclasses to Return the tag. The NSCell implementation returns -1

See Also: -setTag:

takeDoubleValueFrom:
sender

Sets the NSCell's double value to sender's double value

See Also: -setDoubleValue:

takeFloatValueFrom:
sender

Sets the NSCell's float value to sender's float value

See Also: -setFloatValue:

takeIntValueFrom:
sender

Sets the NSCell's int value to sender's int value

See Also: -setIntValue:

takeObjectValueFrom:
sender
Description forthcoming.
takeStringValueFrom:
sender

Sets the NSCell's NSString value to sender's NSSting value

See Also: -setStringValue:

target

Implemented by subclass to return the target object. The NSCell implementation returns `nil`

See Also: -setTarget: -setAction: -action

title
Description forthcoming.
titleRectForBounds:
theRect

TODO

trackMouse:
theEvent
inRect:
cellFrame
ofView:
controlView
untilMouseUp:
flag
Description forthcoming.
type

Returns the cell's type. Returns NSNullCellType if the cell's type flag is set to NSImageCellType and if the cell's image is `nil`. See NSCellType for more information.

See Also -setType:

wraps
Description forthcoming.
Software documentation for the NSCell(PrivateMethods) category
AppKit/NSCell.h
Warning this category is private, which means that the methods are for internal use by the package. You should not use them in external code.
_drawAttributedString
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
Private internal method, returns an attributed string to display.
_drawAttributedText:
aString
inFrame:
aRect
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
Private internal method to display an attributed string.
Important: text should always be vertically centered without considering descender [as if descender did not exist]. This is particularly important for single line texts. Please make sure the output remains always correct.
_drawBorderAndBackgroundWithFrame:
cellFrame
inView:
controlView
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
_drawFocusRingWithFrame:
cellFrame
inView:
controlView
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
_drawText:
aString
inFrame:
cellFrame
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
Important: text should always be vertically centered without considering descender [as if descender did not exist]. This is particularly important for single line texts. Please make sure the output remains always correct.
_nonAutoreleasedTypingAttributes
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
_sendsActionOn:
eventTypeMask
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
_sizeText:
title
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.
textColor
Description forthcoming.