Return to the Alphabetic Index
Return to the Class Browser
Return to the Picture Browser
Copyright (c) 1994 by NeXT Computer, Inc. All Rights
Inherits From: NSMatrix : NSControl : NSView : NSResponder : NSObject
Conforms To: NSCoding (NSResponder)
Declared In: AppKit/NSForm.h
An NSForm is an NSMatrix that contains titled entries (text fields) into which
a user can type data values. Entries are indexed from the top down (starting
with zero). Each item in the NSForm, including the titles, is an NSFormCell. A
mouse click on an NSFormCell (that is, on the title or in the entry area)
starts text editing in that entry. If the user presses the Return or Enter key
while editing an entry, the action of the entry is sent to the target of the
entry, orif the entry doesn't have an actionthe NSForm sends its
action to its target. If the user presses the Tab key, the next entry in the
NSForm is selected; if the user presses Shift-Tab, the previous entry is
For more information, see the NSFormCell and NSMatrix class specifications.
Laying Out the Form
- - (NSFormCell *)addEntry:(NSString *)title Adds and returns a new
entry with title as its title at the end of the Form.
- - (NSFormCell *)insertEntry:(NSString *)title Inserts a new entry
at index with title as its title.
- - (void)removeEntryAtIndex:(int)index Removes the entry at
- - (void)setInterlineSpacing:(float)spacing Sets the spacing
between entries to spacing.
Modifying Graphic Attributes
- - (int)indexOfCellWithTag:(int)aTag Returns the index for the
entry with tag aTag.
- - (int)indexOfSelectedItem Returns the index of the currently selected
Setting the Cell Class
- - (void)setBezeled:(BOOL)flag Sets whether entries have a bezeled
- - (void)setBordered:(BOOL)flag Sets whether the entries have a
- - (void)setTextAlignment:(int)mode Sets how text is aligned
within the entries to mode.
- - (void)setTextFont:(NSFont *)fontObject Sets the font used to
draw entry text to fontObject.
- - (void)setTitleAlignment:(NSTextAlignment)mode Sets how titles
are aligned to mode.
- - (void)setTitleFont:(NSFont *)fontObject Sets the font used to
draw entry titles to fontObject.
Getting a Cell
- + (Class)cellClass Returns the class last set in a setCellClass:
message, or the NSFormCell class if setCellClass: has never been
- + (void)setCellClass:(Class)classId Sets the class of NSCell used
in the NSForm.
Displaying a Cell
- - (id)cellAtIndex:(int)index Returns the Cell at index.
- - (void)drawCellAtIndex:(int)index Displays the Cell at the
Resizing the Form
- - (void)selectTextAtIndex:(int)index Selects the text in the
entry at index.
- - (void)setEntryWidth:(float)width Sets the width of all the
entries (including the title part) to width.