Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/AppKit.framework |
Availability | Available in Mac OS X v10.4 and later. |
Declared in | NSTextTable.h |
Companion guides |
NSTextBlock
objects represent a block of text laid out in a subregion of the text container. Text blocks appear as attributes on paragraphs, as part of the paragraph style.
The most important subclass is NSTextTableBlock
, which represents a block of text that appears as a cell in a table. The table itself is represented by a separate class, NSTextTable
, which is referenced by all of its NSTextTableBlock
objects and which controls their sizing and positioning.
– setValue:type:forDimension:
– valueForDimension:
– valueTypeForDimension:
– setContentWidth:type:
– contentWidth
– contentWidthValueType
– setWidth:type:forLayer:edge:
– setWidth:type:forLayer:
– widthForLayer:edge:
– widthValueTypeForLayer:edge:
– setBackgroundColor:
– backgroundColor
– setBorderColor:forEdge:
– setBorderColor:
– borderColorForEdge:
– rectForLayoutAtPoint:inRect:textContainer:characterRange:
– boundsRectForContentRect:inRect:textContainer:characterRange:
Returns the background color of the text block.
- (NSColor *)backgroundColor
The background color of the text block.
NSTextTable.h
Returns the border color of the specified text block edge.
- (NSColor *)borderColorForEdge:(NSRectEdge)edge
The edge of the text block in question.
The border color of the text block edge edge.
NSTextTable.h
Returns the rectangle the text in the block actually occupies, including padding, borders, and margins.
- (NSRect)boundsRectForContentRect:(NSRect)contentRect inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange
The actual rectangle in which the text was laid out, as determined by rectForLayoutAtPoint:inRect:textContainer:characterRange:
.
The initial rectangle in textContainer proposed by the typesetter.
The text container being used for the layout.
The range of the characters in the NSTextStorage
object whose glyphs are to be drawn.
The rectangle the text in the block actually occupies, including padding, borders, and margins.
This methods is called by the typesetter after the text block is laid out to return the rectangle the text in the block actually occupies, including padding, borders, and margins.
NSTextTable.h
Returns the width of the text block.
- (CGFloat)contentWidth
The width of the text block. This value must be interpreted according to the value type returned by contentWidthValueType
.
This is a convenience method that invokes valueForDimension:NSTextBlockWidth
.
NSTextTable.h
Returns the type of value stored for the text block width.
- (NSTextBlockValueType)contentWidthValueType
The value type for the text block width. This determines how the width value should be interpreted.
NSTextTable.h
Called by the layout manager to draw any colors and other decorations before the text is drawn.
- (void)drawBackgroundWithFrame:(NSRect)frameRect inView:(NSView *)controlView characterRange:(NSRange)charRange layoutManager:(NSLayoutManager *)layoutManager
The bounds rectangle in view coordinates.
The view in which drawing occurs.
The range of the characters in the NSTextStorage
object whose glyphs are to be drawn.
The layout manager controlling the typesetting.
NSTextTable.h
Initializes and returns an empty text block object.
- (id)init
An initialized text block object.
This is the designated initializer for NSTextBlock
.
NSTextTable.h
Returns the rectangle within which glyphs should be laid out for the specified arguments.
- (NSRect)rectForLayoutAtPoint:(NSPoint)startingPoint inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange
The location, in container coordinates, where layout begins.
The rectangle in which the block is constrained to lie. For top-level blocks, this is the container rectangle of textContainer; for nested blocks, this is the layout rectangle of the enclosing block.
The text container being used for the layout.
The range of the characters in the NSTextStorage
object whose glyphs are to be drawn.
The rectangle within which glyphs should be laid out.
This method is called by the typesetter before the text block is laid out to return the rectangle within which glyphs should be laid out.
NSTextTable.h
Sets the background color of the text block.
- (void)setBackgroundColor:(NSColor *)color
The new background color.
NSTextTable.h
Sets the color of all borders of the text block.
- (void)setBorderColor:(NSColor *)color
The new color.
This setting has no visible effect unless the border width is larger than the default, which is 0.
NSTextTable.h
Sets the border color of the specified edge of the text block.
- (void)setBorderColor:(NSColor *)color forEdge:(NSRectEdge)edge
The new color.
The edge whose color is to be set.
This setting has no visible effect unless the border width is larger than the default, which is 0.
NSTextTable.h
Sets the width of the text block.
- (void)setContentWidth:(CGFloat)val type:(NSTextBlockValueType)type
The new value for the width.
The type of value being provided. This controls how val is interpreted.
NSTextTable.h
Sets a dimension of the text block.
- (void)setValue:(CGFloat)val type:(NSTextBlockValueType)type forDimension:(NSTextBlockDimension)dimension
The new value for the dimension.
The type of value being provided. This controls how val is interpreted.
The dimension to set.
NSTextTable.h
Sets the vertical alignment of the text block.
- (void)setVerticalAlignment:(NSTextBlockVerticalAlignment)alignment
The new vertical alignment for the text block.
NSTextTable.h
Sets the width of all edges of a specified layer of the text block.
- (void)setWidth:(CGFloat)val type:(NSTextBlockValueType)type forLayer:(NSTextBlockLayer)layer
The new value for the specified edge width.
The type of value being provided. This controls how val is interpreted.
The layer of the text block to modify.
NSTextTable.h
Sets the width of a specified edge of a specified layer of the text block.
- (void)setWidth:(CGFloat)val type:(NSTextBlockValueType)type forLayer:(NSTextBlockLayer)layer edge:(NSRectEdge)edge
The new value for the specified edge width.
The type of value being provided. This controls how val is interpreted.
The layer of the text block to modify.
The edge of the layer to modify.
NSTextTable.h
Returns the value of the specified text block dimension.
- (CGFloat)valueForDimension:(NSTextBlockDimension)dimension
The value for the specified dimension. This value should be interpreted according to the value type returned by valueTypeForDimension:
.
NSTextTable.h
Returns the value type of the specified text block dimension.
- (NSTextBlockValueType)valueTypeForDimension:(NSTextBlockDimension)dimension
The value type for the specified text block dimension. This result determines how the value for the dimension should be interpreted.
NSTextTable.h
Returns the vertical alignment of the text block.
- (NSTextBlockVerticalAlignment)verticalAlignment
The vertical alignment of the text block.
NSTextTable.h
Returns the width of an edge of a specified layer of the text block.
- (CGFloat)widthForLayer:(NSTextBlockLayer)layer edge:(NSRectEdge)edge
The layer to examine.
The edge of the layer to examine.
The width of the edge of layer. This value must be interpreted according to the value type returned by widthValueTypeForLayer:edge:
.
NSTextTable.h
Returns the value type of an edge of a specified layer of the text block.
- (NSTextBlockValueType)widthValueTypeForLayer:(NSTextBlockLayer)layer edge:(NSRectEdge)edge
The layer to examine.
The edge of the layer to examine.
The value type of the edge of layer. This determines how the value for this edge of layer should be interpreted.
NSTextTable.h
The following constants specify values used with method parameters of type NSTextBlockValueType
.
The following constants specify values used with method parameters of type NSTextBlockDimension
.
The following constants specify values used with method parameters of type NSTextBlockLayer
.
The following constants specify values used with method parameters of type NSTextBlockVerticalAlignment
.
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)