Up

# NSMatrix

### Authors

Ovidiu Predescu (`ovidiu@net-community.com`)

> Matrix class for grouping controls

Copyright: (C) 1996, 1997, 1999 Free Software Foundation, Inc.

# Software documentation for the NSMatrix class

## NSMatrix : NSControl

> Declared in:
>   AppKit/NSMatrix.h

> Conforms to:
>   NSCoding

> Standards:
> - MacOS-X
> - OpenStep
> - GNUstep

Description forthcoming.

Method summary

- +cellClass
- +setCellClass:
- -acceptsFirstMouse:
- -action
- -addColumn
- -addColumnWithCells:
- -addRow
- -addRowWithCells:
- -allowsEmptySelection
- -autosizesCells
- -backgroundColor
- -cellAtRow:column:
- -cellBackgroundColor
- -cellClass
- -cellFrameAtRow:column:
- -cellSize
- -cellWithTag:
- -cells
- -delegate
- -deselectAllCells
- -deselectSelectedCell
- -doubleAction
- -drawCellAtRow:column:
- -drawsBackground
- -drawsCellBackground
- -errorAction
- -getNumberOfRows:columns:
- -getRow:column:forPoint:
- -getRow:column:ofCell:
- -highlightCell:atRow:column:
- -initWithFrame:
- -initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:
- -initWithFrame:mode:prototype:numberOfRows:numberOfColumns:
- -insertColumn:
- -insertColumn:withCells:
- -insertRow:
- -insertRow:withCells:
- -intercellSpacing
- -isAutoscroll
- -isSelectionByRect
- -keyCell
- -makeCellAtRow:column:
- -mode
- -mouseDown:
- -mouseDownFlags
- -nextText
- -numberOfColumns
- -numberOfRows
- -performKeyEquivalent:
- -previousText
- -prototype
- -putCell:atRow:column:
- -removeColumn:
- -removeRow:
- -renewRows:columns:
- -resetCursorRects
- -scrollCellToVisibleAtRow:column:
- -selectAll:
- -selectCellAtRow:column:
- -selectCellWithTag:
- -selectText:
- -selectTextAtRow:column:
- -selectedCell
- -selectedCells
- -selectedColumn
- -selectedRow
- -sendAction
- -sendAction:to:forAllCells:
- -sendDoubleAction
- -setAction:
- -setAllowsEmptySelection:
- -setAutoscroll:
- -setAutosizesCells:
- -setBackgroundColor:
- -setCellBackgroundColor:
- -setCellClass:
- -setCellSize:
- -setDelegate:
- -setDoubleAction:
- -setDrawsBackground:
- -setDrawsCellBackground:
- -setErrorAction:
- -setIntercellSpacing:
- -setKeyCell:
- -setMode:
- -setNextText:
- -setPreviousText:
- -setPrototype:
- -setScrollable:
- -setSelectionByRect:
- -setSelectionFrom:to:anchor:highlight:
- -setState:atRow:column:
- -setTabKeyTraversesCells:
- -setValidateSize:
- -sizeToCells
- -sortUsingFunction:context:
- -sortUsingSelector:
- -tabKeyTraversesCells
- -textDidBeginEditing:
- -textDidChange:
- -textDidEndEditing:
- -textShouldBeginEditing:
- -textShouldEndEditing:

### cellClass

+ (Class) cellClass;

Description forthcoming.

### setCellClass:

+ (void) setCellClass: (Class)classId;

Description forthcoming.

### acceptsFirstMouse:

- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent;

Description forthcoming.

### action

- (SEL) action;

Description forthcoming.

### addColumn

- (void) addColumn;

Description forthcoming.

### addColumnWithCells:

- (void) addColumnWithCells: (NSArray*)cellArray;

Description forthcoming.

### addRow

- (void) addRow;

Description forthcoming.

### addRowWithCells:

- (void) addRowWithCells: (NSArray*)cellArray;

Description forthcoming.

### allowsEmptySelection

- (BOOL) allowsEmptySelection;

Description forthcoming.

### autosizesCells

- (BOOL) autosizesCells;

Description forthcoming.

### backgroundColor

- (NSColor*) backgroundColor;

Description forthcoming.

### cellAtRow:column:

- (id) cellAtRow: (int)row column: (int)column;

Description forthcoming.

### cellBackgroundColor

- (NSColor*) cellBackgroundColor;

Description forthcoming.

### cellClass

- (Class) cellClass;

Description forthcoming.

### cellFrameAtRow:column:

- (NSRect) cellFrameAtRow: (int)row column: (int)column;

Description forthcoming.

### cellSize

- (NSSize) cellSize;

Description forthcoming.

### cellWithTag:

- (id) cellWithTag: (int)anInt;

