home *** CD-ROM | disk | FTP | other *** search
-
- /* A subclass of Matrix that allows variable size columns and rows */
- /* Creator : Imran Qureshi */
- /* August 3, 1992 */
- /* e-mail : cooldude@leland.stanford.edu */
- /* Provided as FREEWARE */
-
-
- #import <appkit/Matrix.h>
-
- typedef struct {
- float x;
- float width;
- } column, *columnPtr;
-
- typedef struct {
- float y;
- float height;
- } row, *rowPtr;
-
- @interface VarMatrix:Matrix
- {
- id columnList,rowList;
- NXRect oldRect;
- }
-
- -initFrame:(NXRect *)frameRect mode:(int)aMode prototype:aCell numRows:(int)rowsHigh numCols:(int)colsWide;
- -erase;
-
- /** methods for changing sizes of fields **/
- -setWidth:(float)width forCol:(int)col;
- -setHeight:(float)height forRow:(int)theRow;
-
- /* override these methods to update our structure */
- -renewRows:(int)newRows cols:(int)newCols;
- -sizeToCells;
- -addCol;
- -insertColAt:(int)col;
- -removeColAt:(int)col andFree:(BOOL)flag;
- -addRow;
- -insertRowAt:(int)theRow;
- -removeRowAt:(int)theRow andFree:(BOOL)flag;
-
- /* drawing */
- -drawCellAt:(int)theRow :(int)col;
- -drawSelf:(const NXRect *)rects :(int)rectCount;
- -getCellFrame:(NXRect *)theRect at:(int)theRow :(int)col;
- -getRow:(int *)row andCol:(int*)col forPoint:(const NXPoint *)point;
- -getRow:(int *)row andCol:(int *)col ofCell:aCell;
-
- /* events */
- - mouseDown:(NXEvent *)theEvent;
-
- /* archiving */
- -write:(NXTypedStream*)typedStream;
- -read:(NXTypedStream*)typedStream;
-
- /*** PRIVATE **/
- -updateRowsFrom:(int)rowNum with:(float)diff;
- -updateColsFrom:(int)colNum with:(float)diff;
- @end
-