NSTextTable Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.4 and later. |
| Declared in | NSTextTable.h |
| Companion guides | |
Overview
An NSTextTable object represents a text table as a whole. It is responsible for laying out and drawing the text table blocks it contains, and it maintains the basic parameters of the table.
Tasks
Getting and Setting Number of Columns
Getting and Setting Layout Algorithm
Collapsing Borders
Hiding Empty Cells
Determining Layout Rectangles
-
– rectForBlock:layoutAtPoint:inRect:textContainer:characterRange: -
– boundsRectForBlock:contentRect:inRect:textContainer:characterRange:
Drawing the Table
Instance Methods
boundsRectForBlock:contentRect:inRect:textContainer:characterRange:
Returns the rectangle the text table block actually occupies, including padding, borders, and margins.
Parameters
- block
The text table block that wants to determine where to layout its glyphs.
- contentRect
The actual rectangle in which the text was laid out, as determined by
rectForLayoutAtPoint:inRect:textContainer:characterRange:.- rect
The initial rectangle in textContainer proposed by the typesetter.
- textContainer
The text container being used for the layout.
- charRange
The range of the characters whose glyphs are to be drawn.
Return Value
The rectangle the text table block actually occupies, including padding, borders, and margins.
Discussion
This method is called by the text table block block after it is laid out to determine the rectangle the text table block actually occupies, including padding, borders, and margins.
Availability
- Available in OS X v10.4 and later.
Declared In
NSTextTable.hcollapsesBorders
Returns whether the text table borders are collapsible.
Return Value
YES if the text table borders are collapsible, NO otherwise.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSTextTable.hdrawBackgroundForBlock:withFrame:inView:characterRange:layoutManager:
Draws any colors and other decorations for a text table block.
Parameters
- block
The text table block that wants to draw its background.
- frameRect
The area in which drawing occurs.
- controlView
The view controlling the drawing.
- charRange
The range of the characters whose glyphs are to be drawn.
- layoutManager
The layout manager controlling the typesetting.
Discussion
This methods is called by the text table block block to draw any colors and other decorations before the text is drawn.
Availability
- Available in OS X v10.4 and later.
Declared In
NSTextTable.hhidesEmptyCells
Returns whether the text table hides empty cells.
Return Value
YES if the text table hides empty cells, NO otherwise.
Discussion
If empty cells are hidden, locations with empty cells allow the background of the enclosing block or text container to show through.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSTextTable.hlayoutAlgorithm
Returns the text table layout algorithm.
Return Value
The text table layout algorithm.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSTextTable.hnumberOfColumns
Returns the number of columns in the text table.
Return Value
The number of columns in the text table.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSTextTable.hrectForBlock:layoutAtPoint:inRect:textContainer:characterRange:
Returns the rectangle within which glyphs should be laid out for a text table block.
Parameters
- block
The text table block that wants to determine where to layout its glyphs.
- startingPoint
The location, in container coordinates, where layout begins.
- rect
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.
- textContainer
The text container being used for the layout.
- charRange
The range of the characters whose glyphs are to be drawn.
Return Value
The rectangle within which glyphs should be laid out.
Discussion
This method is called by the text table block block to determine the rectangle within which glyphs should be laid out for the text table block.
Availability
- Available in OS X v10.4 and later.
Declared In
NSTextTable.hsetCollapsesBorders:
Sets whether the text table borders are collapsible.
Parameters
- flag
YESif the text table borders should be collapsible,NOotherwise.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSTextTable.hsetHidesEmptyCells:
Sets whether the text table hides empty cells.
Parameters
- flag
YESif the text table should hide empty cells,NOotherwise.
Discussion
If empty cells are hidden, locations with empty cells allow the background of the enclosing block or text container to show through.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSTextTable.hsetLayoutAlgorithm:
Sets the text table layout algorithm.
Parameters
- algorithm
The new layout algorithm.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSTextTable.hsetNumberOfColumns:
Sets the number of columns in the text table.
Parameters
- numCols
The new number of columns.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSTextTable.hConstants
NSTextTableLayoutAlgorithm
These constants, specifying the type of text table layout algorithm, are used with setLayoutAlgorithm:.
enum {
NSTextTableAutomaticLayoutAlgorithm = 0,
NSTextTableFixedLayoutAlgorithm = 1
};
typedef NSUInteger NSTextTableLayoutAlgorithm;
Constants
NSTextTableAutomaticLayoutAlgorithmSpecifies automatic layout algorithm
Available in OS X v10.4 and later.
Declared in
NSTextTable.h.NSTextTableFixedLayoutAlgorithmSpecifies fixed layout algorithm
Available in OS X v10.4 and later.
Declared in
NSTextTable.h.
Declared In
NSTextTable.h© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-04-11)