Description forthcoming.

### cells

- (NSArray*) cells;

Description forthcoming.

### delegate

- (id) delegate;

Description forthcoming.

### deselectAllCells

- (void) deselectAllCells;

Description forthcoming.

### deselectSelectedCell

- (void) deselectSelectedCell;

Description forthcoming.

### doubleAction

- (SEL) doubleAction;

Description forthcoming.

### drawCellAtRow:column:

- (void) drawCellAtRow: (int)row column: (int)column;

Description forthcoming.

### drawsBackground

- (BOOL) drawsBackground;

Description forthcoming.

### drawsCellBackground

- (BOOL) drawsCellBackground;

Description forthcoming.

### errorAction

- (SEL) errorAction;

Description forthcoming.

### getNumberOfRows:columns:

- (void) getNumberOfRows: (int*)rowCount columns: (int*)columnCount;

Description forthcoming.

### getRow:column:forPoint:

- (BOOL) getRow: (int*)row column: (int*)column forPoint: (NSPoint)aPoint;

Description forthcoming.

### getRow:column:ofCell:

- (BOOL) getRow: (int*)row column: (int*)column ofCell: (NSCell*)aCell;

Description forthcoming.

### highlightCell:atRow:column:

- (void) highlightCell: (BOOL)flag atRow: (int)row column: (int)column;

Description forthcoming.

### initWithFrame:

- (id) initWithFrame: (NSRect)frameRect;

Description forthcoming.

### initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:

- (id) initWithFrame: (NSRect)frameRect mode: (int)aMode cellClass: (Class)classId numberOfRows: (int)rowsHigh numberOfColumns: (int)colsWide;

Description forthcoming.

### initWithFrame:mode:prototype:numberOfRows:numberOfColumns:

- (id) initWithFrame: (NSRect)frameRect mode: (int)aMode prototype: (NSCell*)aCell numberOfRows: (int)rowsHigh numberOfColumns: (int)colsWide;

Description forthcoming.

### insertColumn:

- (void) insertColumn: (int)column;

Description forthcoming.

### insertColumn:withCells:

- (void) insertColumn: (int)column withCells: (NSArray*)cellArray;

Description forthcoming.

### insertRow:

- (void) insertRow: (int)row;

Description forthcoming.

### insertRow:withCells:

- (void) insertRow: (int)row withCells: (NSArray*)cellArray;

Description forthcoming.

### intercellSpacing

- (NSSize) intercellSpacing;

Description forthcoming.

### isAutoscroll

- (BOOL) isAutoscroll;

Description forthcoming.

### isSelectionByRect

- (BOOL) isSelectionByRect;

Description forthcoming.

### keyCell

- (id) keyCell;

Description forthcoming.

### makeCellAtRow:column:

- (NSCell*) makeCellAtRow: (int)row column: (int)column;

Description forthcoming.

### mode

- (NSMatrixMode) mode;

Description forthcoming.

### mouseDown:

- (void) mouseDown: (NSEvent*)theEvent;

Description forthcoming.

### mouseDownFlags

- (int) mouseDownFlags;

Description forthcoming.

### nextText

- (id) nextText;

Description forthcoming.

### numberOfColumns

- (int) numberOfColumns;

Description forthcoming.

### numberOfRows

- (int) numberOfRows;

Description forthcoming.

### performKeyEquivalent:

- (BOOL) performKeyEquivalent: (NSEvent*)theEvent;

Description forthcoming.

### previousText

- (id) previousText;

Description forthcoming.

### prototype

- (id) prototype;

Description forthcoming.

### putCell:atRow:column:

- (void) putCell: (NSCell*)newCell atRow: (int)row column: (int)column;

Description forthcoming.

### removeColumn:

- (void) removeColumn: (int)column;

Description forthcoming.

### removeRow:

- (void) removeRow: (int)row;

Description forthcoming.

### renewRows:columns:

- (void) renewRows: (int)newRows columns: (int)newColumns;

Description forthcoming.

### resetCursorRects

- (void) resetCursorRects;

Description forthcoming.

### scrollCellToVisibleAtRow:column:

- (void) scrollCellToVisibleAtRow: (int)row column: (int)column;

Description forthcoming.

### selectAll:

- (void) selectAll: (id)sender;

Description forthcoming.

### selectCellAtRow:column:

- (void) selectCellAtRow: (int)row column: (int)column;

Description forthcoming.

### selectCellWithTag:

- (BOOL) selectCellWithTag: (int)anInt;

Description forthcoming.

### selectText:

- (void) selectText: (id)sender;

Description forthcoming.

### selectTextAtRow:column:

- (id) selectTextAtRow: (int)row column: (int)column;

Description forthcoming.

### selectedCell

- (id) selectedCell;

