From: Scott H. <sco...@us...> - 2005-05-27 06:03:23
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25794/src/org/actionstep/test Modified Files: ASTestMatrix.as Log Message: column and row adding buttons Index: ASTestMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestMatrix.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASTestMatrix.as 27 May 2005 01:48:11 -0000 1.2 --- ASTestMatrix.as 27 May 2005 06:03:15 -0000 1.3 *************** *** 49,60 **** var cell:NSButtonCell = (new NSButtonCell()).initTextCell("test"); var matrix:NSMatrix = (new NSMatrix()).initWithFrameModePrototypeNumberOfRowsNumberOfColumns ! (new NSRect(10,10,270,200), org.actionstep.constants.NSMatrixMode.NSRadioModeMatrix, ! cell, 8, 4); ! view.addSubview(matrix); ! matrix.setBackgroundColor(new NSColor(0xFF0000)); matrix.setCellBackgroundColor(new NSColor(0x00FF00)); matrix.setIntercellSpacing(new NSSize(3, 3)); window.setContentView(view); app.run(); --- 49,82 ---- var cell:NSButtonCell = (new NSButtonCell()).initTextCell("test"); var matrix:NSMatrix = (new NSMatrix()).initWithFrameModePrototypeNumberOfRowsNumberOfColumns ! (new NSRect(10,50,270,200), org.actionstep.constants.NSMatrixMode.NSRadioModeMatrix, ! cell, 2, 2); ! matrix.setBackgroundColor(new NSColor(0xFF0000)); matrix.setCellBackgroundColor(new NSColor(0x00FF00)); matrix.setIntercellSpacing(new NSSize(3, 3)); + view.addSubview(matrix); + var target:Object = {}; + target.addColumn = function() + { + matrix.addColumn(); + } + target.addRow = function() + { + matrix.addRow(); + } + + var addColumnButton:NSButton = (new NSButton()).initWithFrame(new NSRect(10,10,100,30)); + addColumnButton.setTitle("Add Column"); + addColumnButton.setTarget(target); + addColumnButton.setAction("addColumn"); + view.addSubview(addColumnButton); + + var addRowButton:NSButton = (new NSButton()).initWithFrame(new NSRect(120,10,100,30)); + addRowButton.setTitle("Add Row"); + addRowButton.setTarget(target); + addRowButton.setAction("addRow"); + view.addSubview(addRowButton); + window.setContentView(view); app.run(); |