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 | |
Related sample code |
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.
– rectForBlock:layoutAtPoint:inRect:textContainer:characterRange:
– boundsRectForBlock:contentRect:inRect:textContainer:characterRange:
Returns the rectangle the text table block actually occupies, including padding, borders, and margins.
- (NSRect)boundsRectForBlock:(NSTextTableBlock *)block contentRect:(NSRect)contentRect inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange
The text table block that wants to determine where to layout its glyphs.
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 whose glyphs are to be drawn.
The rectangle the text table block actually occupies, including padding, borders, and margins.
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.
NSTextTable.h
Returns whether the text table borders are collapsible.
- (BOOL)collapsesBorders
YES
if the text table borders are collapsible, NO
otherwise.
NSTextTable.h
Draws any colors and other decorations for a text table block.
- (void)drawBackgroundForBlock:(NSTextTableBlock *)block withFrame:(NSRect)frameRect inView:(NSView *)controlView characterRange:(NSRange)charRange layoutManager:(NSLayoutManager *)layoutManager
The text table block that wants to draw its background.
The area in which drawing occurs.
The view controlling the drawing.
The range of the characters whose glyphs are to be drawn.
The layout manager controlling the typesetting.
This methods is called by the text table block block to draw any colors and other decorations before the text is drawn.
NSTextTable.h
Returns whether the text table hides empty cells.
- (BOOL)hidesEmptyCells
YES
if the text table hides empty cells, NO
otherwise.
If empty cells are hidden, locations with empty cells allow the background of the enclosing block or text container to show through.
NSTextTable.h
Returns the text table layout algorithm.
- (NSTextTableLayoutAlgorithm)layoutAlgorithm
The text table layout algorithm.
NSTextTable.h
Returns the number of columns in the text table.
- (NSUInteger)numberOfColumns
The number of columns in the text table.
NSTextTable.h
Returns the rectangle within which glyphs should be laid out for a text table block.
- (NSRect)rectForBlock:(NSTextTableBlock *)block layoutAtPoint:(NSPoint)startingPoint inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange
The text table block that wants to determine where to layout its glyphs.
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 whose glyphs are to be drawn.
The rectangle within which glyphs should be laid out.
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.
NSTextTable.h
Sets whether the text table borders are collapsible.
- (void)setCollapsesBorders:(BOOL)flag
YES
if the text table borders should be collapsible, NO
otherwise.
NSTextTable.h
Sets whether the text table hides empty cells.
- (void)setHidesEmptyCells:(BOOL)flag
YES
if the text table should hide empty cells, NO
otherwise.
If empty cells are hidden, locations with empty cells allow the background of the enclosing block or text container to show through.
NSTextTable.h
Sets the text table layout algorithm.
- (void)setLayoutAlgorithm:(NSTextTableLayoutAlgorithm)algorithm
The new layout algorithm.
NSTextTable.h
Sets the number of columns in the text table.
- (void)setNumberOfColumns:(NSUInteger)numCols
The new number of columns.
NSTextTable.h
These constants, specifying the type of text table layout algorithm, are used with setLayoutAlgorithm:
.
enum { NSTextTableAutomaticLayoutAlgorithm = 0, NSTextTableFixedLayoutAlgorithm = 1 }; typedef NSUInteger NSTextTableLayoutAlgorithm;
NSTextTableAutomaticLayoutAlgorithm
Specifies automatic layout algorithm
Available in Mac OS X v10.4 and later.
Declared in NSTextTable.h
.
NSTextTableFixedLayoutAlgorithm
Specifies fixed layout algorithm
Available in Mac OS X v10.4 and later.
Declared in NSTextTable.h
.
NSTextTable.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-04-11)