Up
Authors
- Scott Christley (
scottc@net-community.com
)
-
The abstract cell class
Copyright: (C) 1996 Free Software Foundation, Inc.
- Declared in:
- AppKit/NSCell.h
- Conforms to:
- NSCopying
- NSCoding
Availability: OpenStep
Instance Variables
Method summary
+ (
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
- (BOOL)
allowsEditingTextAttributes;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (BOOL)
allowsMixedState;
Availability: OpenStep
Description forthcoming.
- (NSAttributedString*)
attributedStringValue;
Availability: MacOS-X 10.0.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 specified 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
- (int)
entryType;
Availability: OpenStep
- (float)
floatValue;
Availability: OpenStep
- (
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.
- (
NSImage*)
image;
Availability: OpenStep
- (NSRect)
imageRectForBounds: (NSRect)theRect;
Availability: OpenStep
- (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
- (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.
- (
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.
- (unsigned int)
mnemonicLocation;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (int)
mouseDownFlags;
Availability: OpenStep
- (int)
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: (int)selStart
length: (int)selLength;
Availability: OpenStep
TODO.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
- (int)
sendActionOn: (int)mask;
Availability: OpenStep
- (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)
setAllowsEditingTextAttributes: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setAllowsMixedState: (BOOL)flag;
Availability: OpenStep
Description forthcoming.
- (void)
setAttributedStringValue: (NSAttributedString*)attribStr;
Availability: MacOS-X 10.0.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)
setCellAttribute: (
NSCellAttribute)aParameter
to: (int)value;
Availability: OpenStep
- (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)
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: (int)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: (unsigned int)leftDigits
right: (unsigned int)rightDigits;
Availability: OpenStep
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)
setMenu: (
NSMenu*)aMenu;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setMnemonicLocation: (unsigned int)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: (int)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: (int)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
- (int)
state;
Availability: OpenStep
- (void)
stopTracking: (NSPoint)lastPoint
at: (NSPoint)stopPoint
inView: (
NSView*)controlView
mouseIsUp: (BOOL)flag;
Availability: OpenStep
- (NSString*)
stringValue;
Availability: OpenStep
- (int)
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)
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
- (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 unsigned int _action_mask;
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 _cell;
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;
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 NSString* _contents;
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;
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;
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;
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 unsigned char _mnemonic_location;
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 unsigned int _mouse_down_flags;
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 _objectValue;
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;
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.
- 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
- (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)
_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: (int)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.
- (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.
- (
NSColor*)
textColor;
Availability: OpenStep
Description forthcoming.
Up