
/* Generated by Interface Builder */

#import "MyObject.h"
#import "VarMatrix.h"
#import <appkit/Form.h>
#import <appkit/TextFieldCell.h>

@implementation MyObject

-init
{
	
	NXRect              frameRect = {0.0, 0.0, 0.0, 0.0};
	id                  cellPrototype;
	NXSize              size;

	cellPrototype = [[TextFieldCell alloc] initTextCell:"kkkkkk"];
	[cellPrototype setTextGray:NX_BLACK];
	[cellPrototype setBordered:YES];
	[cellPrototype setEditable:YES];
	matrix = [[VarMatrix alloc] initFrame:&frameRect mode:NX_TRACKMODE
		      prototype:cellPrototype numRows:0 numCols:0];
	size.width = 0.0;
	size.height = 0.0;
	[matrix setIntercell:&size];
	
	[matrix renewRows:10 cols:4];
	[matrix sizeToCells];
	[matrix update];
	return self;

}
-appDidInit:sender
{
	[[window contentView] addSubview:matrix];
	[matrix display];
	[matrix setTextDelegate:self];
	[window flushWindow];
	[window orderFront:self];
	return self;
}
-zz:sender
{
	[matrix erase];
	[matrix setWidth:[sender floatValue] forCol:1];
	return self;
}
-ww:sender
{
	[matrix setHeight:[sender floatValue] forRow:6];
	return self;
}
-do:sender
{
	[matrix erase];
	[matrix setWidth:[form floatValueAt:1] forCol:[form intValueAt:0]];
	[matrix setHeight:[form floatValueAt:3] forRow:[form intValueAt:2]];
	
	[matrix sizeToCells];
	[matrix update];
	return self;
	
}
/**** DELEGATE METHOD FOR TEXT OBJECT ******/
-textDidEnd:textObject endChar:(unsigned short)whyEnd
{
	int		row,col;
					
	row = [matrix selectedRow];
	col = [matrix selectedCol];
		
	printf("value = %f\n",[[matrix selectedCell] floatValue]);
	return self;
}

@end
