Up
Authors
- Scott Christley (
scottc@net-community.com
)
-
The abstract cell class
Copyright: (C) 1996-2012 Free Software Foundation, Inc.
- Declared in:
- AppKit/NSCell.h
- Conforms to:
- NSCopying
- NSCoding
Availability: OpenStep
Instance Variables
Method summary
+ (
NSFocusRingType)
defaultFocusRingType;
Availability: MacOS-X 10.3.0
Description forthcoming.
+ (
NSMenu*)
defaultMenu;
Availability: MacOS-X 10.0.0
Description forthcoming.
+ (BOOL)
prefersTrackingUntilMouseUp;
Availability: OpenStep
This class method returns NO
. This
method should be overrided by subclasses.
- (BOOL)
acceptsFirstResponder;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (SEL)
action;
Availability: OpenStep
- (NSTextAlignment)
alignment;
Availability: OpenStep
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:
- (BOOL)
allowsEditingTextAttributes;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (BOOL)
allowsMixedState;
Availability: OpenStep
Description forthcoming.
- (BOOL)
allowsUndo;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (
NSAttributedString*)
attributedStringValue;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (NSWritingDirection)
baseWritingDirection;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (void)
calcDrawInfo: (
NSRect)aRect;
Availability: OpenStep
Does nothing. This method is used by subclasses to
recalculate sizes
It is usally called from a NSControl object
See Also:
[NSControl -calcSize]
- (
NSSize)
cellSize;
Availability: OpenStep
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).
- (
NSSize)
cellSizeForBounds: (
NSRect)aRect;
Availability: OpenStep
- (
NSComparisonResult)
compare: (id)otherCell;
Availability: OpenStep
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.
- (BOOL)
continueTracking: (
NSPoint)lastPoint
at: (
NSPoint)currentPoint
inView: (
NSView*)controlView;
Availability: OpenStep
- (
NSControlSize)
controlSize;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSControlTint)
controlTint;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSView*)
controlView;
Availability: OpenStep
This method is used by subclasses to get the control
view. This method returns nil
.
- (double)
doubleValue;
Availability: OpenStep
- (void)
drawInteriorWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
This drawing is minimal and with no background, to
make it easier for subclass to customize drawing.
- (void)
drawWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
Draws the cell in controlView
- (
NSRect)
drawingRectForBounds: (
NSRect)theRect;
Availability: OpenStep
- (void)
editWithFrame: (
NSRect)aRect
inView: (
NSView*)controlView
editor: (NSText*)textObject
delegate: (id)anObject
event: (
NSEvent*)theEvent;
Availability: OpenStep
.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
- (void)
endEditing: (NSText*)textObject;
Availability: OpenStep
- (
NSInteger)
entryType;
Availability: OpenStep
- (float)
floatValue;
Availability: OpenStep
- (
NSFocusRingType)
focusRingType;
Availability: MacOS-X 10.3.0
Description forthcoming.
- (
NSFont*)
font;
Availability: OpenStep
Returns the font of the text used in the NSCell
See Also:
-setFont:
- (id)
formatter;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
getPeriodicDelay: (float*)delay
interval: (float*)interval;
Availability: OpenStep
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:
- (BOOL)
hasValidObjectValue;
Availability: OpenStep
Description forthcoming.
- (void)
highlight: (BOOL)lit
withFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
- (
NSColor*)
highlightColorWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSUInteger)
hitTestForEvent: (
NSEvent*)event
inRect: (
NSRect)cellFrame
ofView: (
NSView*)controlView;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (
NSImage*)
image;
Availability: OpenStep
- (
NSRect)
imageRectForBounds: (
NSRect)theRect;
Availability: OpenStep
Frame the image gets drawn in
- (BOOL)
importsGraphics;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (id)
initImageCell: (
NSImage*)anImage;
Availability: OpenStep
- (id)
initTextCell: (
NSString*)aString;
Availability: OpenStep
- (int)
intValue;
Availability: OpenStep
- (
NSInteger)
integerValue;
Availability: MacOS-X 10.5.0
- (BOOL)
isBezeled;
Availability: OpenStep
Returns whether the NSCell has a bezeled border.
By default a NSCell has no bezeled border
See Also:
-setBezeled:
- (BOOL)
isBordered;
Availability: OpenStep
- (BOOL)
isContinuous;
Availability: OpenStep
Returns whether the cell can continuously send
its action messages.
See Also:
-setContinuous:
- (BOOL)
isEditable;
Availability: OpenStep
Returns whether the cell is editable.By default a
NSCell is not editable.
See Also:
-setEditable:
- (BOOL)
isEnabled;
Availability: OpenStep
Returns whether the NSCell can respond to mouse
events.
See Also:
-setEnabled:
- (BOOL)
isEntryAcceptable: (
NSString*)aString;
Availability: OpenStep
Description forthcoming.
- (BOOL)
isHighlighted;
Availability: OpenStep
Returns whether the cell is highlighted. By
default NO
See Also:
-setHighlighted:
- (BOOL)
isOpaque;
Availability: OpenStep
Returns whether the cell is opaque. Return
NO
by default
- (BOOL)
isScrollable;
Availability: OpenStep
Returns whether the NSCell is scrollable. By
default a NSCell is not scrollable
See Also:
-setScrollable:
- (BOOL)
isSelectable;
Availability: OpenStep
- (
NSString*)
keyEquivalent;
Availability: OpenStep
Implemented by subclasses to returns the key
equivalent. The NSCell implementation returns
an empty NSString.
- (NSLineBreakMode)
lineBreakMode;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (
NSMenu*)
menu;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSMenu*)
menuForEvent: (
NSEvent*)anEvent
inRect: (
NSRect)cellFrame
ofView: (
NSView*)aView;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSString*)
mnemonic;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSUInteger)
mnemonicLocation;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSInteger)
mouseDownFlags;
Availability: OpenStep
- (
NSInteger)
nextState;
Availability: OpenStep
Description forthcoming.
- (id)
objectValue;
Availability: OpenStep
Description forthcoming.
- (void)
performClick: (id)sender;
Availability: MacOS-X 10.0.0
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.
- (void)
performClickWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: MacOS-X 10.0.0
Simulates a single click in the cell. The display
of the cell with this event occurs in the area delimited
by cellFrame within controlView.
- (BOOL)
refusesFirstResponder;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (id)
representedObject;
Availability: OpenStep
- (void)
resetCursorRect: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
- (void)
selectWithFrame: (
NSRect)aRect
inView: (
NSView*)controlView
editor: (NSText*)textObject
delegate: (id)anObject
start: (
NSInteger)selStart
length: (
NSInteger)selLength;
Availability: OpenStep
This method does nothing if the
controlView is nil
, if text
object does not exist or if the cell's type is not
NSTextCellType
- (BOOL)
sendsActionOnEndEditing;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setAction: (SEL)aSelector;
Availability: OpenStep
Implemented by subclasses to set the action
method. The NSCell implementation raises a
NSInternalInconsistencyException
See Also:
-action
-setTarget:
-target
- (void)
setAlignment: (NSTextAlignment)mode;
Availability: OpenStep
Sets the alignment of the text. See
NSTextAlignment
.
See Also:
-alignment
- (void)
setAllowsEditingTextAttributes: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setAllowsMixedState: (BOOL)flag;
Availability: OpenStep
Description forthcoming.
- (void)
setAllowsUndo: (BOOL)flag;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (void)
setAttributedStringValue: (
NSAttributedString*)attribStr;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setBaseWritingDirection: (NSWritingDirection)direction;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (void)
setBezeled: (BOOL)flag;
Availability: OpenStep
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
- (void)
setBordered: (BOOL)flag;
Availability: OpenStep
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
- (void)
setContinuous: (BOOL)flag;
Availability: OpenStep
Sets whether the cell can continuously send its
action messages.
See Also:
-isContinuous
- (void)
setControlSize: (
NSControlSize)controlSize;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setControlTint: (
NSControlTint)controlTint;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setControlView: (
NSView*)view;
Availability: MacOS-X 10.4.0
This method is used by subclasses to specify the
control view.
- (void)
setDoubleValue: (double)aDouble;
Availability: OpenStep
- (void)
setEditable: (BOOL)flag;
Availability: OpenStep
- (void)
setEnabled: (BOOL)flag;
Availability: OpenStep
Sets whether the NSCell can respond to mouse events
See Also:
-isEnabled
- (void)
setEntryType: (
NSInteger)aType;
Availability: OpenStep
- (void)
setFloatValue: (float)aFloat;
Availability: OpenStep
Sets the NSCell's value to a aFloat. This
used for example in NSSliderCell
See Also:
-floatValue
- (void)
setFloatingPointFormat: (BOOL)autoRange
left: (
NSUInteger)leftDigits
right: (
NSUInteger)rightDigits;
Availability: OpenStep
Description forthcoming.
- (void)
setFocusRingType: (
NSFocusRingType)type;
Availability: MacOS-X 10.3.0
Description forthcoming.
- (void)
setFont: (
NSFont*)fontObject;
Availability: OpenStep
Sets the text font. The NSCell's type is set to
NSTextCellType if needed
See Also: -font
-setType:
-type
- (void)
setFormatter: (
NSFormatter*)newFormatter;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setHighlighted: (BOOL)flag;
Availability: MacOS-X 10.0.0
- (void)
setImage: (
NSImage*)anImage;
Availability: OpenStep
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
- (void)
setImportsGraphics: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setIntValue: (int)anInt;
Availability: OpenStep
Sets the NSCell's value to anInt.
See Also:
-intValue
- (void)
setIntegerValue: (
NSInteger)anInt;
Availability: MacOS-X 10.5.0
- (void)
setLineBreakMode: (NSLineBreakMode)mode;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (void)
setMenu: (
NSMenu*)aMenu;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setMnemonicLocation: (
NSUInteger)location;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setNextState;
Availability: OpenStep
Description forthcoming.
- (void)
setObjectValue: (id)object;
Availability: OpenStep
Description forthcoming.
- (void)
setRefusesFirstResponder: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setRepresentedObject: (id)anObject;
Availability: OpenStep
Sets the NSCell's represented object to
anObject. anObject will be
retain.
See Also:
-representedObject
- (void)
setScrollable: (BOOL)flag;
Availability: OpenStep
Sets whether the NCell is scrollable. By default a
NSCell is not scrollable
See Also:
-isSelectable
- (void)
setSelectable: (BOOL)flag;
Availability: OpenStep
- (void)
setSendsActionOnEndEditing: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setShowsFirstResponder: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setState: (
NSInteger)value;
Availability: OpenStep
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
- (void)
setStringValue: (
NSString*)aString;
Availability: OpenStep
Sets the cell's value to a NSString. The NSCell's
type is set to NSTextCellType if needed
See Also:
-stringValue
- (void)
setTag: (
NSInteger)anInt;
Availability: OpenStep
Implemented by sublclasses to assigns the tag
anInt. The NSCell implementation raises
an NSInvalidArgumentException.
See Also: -tag
- (void)
setTarget: (id)anObject;
Availability: OpenStep
Implemented by subclasses to set the target
object. The NSCell implementation raises a
NSInternalInconsistencyException
See Also:
-target
-setAction:
-action
- (void)
setTitle: (
NSString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setTitleWithMnemonic: (
NSString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setType: (
NSCellType)aType;
Availability: OpenStep
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
- (NSText*)
setUpFieldEditorAttributes: (NSText*)textObject;
Availability: OpenStep
Description forthcoming.
- (void)
setWraps: (BOOL)flag;
Availability: OpenStep
Description forthcoming.
- (BOOL)
showsFirstResponder;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (BOOL)
startTrackingAt: (
NSPoint)startPoint
inView: (
NSView*)controlView;
Availability: OpenStep
- (void)
stopTracking: (
NSPoint)lastPoint
at: (
NSPoint)stopPoint
inView: (
NSView*)controlView
mouseIsUp: (BOOL)flag;
Availability: OpenStep
Default implementation of this method in NSCell
does nothing.
- (
NSString*)
stringValue;
Availability: OpenStep
- (
NSInteger)
tag;
Availability: OpenStep
Implemented by subclasses to Return the tag.
The NSCell implementation returns -1
See Also:
-setTag:
- (void)
takeDoubleValueFrom: (id)sender;
Availability: OpenStep
Sets the NSCell's double value to
sender's double value
See Also:
-setDoubleValue:
- (void)
takeFloatValueFrom: (id)sender;
Availability: OpenStep
Sets the NSCell's float value to
sender's float value
See Also:
-setFloatValue:
- (void)
takeIntValueFrom: (id)sender;
Availability: OpenStep
Sets the NSCell's int value to
sender's int value
See Also:
-setIntValue:
- (void)
takeIntegerValueFrom: (id)sender;
Availability: MacOS-X 10.5.0
Sets the NSCell's NSInteger value to sender's
NSInteger value
See Also:
-setIntegerValue:
- (void)
takeObjectValueFrom: (id)sender;
Availability: OpenStep
Description forthcoming.
- (void)
takeStringValueFrom: (id)sender;
Availability: OpenStep
Sets the NSCell's NSString value to sender's NSSting
value
See Also:
-setStringValue:
- (id)
target;
Availability: OpenStep
- (
NSString*)
title;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSRect)
titleRectForBounds: (
NSRect)theRect;
Availability: OpenStep
Frame the title gets drawn in
- (BOOL)
trackMouse: (
NSEvent*)theEvent
inRect: (
NSRect)cellFrame
ofView: (
NSView*)controlView
untilMouseUp: (BOOL)flag;
Availability: OpenStep
Description forthcoming.
- (
NSCellType)
type;
Availability: OpenStep
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:
- (BOOL)
wraps;
Availability: OpenStep
Description forthcoming.
Instance Variables for NSCell Class
@protected NSUInteger _action_mask;
Availability: OpenStep
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.
@protected NSImage* _cell_image;
Availability: OpenStep
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.
@protected id _contents;
Availability: OpenStep
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.
@protected NSFont* _font;
Availability: OpenStep
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.
@protected NSFormatter* _formatter;
Availability: OpenStep
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.
@protected NSMenu* _menu;
Availability: OpenStep
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.
@protected NSUInteger _mouse_down_flags;
Availability: OpenStep
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.
@protected id _object_value;
Availability: OpenStep
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.
@protected id _represented_object;
Availability: OpenStep
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.
@protected void* _reserved1;
Availability: OpenStep
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.
@protected struct GSCellFlagsType struct GSCellFlagsType;
Availability: OpenStep
Description forthcoming.
- Declared in:
- AppKit/NSCell.h
Availability: OpenStep
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.
Method summary
- (
NSAttributedString*)
_drawAttributedString;
Availability: OpenStep
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.
- (void)
_drawAttributedText: (
NSAttributedString*)aString
inFrame: (
NSRect)aRect;
Availability: OpenStep
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.
- (void)
_drawBorderAndBackgroundWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
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.
- (void)
_drawEditorWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
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.
- (void)
_drawFocusRingWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
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.
- (void)
_drawText: (
NSString*)aString
inFrame: (
NSRect)cellFrame;
Availability: OpenStep
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.
- (
NSDictionary*)
_nonAutoreleasedTypingAttributes;
Availability: OpenStep
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.
- (BOOL)
_sendsActionOn: (
NSUInteger)eventTypeMask;
Availability: OpenStep
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.
- (void)
_setInEditing: (BOOL)flag;
Availability: OpenStep
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.
- (
NSSize)
_sizeText: (
NSString*)title;
Availability: OpenStep
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.
- (void)
_updateFieldEditor: (NSText*)textObject;
Availability: OpenStep
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.
- (
NSColor*)
textColor;
Availability: OpenStep
Description forthcoming.
Up