Description forthcoming.

### selectedCells

- (NSArray*) selectedCells;

Description forthcoming.

### selectedColumn

- (int) selectedColumn;

Description forthcoming.

### selectedRow

- (int) selectedRow;

Description forthcoming.

### sendAction

- (BOOL) sendAction;

Description forthcoming.

### sendAction:to:forAllCells:

- (void) sendAction: (SEL)aSelector to: (id)anObject forAllCells: (BOOL)flag;

Description forthcoming.

### sendDoubleAction

- (void) sendDoubleAction;

Description forthcoming.

### setAction:

- (void) setAction: (SEL)aSelector;

Sets the message to send when a single click occurs.

### setAllowsEmptySelection:

- (void) setAllowsEmptySelection: (BOOL)flag;

Sets a flag to indicate whether the matrix should permit empty selections or should force one or mor cells to be selected at all times.

### setAutoscroll:

- (void) setAutoscroll: (BOOL)flag;

Description forthcoming.

### setAutosizesCells:

- (void) setAutosizesCells: (BOOL)flag;

Description forthcoming.

### setBackgroundColor:

- (void) setBackgroundColor: (NSColor*)aColor;

Description forthcoming.

### setCellBackgroundColor:

- (void) setCellBackgroundColor: (NSColor*)aColor;

Description forthcoming.

### setCellClass:

- (void) setCellClass: (Class)classId;

Description forthcoming.

### setCellSize:

- (void) setCellSize: (NSSize)aSize;

Description forthcoming.

### setDelegate:

- (void) setDelegate: (id)anObject;

Description forthcoming.

### setDoubleAction:

- (void) setDoubleAction: (SEL)aSelector;

Sets the message to send when a double click occurs.
NB: In GNUstep the following method does *not* set ignoresMultiClick to `NO` as in the MacOS-X spec.
It simply sets the doubleAction, as in OpenStep spec.

### setDrawsBackground:

- (void) setDrawsBackground: (BOOL)flag;

Description forthcoming.

### setDrawsCellBackground:

- (void) setDrawsCellBackground: (BOOL)flag;

Set a flag to say whether the matrix will draw call backgrounds (`YES`) or expect the cell to do it itsself (`NO`).

### setErrorAction:

- (void) setErrorAction: (SEL)aSelector;

Description forthcoming.

### setIntercellSpacing:

- (void) setIntercellSpacing: (NSSize)aSize;

Description forthcoming.

### setKeyCell:

- (void) setKeyCell: (NSCell*)aCell;

Description forthcoming.

### setMode:

- (void) setMode: (NSMatrixMode)aMode;

Description forthcoming.

### setNextText:

- (void) setNextText: (id)anObject;

Description forthcoming.

### setPreviousText:

- (void) setPreviousText: (id)anObject;

Description forthcoming.

### setPrototype:

- (void) setPrototype: (NSCell*)aCell;

Description forthcoming.

### setScrollable:

- (void) setScrollable: (BOOL)flag;

Description forthcoming.

### setSelectionByRect:

- (void) setSelectionByRect: (BOOL)flag;

Description forthcoming.

### setSelectionFrom:to:anchor:highlight:

- (void) setSelectionFrom: (int)startPos to: (int)endPos anchor: (int)anchorPos highlight: (BOOL)flag;

Description forthcoming.

### setState:atRow:column:

- (void) setState: (int)value atRow: (int)row column: (int)column;

Description forthcoming.

### setTabKeyTraversesCells:

- (void) setTabKeyTraversesCells: (BOOL)flag;

Description forthcoming.

### setValidateSize:

- (void) setValidateSize: (BOOL)flag;

Description forthcoming.

### sizeToCells

- (void) sizeToCells;

Description forthcoming.

### sortUsingFunction:context:

- (void) sortUsingFunction: (int(*)(id element1,id element2,void*userData))comparator context: (void*)context;

Description forthcoming.

### sortUsingSelector:

- (void) sortUsingSelector: (SEL)comparator;

Description forthcoming.

### tabKeyTraversesCells

- (BOOL) tabKeyTraversesCells;

Description forthcoming.

### textDidBeginEditing:

- (void) textDidBeginEditing: (NSNotification*)aNotification;

Description forthcoming.

### textDidChange:

- (void) textDidChange: (NSNotification*)aNotification;

Description forthcoming.

### textDidEndEditing:

- (void) textDidEndEditing: (NSNotification*)aNotification;

Description forthcoming.

### textShouldBeginEditing:

- (BOOL) textShouldBeginEditing: (NSText*)aTextObject;

Description forthcoming.

### textShouldEndEditing:

- (BOOL) textShouldEndEditing: (NSText*)aTextObject;

Description forthcoming.

Up