home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / NSMatrix.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-09  |  6.5 KB  |  199 lines

  1. /*
  2.     NSMatrix.h
  3.     Application Kit
  4.     Copyright (c) 1994-1996, NeXT Software, Inc.
  5.     All rights reserved.
  6. */
  7.  
  8. #import <AppKit/NSControl.h>
  9. @class NSColor;
  10.  
  11. /* Matrix Constants */
  12.  
  13. typedef enum _NSMatrixMode {
  14.     NSRadioModeMatrix            = 0,
  15.     NSHighlightModeMatrix        = 1,
  16.     NSListModeMatrix            = 2,
  17.     NSTrackModeMatrix            = 3
  18. } NSMatrixMode;
  19.  
  20. typedef struct __MFlags {
  21. #ifdef __BIG_ENDIAN__
  22.     unsigned int    highlightMode:1;
  23.     unsigned int    radioMode:1;
  24.     unsigned int    listMode:1;
  25.     unsigned int    allowEmptySel:1;
  26.     unsigned int    autoscroll:1;
  27.     unsigned int    selectionByRect:1;
  28.     unsigned int    drawsCellBackground:1;
  29.     unsigned int    drawsBackground:1;
  30.     unsigned int    autosizeCells:1;
  31.     unsigned int    drawingAncestor:1;
  32.     unsigned int    tabKeyTraversesCells:1;
  33.     unsigned int    tabKeyTraversesCellsExplicitlySet:1;
  34.     unsigned int    allowsIncrementalSearching:1;
  35.     unsigned int    currentlySelectingCell:1;
  36.     unsigned int    onlySetKeyCell:1;
  37.     unsigned int    changingSelectionWithKeyboard:1;
  38.     unsigned int    dontScroll:1;
  39.     unsigned int    refusesFirstResponder:1;
  40.     unsigned int    reservedMatrix:14;
  41. #else
  42.     unsigned int    reservedMatrix:14;
  43.     unsigned int    refusesFirstResponder:1;
  44.     unsigned int    dontScroll:1;
  45.     unsigned int    changingSelectionWithKeyboard:1;
  46.     unsigned int    onlySetKeyCell:1;
  47.     unsigned int    currentlySelectingCell:1;
  48.     unsigned int    allowsIncrementalSearching:1;
  49.     unsigned int    tabKeyTraversesCellsExplicitlySet:1;
  50.     unsigned int    tabKeyTraversesCells:1;
  51.     unsigned int    drawingAncestor:1;
  52.     unsigned int    autosizeCells:1;
  53.     unsigned int    drawsBackground:1;
  54.     unsigned int    drawsCellBackground:1;
  55.     unsigned int    selectionByRect:1;
  56.     unsigned int    autoscroll:1;
  57.     unsigned int    allowEmptySel:1;
  58.     unsigned int    listMode:1;
  59.     unsigned int    radioMode:1;
  60.     unsigned int    highlightMode:1;
  61. #endif
  62. } _MFlags;
  63.  
  64. @interface NSMatrix : NSControl
  65. {
  66.     id                  _target;
  67.     SEL                 _action;
  68.     SEL                 _doubleAction;
  69.     SEL                 _errorAction;
  70.     id                  _delegate;
  71.     id                  _selectedCell;
  72.     int                 _selectedRow;
  73.     int                 _selectedCol;
  74.     int                 _numRows;
  75.     int                 _numCols;
  76.     NSSize              _cellSize;
  77.     NSSize              _intercell;
  78.     id                  _font;
  79.     id                  _protoCell;
  80.     id                  _cellClass;
  81.     NSColor             *_backgroundColor;
  82.     void            *_private;
  83.     NSMutableArray    *_cells;
  84.     _MFlags              _mFlags;
  85. }
  86.  
  87.  
  88. - (id)initWithFrame:(NSRect)frameRect;
  89. - (id)initWithFrame:(NSRect)frameRect mode:(int)aMode prototype:(NSCell *)aCell numberOfRows:(int)rowsHigh numberOfColumns:(int)colsWide;
  90. - (id)initWithFrame:(NSRect)frameRect mode:(int)aMode cellClass:(Class)factoryId numberOfRows:(int)rowsHigh numberOfColumns:(int)colsWide;
  91.  
  92.  
  93. - (void)setCellClass:(Class)factoryId;
  94. - (Class)cellClass;
  95. - (id)prototype;
  96. - (void)setPrototype:(NSCell *)aCell;
  97. - (NSCell *)makeCellAtRow:(int)row column:(int)col;
  98. - (NSMatrixMode)mode;
  99. - (void)setMode:(NSMatrixMode)aMode;
  100. - (void)setAllowsEmptySelection:(BOOL)flag;
  101. - (BOOL)allowsEmptySelection;
  102. - (void)sendAction:(SEL)aSelector to:(id)anObject forAllCells:(BOOL)flag;
  103. - (NSArray *)cells;
  104. - (void)sortUsingSelector:(SEL)comparator;
  105. - (void)sortUsingFunction:(int (*)(id, id, void *))compare context:(void *)context;
  106. - (id)selectedCell;
  107. - (NSArray *)selectedCells;
  108. - (int)selectedRow;
  109. - (int)selectedColumn;
  110. - (void)setSelectionByRect:(BOOL)flag;
  111. - (BOOL)isSelectionByRect;
  112. - (void)setSelectionFrom:(int)startPos to:(int)endPos anchor:(int)anchorPos highlight:(BOOL)lit;
  113. - (void)deselectSelectedCell;
  114. - (void)deselectAllCells;
  115. - (void)selectCellAtRow:(int)row column:(int)col;
  116. - (void)selectAll:(id)sender;
  117. - (BOOL)selectCellWithTag:(int)anInt;
  118. - (NSSize)cellSize;
  119. - (void)setCellSize:(NSSize)aSize;
  120. - (NSSize)intercellSpacing;
  121. - (void)setIntercellSpacing:(NSSize)aSize;
  122. - (void)setScrollable:(BOOL)flag;
  123. - (void)setBackgroundColor:(NSColor *)color;
  124. - (NSColor *)backgroundColor;
  125. - (void)setCellBackgroundColor:(NSColor *)color;
  126. - (NSColor *)cellBackgroundColor;
  127. - (void)setDrawsCellBackground:(BOOL)flag;
  128. - (BOOL)drawsCellBackground;
  129. - (void)setDrawsBackground:(BOOL)flag;
  130. - (BOOL)drawsBackground;
  131. - (void)setState:(int)value atRow:(int)row column:(int)col;
  132. - (void)getNumberOfRows:(int *)rowCount columns:(int *)colCount;
  133. - (int)numberOfRows;
  134. - (int)numberOfColumns;
  135. - (id)cellAtRow:(int)row column:(int)col;
  136. - (NSRect)cellFrameAtRow:(int)row column:(int)col;
  137. - (BOOL)getRow:(int *)row column:(int *)col ofCell:(NSCell *)aCell;
  138. - (BOOL)getRow:(int *)row column:(int *)col forPoint:(NSPoint)aPoint;
  139. - (void)renewRows:(int)newRows columns:(int)newCols;
  140. - (void)putCell:(NSCell *)newCell atRow:(int)row column:(int)col;
  141. - (void)addRow;
  142. - (void)addRowWithCells:(NSArray *)newCells;
  143. - (void)insertRow:(int)row;
  144. - (void)insertRow:(int)row withCells:(NSArray *)newCells;
  145. - (void)removeRow:(int)row;
  146. - (void)addColumn;
  147. - (void)addColumnWithCells:(NSArray *)newCells;
  148. - (void)insertColumn:(int)column;
  149. - (void)insertColumn:(int)column withCells:(NSArray *)newCells;
  150. - (void)removeColumn:(int)col;
  151. - (id)cellWithTag:(int)anInt;
  152. - (SEL)doubleAction;
  153. - (void)setDoubleAction:(SEL)aSelector;
  154. - (SEL)errorAction;
  155. - (void)setErrorAction:(SEL)aSelector;
  156. - (void)setAutosizesCells:(BOOL)flag;
  157. - (BOOL)autosizesCells;
  158. - (void)sizeToCells;
  159. - (void)setValidateSize:(BOOL)flag;
  160. - (void)drawCellAtRow:(int)row column:(int)col;
  161. - (void)highlightCell:(BOOL)flag atRow:(int)row column:(int)col;
  162.  
  163. - (void)setAutoscroll:(BOOL)flag;
  164. - (BOOL)isAutoscroll;
  165. - (void)scrollCellToVisibleAtRow:(int)row column:(int)col;
  166. - (int)mouseDownFlags;
  167. - (void)mouseDown:(NSEvent *)theEvent;
  168. - (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
  169. - (BOOL)sendAction;
  170. - (void)sendDoubleAction;
  171. - (id)delegate;
  172. - (void)setDelegate:(id)anObject;
  173. - (BOOL)textShouldBeginEditing:(NSText *)textObject;
  174. - (BOOL)textShouldEndEditing:(NSText *)textObject;
  175. - (void)textDidBeginEditing:(NSNotification *)notification;
  176. - (void)textDidEndEditing:(NSNotification *)notification;
  177. - (void)textDidChange:(NSNotification *)notification;
  178. - (void)selectText:(id)sender;
  179. - (id)selectTextAtRow:(int)row column:(int)col;
  180. - (void)setPreviousText:(id)anObject;
  181. - (void)setNextText:(id)anObject;
  182. - (id)nextText;
  183. - (id)previousText;
  184. - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
  185. - (void)resetCursorRects;
  186.  
  187. @end
  188.  
  189. #ifndef STRICT_OPENSTEP
  190. @interface NSMatrix(NSKeyboardUI)
  191. - (void)setTabKeyTraversesCells:(BOOL)flag;
  192. - (BOOL)tabKeyTraversesCells;
  193. - (void)setKeyCell:(NSCell *)keyCell;
  194. - (id)keyCell;
  195. @end
  196. #endif
  197.  
  198.  
  199.