You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(124) |
Jun
(201) |
Jul
(168) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|
From: Scott H. <sco...@us...> - 2005-05-30 12:23:59
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17198/src/org/actionstep Modified Files: NSMatrix.as Log Message: Removed all stopwatch code Index: NSMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSMatrix.as,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NSMatrix.as 29 May 2005 23:11:08 -0000 1.12 --- NSMatrix.as 30 May 2005 12:23:48 -0000 1.13 *************** *** 48,52 **** //! TEST CODE ! import org.as2lib.util.StopWatch; //************************************************************************** --- 48,52 ---- //! TEST CODE ! //import org.as2lib.util.StopWatch; //************************************************************************** *************** *** 102,106 **** //! TEST CODE ! private var watch:StopWatch; /** --- 102,106 ---- //! TEST CODE ! //private var watch:StopWatch; /** *************** *** 137,141 **** m_autoscroll = false; m_isselbyrect = false; ! watch = new StopWatch(); } --- 137,141 ---- m_autoscroll = false; m_isselbyrect = false; ! //watch = new StopWatch(); } *************** *** 1410,1414 **** public function getRowColumnForPoint(aPoint:NSPoint):Object { ! aPoint = convertPointFromView(theEvent.mouseLocation, null); var colWidth:Number = m_cellsize.width + m_cellspacing.width; var rowHeight:Number = m_cellsize.height + m_cellspacing.height; --- 1410,1414 ---- public function getRowColumnForPoint(aPoint:NSPoint):Object { ! aPoint = convertPointFromView(aPoint, null); var colWidth:Number = m_cellsize.width + m_cellspacing.width; var rowHeight:Number = m_cellsize.height + m_cellspacing.height; *************** *** 1452,1462 **** */ public function getRowColumnOfCell(aCell:NSCell):Object ! { ! var flat:NSArray = cells(); ! var len:Number = flat.count(); ! // // Cycle through until we make a match // for (var i:Number = 0; i < len; i++) { --- 1452,1461 ---- */ public function getRowColumnOfCell(aCell:NSCell):Object ! { // // Cycle through until we make a match // + var len:Number = m_cells.count(); + for (var i:Number = 0; i < len; i++) { *************** *** 1464,1470 **** // If match, calculate row and column from index, and return. // ! if (flat.objectAtIndex(i) == aCell) { ! return {row: Math.floor(i / m_numcols), column: i % m_numcols}; } } --- 1463,1469 ---- // If match, calculate row and column from index, and return. // ! if (m_cells.objectAtIndex(i) == aCell) { ! return rowColumnFromIndex(i); } } *************** *** 1656,1660 **** public function selectText(sender:Object):Void //! What is sender? { ! //! implement } --- 1655,1659 ---- public function selectText(sender:Object):Void //! What is sender? { ! selectTextWithCell(selectedCell()); } *************** *** 1672,1689 **** var cell:NSCell = cellAtRowColumn(row, column); ! if (cell == null) // You can only select a cell that exists ! return null; ! ! // ! // Cell must be editable and selectable. ! // ! if (!cell.isEditable() && !cell.isSelectable()) return null; - - //! select text return cell; } ! /** --- 1671,1680 ---- var cell:NSCell = cellAtRowColumn(row, column); ! if (!selectTextWithCell(cell)) return null; return cell; } ! /** *************** *** 1772,1776 **** // Get the location of the cell, then the cell itself (if available). // ! var loc:Object = getRowColumnForPoint(pt); if (loc != null) --- 1763,1767 ---- // Get the location of the cell, then the cell itself (if available). // ! var loc:Object = getRowColumnForPoint(theEvent.mouseLocation); if (loc != null) *************** *** 1950,1954 **** //! TESTING CODE ! watch.start(); // --- 1941,1945 ---- //! TESTING CODE ! //watch.start(); // *************** *** 1964,1970 **** //! TESTING CODE ! watch.stop(); TRACE("cell draw time: " + watch.getTimeInMilliSeconds()); ! watch.reset(); } --- 1955,1961 ---- //! TESTING CODE ! //watch.stop(); TRACE("cell draw time: " + watch.getTimeInMilliSeconds()); ! //watch.reset(); } *************** *** 2255,2259 **** /** ! * Makes a cell based on the prototype instance or the cell class. */ private function makeCell():NSCell --- 2246,2251 ---- /** ! * Makes a cell based on the prototype instance or the cell class, ! * depending on teh value of m_usingcellinstance. */ private function makeCell():NSCell *************** *** 2302,2305 **** --- 2294,2320 ---- } + + /** + * Selects the text in the cell aCell if the cell is editable + * and selectable. + * + * Returns true if text is successfully selected, and false otherwise. + */ + private function selectTextWithCell(aCell:NSCell):Boolean + { + if (aCell == null) // You can only select a cell that exists + return false; + + // + // Cell must be editable and selectable. + // + if (!aCell.isEditable() && !aCell.isSelectable()) + return false; + + //! select text + + return true; + } + //****************************************************** //* Public Static Properties * |
From: Scott H. <sco...@us...> - 2005-05-30 12:09:38
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11061/src/org/actionstep/test Modified Files: ASTestMatrix.as Log Message: Index: ASTestMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestMatrix.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ASTestMatrix.as 29 May 2005 18:38:02 -0000 1.6 --- ASTestMatrix.as 30 May 2005 12:09:26 -0000 1.7 *************** *** 43,46 **** --- 43,47 ---- public static function test():Void { + TRACE("application start"); var app:NSApplication = NSApplication.sharedApplication(); var window:NSWindow = (new NSWindow()).initWithContentRect(new NSRect(0,0,500,500)); |
From: Scott H. <sco...@us...> - 2005-05-29 23:11:17
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8862/src/org/actionstep Modified Files: NSMatrix.as Log Message: bug fix in getRowColumnForPoint where the aPoint argument was assumed to be local, not global. it should be global. Index: NSMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSMatrix.as,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NSMatrix.as 27 May 2005 06:24:12 -0000 1.11 --- NSMatrix.as 29 May 2005 23:11:08 -0000 1.12 *************** *** 1410,1413 **** --- 1410,1414 ---- public function getRowColumnForPoint(aPoint:NSPoint):Object { + aPoint = convertPointFromView(theEvent.mouseLocation, null); var colWidth:Number = m_cellsize.width + m_cellspacing.width; var rowHeight:Number = m_cellsize.height + m_cellspacing.height; *************** *** 1771,1775 **** // Get the location of the cell, then the cell itself (if available). // - var pt:NSPoint = convertPointFromView(theEvent.mouseLocation, null); var loc:Object = getRowColumnForPoint(pt); --- 1772,1775 ---- |
From: Scott H. <sco...@us...> - 2005-05-29 18:38:25
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24714/src/org/actionstep/test Modified Files: ASTestMatrix.as Log Message: added some buttons to add and remove columns Index: ASTestMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestMatrix.as,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ASTestMatrix.as 27 May 2005 06:41:59 -0000 1.5 --- ASTestMatrix.as 29 May 2005 18:38:02 -0000 1.6 *************** *** 28,32 **** * POSSIBILITY OF SUCH DAMAGE. */ ! import org.actionstep.NSMatrix; --- 28,32 ---- * POSSIBILITY OF SUCH DAMAGE. */ ! import org.actionstep.NSMatrix; |
From: Richard K. <ric...@us...> - 2005-05-28 04:45:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8194/test Modified Files: ASTestScrollView.as Log Message: dynamic resize of documentview Index: ASTestScrollView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestScrollView.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASTestScrollView.as 27 May 2005 20:57:42 -0000 1.3 --- ASTestScrollView.as 28 May 2005 04:45:33 -0000 1.4 *************** *** 42,51 **** view.initWithFrame(new NSRect(0, 0, 1024, 350)); view.setBorderColor(new NSColor(0xff0000)); ! var actionButton = (new NSButton()).initWithFrame(new NSRect(10,10,70,30)); ! actionButton.setTitle("Scroll 1!"); ! view.addSubview(actionButton); ! var actionButton2 = (new NSButton()).initWithFrame(new NSRect(200,200,70,30)); ! actionButton2.setTitle("Scroll 2!"); ! view.addSubview(actionButton2); var scrollView:NSScrollView = (new NSScrollView()).initWithFrame(new NSRect(0,0,250,250)); --- 42,64 ---- view.initWithFrame(new NSRect(0, 0, 1024, 350)); view.setBorderColor(new NSColor(0xff0000)); ! var grow = (new NSButton()).initWithFrame(new NSRect(10,10,70,30)); ! grow.setTitle("Grow!"); ! view.addSubview(grow); ! var shrink = (new NSButton()).initWithFrame(new NSRect(200,200,70,30)); ! shrink.setTitle("Shrink!"); ! view.addSubview(shrink); ! ! var target = new Object(); ! target.shrink = function(button) { ! view.setFrameSize(new NSSize(200, 300)); ! } ! target.grow = function(button) { ! view.setFrameSize(new NSSize(1024, 350)); ! } ! ! shrink.setTarget(target); ! shrink.setAction("shrink"); ! grow.setTarget(target); ! grow.setAction("grow"); var scrollView:NSScrollView = (new NSScrollView()).initWithFrame(new NSRect(0,0,250,250)); |
From: Richard K. <ric...@us...> - 2005-05-28 04:45:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8194 Modified Files: NSScroller.as Log Message: dynamic resize of documentview Index: NSScroller.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSScroller.as,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NSScroller.as 27 May 2005 22:16:08 -0000 1.11 --- NSScroller.as 28 May 2005 04:45:33 -0000 1.12 *************** *** 553,556 **** --- 553,562 ---- (m_horizontal ? g_rightCell : g_downCell).drawWithFrameInView(rectForPart(NSScrollerPart.NSScrollerIncrementLine), this); drawKnob(); + } else { + if (m_scrollerKnobClip != null) { + m_scrollerKnobClip.removeMovieClip(); + m_scrollerKnobClip = null; + m_scrollerKnobClipRect = new NSRect(0,0,0,0); + } } } |
From: Richard K. <ric...@us...> - 2005-05-28 04:45:01
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7869/images Modified Files: ASSwitchRep.as Log Message: minor fixes Index: ASSwitchRep.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/images/ASSwitchRep.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASSwitchRep.as 6 May 2005 21:39:15 -0000 1.3 --- ASSwitchRep.as 28 May 2005 04:44:52 -0000 1.4 *************** *** 31,35 **** import org.actionstep.NSImageRep; import org.actionstep.NSSize; - //import org.actionstep.ASDraw; class org.actionstep.images.ASSwitchRep extends NSImageRep { --- 31,34 ---- |
From: Richard K. <ric...@us...> - 2005-05-28 04:45:00
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7869 Modified Files: ASTheme.as Log Message: minor fixes Index: ASTheme.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTheme.as,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ASTheme.as 23 May 2005 21:25:49 -0000 1.10 --- ASTheme.as 28 May 2005 04:44:52 -0000 1.11 *************** *** 137,140 **** --- 137,146 ---- } + public function setImage(name:String, klass:Function) { + var image = (new NSImage()).init(); + image.setName(name); + image.addRepresentation(new klass()); + } + /** * @see org.actionstep.NSObject#description *************** *** 155,164 **** //****************************************************** - private function setImage(name:String, klass:Function) { - var image = (new NSImage()).init(); - image.setName(name); - image.addRepresentation(new klass()); - } - private function drawBorderButtonUp(mc:MovieClip, rect:NSRect) { var x = rect.origin.x; --- 161,164 ---- |
From: Richard K. <ric...@us...> - 2005-05-27 22:20:29
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3642 Modified Files: NSScrollView.as Log Message: clear before draw Index: NSScrollView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSScrollView.as,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NSScrollView.as 26 May 2005 20:35:50 -0000 1.4 --- NSScrollView.as 27 May 2005 22:20:19 -0000 1.5 *************** *** 471,474 **** --- 471,475 ---- public function drawRect(rect:NSRect) { + m_mcBounds.clear(); switch(m_borderType) { case NSBorderType.NSNoBorder: |
From: Richard K. <ric...@us...> - 2005-05-27 22:17:35
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2699 Modified Files: NSClipView.as Log Message: remove debug lines Index: NSClipView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSClipView.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NSClipView.as 27 May 2005 20:53:12 -0000 1.3 --- NSClipView.as 27 May 2005 22:17:23 -0000 1.4 *************** *** 93,99 **** public function scrollToPoint(point:NSPoint) { - TRACE("point: "+point); point = constrainScrollPoint(point); - TRACE("point constrained: "+point); setBoundsOrigin(point); } --- 93,97 ---- |
From: Richard K. <ric...@us...> - 2005-05-27 22:16:20
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2242/test Modified Files: ASTestView.as Log Message: clear before draw! Index: ASTestView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestView.as,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ASTestView.as 27 May 2005 20:52:37 -0000 1.5 --- ASTestView.as 27 May 2005 22:16:09 -0000 1.6 *************** *** 59,62 **** --- 59,63 ---- public function drawRect(rect:NSRect) { with(m_mcBounds) { + clear(); if (m_borderColor != null) { lineStyle(1, m_borderColor.value, 100); |
From: Richard K. <ric...@us...> - 2005-05-27 22:16:18
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2242 Modified Files: NSScroller.as Log Message: clear before draw! Index: NSScroller.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSScroller.as,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NSScroller.as 27 May 2005 20:52:37 -0000 1.10 --- NSScroller.as 27 May 2005 22:16:08 -0000 1.11 *************** *** 547,550 **** --- 547,551 ---- public function drawRect(rect:NSRect) { + m_mcBounds.clear(); ASTheme.current().drawScrollerSlotWithRectInView(rect, this); if (m_enabled) { *************** *** 574,578 **** m_scrollerKnobClipRect.size.height = rectKnob.size.height; m_scrollerKnobClip.clear(); - TRACE("drawing knob "+m_scrollerKnobClipRect ); ASTheme.current().drawScrollerWithRectInClip(new NSRect(0,0,rectKnob.size.width, rectKnob.size.height), m_scrollerKnobClip); } --- 575,578 ---- |
From: Richard K. <ric...@us...> - 2005-05-27 20:57:52
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19865/test Modified Files: ASTestScrollView.as Log Message: second button Index: ASTestScrollView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestScrollView.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASTestScrollView.as 27 May 2005 20:52:37 -0000 1.2 --- ASTestScrollView.as 27 May 2005 20:57:42 -0000 1.3 *************** *** 45,51 **** actionButton.setTitle("Scroll 1!"); view.addSubview(actionButton); ! actionButton = (new NSButton()).initWithFrame(new NSRect(300,300,70,30)); ! actionButton.setTitle("Scroll 2!"); ! view.addSubview(actionButton); var scrollView:NSScrollView = (new NSScrollView()).initWithFrame(new NSRect(0,0,250,250)); --- 45,51 ---- actionButton.setTitle("Scroll 1!"); view.addSubview(actionButton); ! var actionButton2 = (new NSButton()).initWithFrame(new NSRect(200,200,70,30)); ! actionButton2.setTitle("Scroll 2!"); ! view.addSubview(actionButton2); var scrollView:NSScrollView = (new NSScrollView()).initWithFrame(new NSRect(0,0,250,250)); |
From: Richard K. <ric...@us...> - 2005-05-27 20:54:10
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19092 Modified Files: NSView.as Log Message: inverse m_mcBounds _x and _y from mcBounds.origin Index: NSView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSView.as,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NSView.as 27 May 2005 01:33:06 -0000 1.15 --- NSView.as 27 May 2005 20:53:52 -0000 1.16 *************** *** 215,220 **** private function updateBoundsMovieClip():Void { if (m_bounds != undefined) { ! m_mcBounds._x = m_bounds.origin.x; ! m_mcBounds._y = m_bounds.origin.y; } } --- 215,220 ---- private function updateBoundsMovieClip():Void { if (m_bounds != undefined) { ! m_mcBounds._x = -m_bounds.origin.x; ! m_mcBounds._y = -m_bounds.origin.y; } } |
From: Richard K. <ric...@us...> - 2005-05-27 20:53:21
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18966 Modified Files: NSClipView.as Log Message: Got scroller working Index: NSClipView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSClipView.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NSClipView.as 27 May 2005 01:47:09 -0000 1.2 --- NSClipView.as 27 May 2005 20:53:12 -0000 1.3 *************** *** 93,97 **** public function scrollToPoint(point:NSPoint) { ! setBoundsOrigin(constrainScrollPoint(point)); } --- 93,100 ---- public function scrollToPoint(point:NSPoint) { ! TRACE("point: "+point); ! point = constrainScrollPoint(point); ! TRACE("point constrained: "+point); ! setBoundsOrigin(point); } *************** *** 107,111 **** } else if (point.x <= documentFrame.origin.x) { newPoint.x = documentFrame.origin.x; ! } else if (point.x + m_bounds.size.width >= documentFrame.maxX()) { newPoint.x = documentFrame.maxX() - m_bounds.size.width; } --- 110,114 ---- } else if (point.x <= documentFrame.origin.x) { newPoint.x = documentFrame.origin.x; ! } else if ((point.x + m_bounds.size.width) >= documentFrame.maxX()) { newPoint.x = documentFrame.maxX() - m_bounds.size.width; } *************** *** 115,119 **** } else if (point.y <= documentFrame.origin.y) { newPoint.y = documentFrame.origin.y; ! } else if (point.y + m_bounds.size.height >= documentFrame.maxY) { newPoint.y = documentFrame.maxY() - m_bounds.size.height; } --- 118,122 ---- } else if (point.y <= documentFrame.origin.y) { newPoint.y = documentFrame.origin.y; ! } else if ((point.y + m_bounds.size.height) >= documentFrame.maxY()) { newPoint.y = documentFrame.maxY() - m_bounds.size.height; } *************** *** 191,195 **** } super.setBoundsOrigin(point); ! m_documentView.setNeedsDisplay(true); NSScrollView(m_superview).reflectScrolledClipView(this); } --- 194,198 ---- } super.setBoundsOrigin(point); ! //m_documentView.setNeedsDisplay(true); NSScrollView(m_superview).reflectScrolledClipView(this); } |
From: Richard K. <ric...@us...> - 2005-05-27 20:52:47
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18849 Modified Files: NSScroller.as Log Message: got scroller working...yeah! Index: NSScroller.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSScroller.as,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NSScroller.as 26 May 2005 20:35:50 -0000 1.9 --- NSScroller.as 27 May 2005 20:52:37 -0000 1.10 *************** *** 77,81 **** m_enabled = true; m_pendingKnobProportion = 0; ! m_scrollerKnobClipRect = NSRect.ZeroRect; } --- 77,81 ---- m_enabled = true; m_pendingKnobProportion = 0; ! m_scrollerKnobClipRect = new NSRect(0,0,0,0); } *************** *** 564,577 **** if (m_scrollerKnobClipRect.origin.x != rectKnob.origin.x || m_scrollerKnobClipRect.origin.y != rectKnob.origin.y) { - m_scrollerKnobClip._x = rectKnob.origin.x; - m_scrollerKnobClip._y = rectKnob.origin.y; m_scrollerKnobClipRect.origin.x = rectKnob.origin.x; m_scrollerKnobClipRect.origin.y = rectKnob.origin.y; } if (m_scrollerKnobClipRect.size.width != rectKnob.size.width || ! m_scrollerKnobClipRect.size.width != rectKnob.size.height) { m_scrollerKnobClipRect.size.width = rectKnob.size.width; ! m_scrollerKnobClipRect.size.width = rectKnob.size.height; m_scrollerKnobClip.clear(); ASTheme.current().drawScrollerWithRectInClip(new NSRect(0,0,rectKnob.size.width, rectKnob.size.height), m_scrollerKnobClip); } --- 564,578 ---- if (m_scrollerKnobClipRect.origin.x != rectKnob.origin.x || m_scrollerKnobClipRect.origin.y != rectKnob.origin.y) { m_scrollerKnobClipRect.origin.x = rectKnob.origin.x; m_scrollerKnobClipRect.origin.y = rectKnob.origin.y; + m_scrollerKnobClip._x = rectKnob.origin.x; + m_scrollerKnobClip._y = rectKnob.origin.y; } if (m_scrollerKnobClipRect.size.width != rectKnob.size.width || ! m_scrollerKnobClipRect.size.height != rectKnob.size.height) { m_scrollerKnobClipRect.size.width = rectKnob.size.width; ! m_scrollerKnobClipRect.size.height = rectKnob.size.height; m_scrollerKnobClip.clear(); + TRACE("drawing knob "+m_scrollerKnobClipRect ); ASTheme.current().drawScrollerWithRectInClip(new NSRect(0,0,rectKnob.size.width, rectKnob.size.height), m_scrollerKnobClip); } |
From: Richard K. <ric...@us...> - 2005-05-27 20:52:47
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18849/test Modified Files: ASTestScrollView.as ASTestView.as Log Message: got scroller working...yeah! Index: ASTestScrollView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestScrollView.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTestScrollView.as 26 May 2005 20:35:51 -0000 1.1 --- ASTestScrollView.as 27 May 2005 20:52:37 -0000 1.2 *************** *** 40,44 **** var view:ASTestView = new ASTestView(); ! view.initWithFrame(new NSRect(0, 0, 800, 800)); var scrollView:NSScrollView = (new NSScrollView()).initWithFrame(new NSRect(0,0,250,250)); --- 40,51 ---- var view:ASTestView = new ASTestView(); ! view.initWithFrame(new NSRect(0, 0, 1024, 350)); ! view.setBorderColor(new NSColor(0xff0000)); ! var actionButton = (new NSButton()).initWithFrame(new NSRect(10,10,70,30)); ! actionButton.setTitle("Scroll 1!"); ! view.addSubview(actionButton); ! actionButton = (new NSButton()).initWithFrame(new NSRect(300,300,70,30)); ! actionButton.setTitle("Scroll 2!"); ! view.addSubview(actionButton); var scrollView:NSScrollView = (new NSScrollView()).initWithFrame(new NSRect(0,0,250,250)); Index: ASTestView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestView.as,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ASTestView.as 15 May 2005 04:28:44 -0000 1.4 --- ASTestView.as 27 May 2005 20:52:37 -0000 1.5 *************** *** 35,38 **** --- 35,39 ---- class org.actionstep.test.ASTestView extends NSView { private var m_backgroundColor:NSColor; + private var m_borderColor:NSColor public function ASTestView() { *************** *** 48,59 **** } public function drawRect(rect:NSRect) { with(m_mcBounds) { ! lineStyle(0, 0x000000, 0); beginFill(m_backgroundColor.value, 100); moveTo(0,0); ! lineTo(rect.size.width, 0); ! lineTo(rect.size.width, rect.size.height); ! lineTo(0, rect.size.height); lineTo(0, 0); endFill(); --- 49,72 ---- } + public function setBorderColor(color:NSColor) { + m_borderColor = color; + } + + public function borderColor():NSColor { + return m_borderColor; + } + public function drawRect(rect:NSRect) { with(m_mcBounds) { ! if (m_borderColor != null) { ! lineStyle(1, m_borderColor.value, 100); ! } else { ! lineStyle(0, 0x000000, 0); ! } beginFill(m_backgroundColor.value, 100); moveTo(0,0); ! lineTo(rect.size.width-1, 0); ! lineTo(rect.size.width-1, rect.size.height-1); ! lineTo(0, rect.size.height-1); lineTo(0, 0); endFill(); |
From: Richard K. <ric...@us...> - 2005-05-27 20:51:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18707 Modified Files: NSRect.as Log Message: explicit this. Index: NSRect.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSRect.as,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NSRect.as 27 May 2005 01:33:06 -0000 1.8 --- NSRect.as 27 May 2005 20:51:44 -0000 1.9 *************** *** 45,50 **** public function NSRect(x:Number, y:Number, width:Number, height:Number) { ! origin = new NSPoint(x, y); ! size = new NSSize(width, height); } --- 45,50 ---- public function NSRect(x:Number, y:Number, width:Number, height:Number) { ! this.origin = new NSPoint(x, y); ! this.size = new NSSize(width, height); } |
From: Scott H. <sco...@us...> - 2005-05-27 06:24:21
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28541/src/org/actionstep Modified Files: NSMatrix.as Log Message: sizeToCells implemented Index: NSMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSMatrix.as,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NSMatrix.as 27 May 2005 06:02:51 -0000 1.10 --- NSMatrix.as 27 May 2005 06:24:12 -0000 1.11 *************** *** 1013,1018 **** } - recalcCellSize(); - setNeedsDisplay(true); } --- 1013,1016 ---- *************** *** 1115,1120 **** } - recalcCellSize(); - setNeedsDisplay(true); } --- 1113,1116 ---- *************** *** 1310,1318 **** var cellItr:NSEnumerator = m_sel.objectEnumerator(); var cell:NSCell; ! var loc:Object; ! while (null != (loc = cellItr.nextObject())) { ! cell = cellAtRowColumn(loc.row, loc.column); cell.setHighlighted(false); } --- 1306,1314 ---- var cellItr:NSEnumerator = m_sel.objectEnumerator(); var cell:NSCell; ! var loc:Number; ! while (null != (loc = Number(cellItr.nextObject()))) { ! cell = NSCell(m_cells.objectAtIndex(loc)); cell.setHighlighted(false); } *************** *** 1699,1702 **** --- 1695,1719 ---- } + + /** + * Sizes the matrix to the exact size required to view all the cells. + */ + public function sizeToCells():Void + { + var frameSize:NSSize = NSSize.ZeroSize.clone(); + var cs:NSSize = m_cellsize; + var ss:NSSize = m_cellspacing; + + TRACE("cell size: " + cs); + TRACE("cell spacing: " + ss); + + frameSize.width += cs.width * m_numcols + ss.width * (m_numcols + 1); + frameSize.height += cs.height * m_numrows + ss.height * (m_numrows + 1); + + TRACE(frameSize); + + this.setFrameSize(frameSize); + } + //****************************************************** //* Events * |
From: Scott H. <sco...@us...> - 2005-05-27 06:23:57
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28474/src/org/actionstep/test Modified Files: ASTestMatrix.as Log Message: column removal buttons Index: ASTestMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestMatrix.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASTestMatrix.as 27 May 2005 06:03:15 -0000 1.3 --- ASTestMatrix.as 27 May 2005 06:23:46 -0000 1.4 *************** *** 49,53 **** 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); --- 49,53 ---- var cell:NSButtonCell = (new NSButtonCell()).initTextCell("test"); var matrix:NSMatrix = (new NSMatrix()).initWithFrameModePrototypeNumberOfRowsNumberOfColumns ! (new NSRect(10,90,270,200), org.actionstep.constants.NSMatrixMode.NSRadioModeMatrix, cell, 2, 2); *************** *** 61,68 **** --- 61,80 ---- { matrix.addColumn(); + matrix.sizeToCells(); } target.addRow = function() { matrix.addRow(); + matrix.sizeToCells(); + } + target.removeRow = function() + { + matrix.removeRow(matrix.numberOfRows() - 1); + matrix.sizeToCells(); + } + target.removeColumn = function() + { + matrix.removeColumn(matrix.numberOfColumns() - 1); + matrix.sizeToCells(); } *************** *** 78,81 **** --- 90,105 ---- addRowButton.setAction("addRow"); view.addSubview(addRowButton); + + var remRowButton:NSButton = (new NSButton()).initWithFrame(new NSRect(120,50,100,30)); + remRowButton.setTitle("Remove Row"); + remRowButton.setTarget(target); + remRowButton.setAction("removeRow"); + view.addSubview(remRowButton); + + var remColButton:NSButton = (new NSButton()).initWithFrame(new NSRect(10,50,100,30)); + remColButton.setTitle("Remove Column"); + remColButton.setTarget(target); + remColButton.setAction("removeColumn"); + view.addSubview(remColButton); window.setContentView(view); |
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(); |
From: Scott H. <sco...@us...> - 2005-05-27 06:03:01
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25708/src/org/actionstep Modified Files: NSMatrix.as Log Message: fixed some with adding columns and rows Index: NSMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSMatrix.as,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NSMatrix.as 27 May 2005 05:15:21 -0000 1.9 --- NSMatrix.as 27 May 2005 06:02:51 -0000 1.10 *************** *** 576,581 **** case 1: ! var loc:Object = m_sel.lastObject(); ! return cellAtRowColumn(loc.row, loc.column); } --- 576,581 ---- case 1: ! var loc:Number = Number(m_sel.lastObject()); ! return NSCell(m_cells.objectAtIndex(loc)); } *************** *** 584,590 **** // default case (selections > 1) // ! var selLoc:Object = getLowestRightmostSelectionLocation(); ! return cellAtRowColumn(selLoc.row, selLoc.column); } --- 584,590 ---- // default case (selections > 1) // ! var selLoc:Number = getLowestRightmostSelectionLocation(); ! return NSCell(m_cells.objectAtIndex(selLoc)); } *************** *** 601,609 **** // var cellItr:NSEnumerator = m_sel.objectEnumerator(); ! var selLoc:Object; ! while (null != (selLoc = cellItr.nextObject())) { ! res.addObject(cellAtRowColumn(selLoc.row, selLoc.column)); } --- 601,609 ---- // var cellItr:NSEnumerator = m_sel.objectEnumerator(); ! var selLoc:Number; ! while (null != (selLoc = Number(cellItr.nextObject()))) { ! res.addObject(m_cells.objectAtIndex(selLoc)); } *************** *** 971,979 **** if (cnt > 0 && (m_numrows == 0 || m_numcols == 0)) { renewRowsColumnsRowSpaceColSpace(cnt, 1, 0, cnt); } else { ! renewRowsColumnsRowSpaceColSpace(m_numrows == 0 ? m_numrows : 1, i, 0, cnt); } --- 971,981 ---- if (cnt > 0 && (m_numrows == 0 || m_numcols == 0)) { + TRACE("cnt > 0 && (m_numrows == 0 || m_numcols == 0)"); renewRowsColumnsRowSpaceColSpace(cnt, 1, 0, cnt); } else { ! TRACE("num rows: " + m_numrows + ", column: " + i); ! renewRowsColumnsRowSpaceColSpace(m_numrows == 0 ? 1 : m_numrows, i, 0, cnt); } *************** *** 1011,1014 **** --- 1013,1017 ---- } + recalcCellSize(); setNeedsDisplay(true); *************** *** 1081,1085 **** { renewRowsColumnsRowSpaceColSpace(i, ! m_numcols == 0 ? m_numcols : 1, cnt, 0); } --- 1084,1088 ---- { renewRowsColumnsRowSpaceColSpace(i, ! m_numcols == 0 ? 1 : m_numcols, cnt, 0); } *************** *** 1111,1114 **** --- 1114,1121 ---- selectCellAtRowColumn(0, 0); } + + recalcCellSize(); + + setNeedsDisplay(true); } *************** *** 1582,1586 **** m_selcell_row = row; m_selcell_column = column; ! m_sel.addObject({row: row, column: column}); // --- 1589,1593 ---- m_selcell_row = row; m_selcell_column = column; ! m_sel.addObject(indexFromRowColumn(row, column)); // *************** *** 1764,1768 **** m_mousedownflags = theEvent.modifierFlags; // record flags ! super.mouseDown(theEvent); } --- 1771,1775 ---- m_mousedownflags = theEvent.modifierFlags; // record flags ! //super.mouseDown(theEvent); } *************** *** 1960,1963 **** --- 1967,1972 ---- rows:Number, columns:Number, rowSpace:Number, colSpace:Number):Void { + TRACE(rows + ", " + columns); + // // Check for illegal arguments (negative column or row). *************** *** 1983,1989 **** // if (columns > m_numcols) // Only expand if necessary ! { ! var numNewCols:Number = columns - m_numcols; ! // // Loop through the rows, adding the column to each. --- 1992,1996 ---- // if (columns > m_numcols) // Only expand if necessary ! { // // Loop through the rows, adding the column to each. *************** *** 1991,1994 **** --- 1998,2003 ---- for (var i:Number = m_numrows; i > 0; i--) { + var numNewCols:Number = columns - m_numcols; + var insertPoint:Number = i * m_numcols; *************** *** 1997,2001 **** } } ! else { var numColsToRemove:Number = m_numcols - columns; --- 2006,2010 ---- } } ! else if (columns < m_numcols) { var numColsToRemove:Number = m_numcols - columns; *************** *** 2025,2029 **** m_cells.addObject(makeCell()); } ! else { var numCellsToRemove:Number = (m_numrows - rows) * m_numcols; --- 2034,2038 ---- m_cells.addObject(makeCell()); } ! else if (rows < m_numrows) { var numCellsToRemove:Number = (m_numrows - rows) * m_numcols; *************** *** 2036,2039 **** --- 2045,2049 ---- m_numrows = rows; + TRACE("cells: " + m_cells); //deselectAllCells(); } *************** *** 2091,2105 **** * Returns the lowest, rightmost selected cell, with row taking precedence. */ ! private function getLowestRightmostSelectionLocation():Object { var cellItr:NSEnumerator = m_sel.objectEnumerator(); var selLoc:Object; var resLoc:Object; ! while (null != (selLoc = cellItr.nextObject())) { if (resLoc == null) // Set resLoc to the first item in the list. { resLoc = selLoc; continue; } --- 2101,2120 ---- * Returns the lowest, rightmost selected cell, with row taking precedence. */ ! private function getLowestRightmostSelectionLocation():Number { var cellItr:NSEnumerator = m_sel.objectEnumerator(); var selLoc:Object; var resLoc:Object; + var resIdx:Number; + var index:Number; ! while (null != (index = Number(cellItr.nextObject()))) { + selLoc = rowColumnFromIndex(index); + if (resLoc == null) // Set resLoc to the first item in the list. { resLoc = selLoc; + resIdx = index; continue; } *************** *** 2112,2123 **** { resLoc = selLoc; } else // == pick farthest to right { resLoc = resLoc.column > selLoc.column ? resLoc : selLoc; } } ! return resLoc; } --- 2127,2140 ---- { resLoc = selLoc; + resIdx = index; } else // == pick farthest to right { resLoc = resLoc.column > selLoc.column ? resLoc : selLoc; + resIdx = indexFromRowColumn(resLoc.row, resLoc.column); } } ! return resIdx; } *************** *** 2254,2257 **** --- 2271,2288 ---- } + + /** + * Given an index, returns an object with row and column properties. + */ + private function rowColumnFromIndex(index:Number):Object + { + var ret:Object = new Object(); + + ret.row = Math.ceil(index / m_numcols); + ret.column = index % m_numrows; + + return ret; + } + //****************************************************** //* Public Static Properties * |
From: Scott H. <sco...@us...> - 2005-05-27 05:15:47
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19213/src/org/actionstep Modified Files: NSMatrix.as Log Message: Now uses a 1-dimensional array on the inside Index: NSMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSMatrix.as,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NSMatrix.as 27 May 2005 01:47:23 -0000 1.8 --- NSMatrix.as 27 May 2005 05:15:21 -0000 1.9 *************** *** 388,405 **** public function cells():NSArray { ! var cells:NSArray = new NSArray(); ! ! var itr:NSEnumerator = m_cells.objectEnumerator(); ! ! var row:NSArray; ! while (null != (row = NSArray(itr.nextObject()))) ! { ! // ! // Combine the cells so far with the new row. ! // ! cells = NSArray.combine(cells, row); ! } ! ! return cells; } --- 388,392 ---- public function cells():NSArray { ! return m_cells; } *************** *** 1141,1159 **** public function makeCellAtRowColumn(row:Number, column:Number):NSCell { ! var cell:NSCell; ! ! // ! // Build the cell from the existing cell instance, or the cell ! // class, depending on usingCellInstance. ! // ! if (m_usingcellinstance) ! { ! cell = NSCell(m_prototype.memberwiseClone()); ! } ! else ! { ! cell = NSCell( ! org.actionstep.ASUtils.createInstanceOf(m_cellclass)); ! } // --- 1128,1132 ---- public function makeCellAtRowColumn(row:Number, column:Number):NSCell { ! var cell:NSCell = makeCell(); // *************** *** 1161,1171 **** // cell. // ! var rw:NSArray = NSArray(m_cells.objectAtIndex(row)); ! rw.replaceObject(column, cell); ! return cell; } ! /** * Replaces the cell at the location specified by row and column with --- 1134,1143 ---- // cell. // ! m_cells.replaceObject(indexFromRowColumn(row, column), cell); ! return cell; } ! /** * Replaces the cell at the location specified by row and column with *************** *** 1187,1191 **** // Replace it. // ! NSArray(m_cells.objectAtIndex(row)).replaceObject(column, newCell); // --- 1159,1163 ---- // Replace it. // ! m_cells.replaceObject(indexFromRowColumn(row, column), newCell); // *************** *** 1204,1215 **** public function removeColumn(column:Number):Void { ! var rowItr:NSEnumerator = m_cells.objectEnumerator(); ! var row:NSArray; ! while (null != (row = NSArray(rowItr.nextObject()))) { ! row.removeObjectAtIndex(column); } setNeedsDisplay(true); } --- 1176,1195 ---- public function removeColumn(column:Number):Void { ! // ! // Check if row and column are in bounds. ! // ! if (column >= m_numcols || column < 0) ! { ! throw new Error("NSMatrix::removeColumn - " + ! "column: " + column + " - Out of bounds."); ! } ! for (var i:Number = m_numrows - 1; i >= 0; i--) { ! m_cells.removeObjectAtIndex(i * m_numcols + column); } + m_numcols--; + setNeedsDisplay(true); } *************** *** 1224,1228 **** public function removeRow(row:Number):Void { ! m_cells.removeObjectAtIndex(row); setNeedsDisplay(true); --- 1204,1223 ---- public function removeRow(row:Number):Void { ! // ! // Check if row and column are in bounds. ! // ! if (row >= m_numrows || row < 0) ! { ! throw new Error("NSMatrix::removeRow - row: " + row + ! " - Out of bounds."); ! } ! ! var removalPoint:Number = row * m_numcols; ! var numToRemove:Number = m_numcols; ! ! while (numToRemove-- > 0) ! m_cells.removeObjectAtIndex(removalPoint); ! ! m_numrows--; setNeedsDisplay(true); *************** *** 1239,1248 **** public function cellAtRowColumn(row:Number, column:Number):NSCell { ! var theRow:NSArray = NSArray(m_cells.objectAtIndex(row)); ! ! if (theRow == null) // NSArray returns null if out of range. ! return null; ! ! return NSCell(theRow.objectAtIndex(column)); } --- 1234,1238 ---- public function cellAtRowColumn(row:Number, column:Number):NSCell { ! return NSCell(m_cells.objectAtIndex(indexFromRowColumn(row, column))); } *************** *** 1279,1298 **** // ! // Cycle through rows, backwards. // ! var col:NSArray; ! while (null != (col = NSArray(itrRows.nextObject()))) ! { ! var itrCol:NSEnumerator = col.reverseObjectEnumerator(); ! ! // ! // Cycle through row cells, backwards. ! // ! var cell:NSCell; ! while (null != (cell = NSCell(itrCol.nextObject()))) ! { ! if (cell.tag() == anInt) ! return cell; ! } } --- 1269,1279 ---- // ! // Cycle through cells // ! var cell:NSCell; ! while (null != (cell = NSCell(itrRows.nextObject()))) ! { ! if (cell.tag() == anInt) ! return cell; } *************** *** 1829,1833 **** } ! private var m_lastcell:NSCell = null; private var m_highlightedcell:NSCell = null; --- 1810,1814 ---- } ! private var m_lastcell:NSCell = null; private var m_highlightedcell:NSCell = null; *************** *** 1969,1973 **** /** ! * Renew rows and columns. * * @param rows The new number of rows in the matrix. --- 1950,1954 ---- /** ! * Renew rows and columns. * * @param rows The new number of rows in the matrix. *************** *** 2002,2034 **** // if (columns > m_numcols) // Only expand if necessary { ! var end:Number = columns - 1; // ! // Loop through the rows, adding the column to each. // ! for (var i:Number = 0; i < m_numrows; i++) { ! var row:NSArray = NSArray(m_cells.objectAtIndex(i)); ! ! for (var j:Number = m_numcols; j < columns; j++) ! { ! // ! // Add a null value to the new cells. ! // ! row.replaceObject(j, null); ! ! if (j == end && colSpace > 0) ! { ! colSpace--; ! } ! else ! { ! makeCellAtRowColumn(i, j); ! } ! } } } // // Expand rows --- 1983,2018 ---- // if (columns > m_numcols) // Only expand if necessary + { + var numNewCols:Number = columns - m_numcols; + + // + // Loop through the rows, adding the column to each. + // + for (var i:Number = m_numrows; i > 0; i--) + { + var insertPoint:Number = i * m_numcols; + + while (numNewCols-- > 0) + m_cells.insertObjectAtIndex(makeCell(), insertPoint); + } + } + else { ! var numColsToRemove:Number = m_numcols - columns; // ! // Loop through the rows, removing the column from each. // ! for (var i:Number = m_numrows; i > 0; i--) { ! var removalPoint:Number = i * m_numcols; ! ! while (numColsToRemove-- > 0) ! m_cells.removeObjectAtIndex(removalPoint); } } + m_numcols = columns; + // // Expand rows *************** *** 2036,2086 **** if (rows > m_numrows) // Only expand if necessary. { ! var end:Number = rows - 1; ! // ! // Create a new row for all that don't currently exist. ! // ! for (var i:Number = m_numrows; i < rows; i++) ! { ! // ! // Add an create the new cell. ! // ! var row:NSArray = new NSArray(); ! m_cells.addObject(row); ! ! if (i == end) ! { ! for (var j:Number = 0; j < columns; j++) ! { ! // ! // Add a null value to the new cells. ! // ! row.replaceObject(j, null); ! ! if (rowSpace > 0) ! { ! rowSpace--; ! } ! else ! { ! makeCellAtRowColumn(i, j); ! } ! } ! } ! else ! { ! for (var j:Number = 0; j < columns; j++) ! { ! // ! // Add a null value to the new cells. ! // ! row.replaceObject(j, null); ! makeCellAtRowColumn(i, j); ! } ! } ! } } ! ! m_numcols = columns; m_numrows = rows; --- 2020,2037 ---- if (rows > m_numrows) // Only expand if necessary. { ! var numCellsToInsert:Number = (rows - m_numrows) * m_numcols; ! while (numCellsToInsert-- > 0) ! m_cells.addObject(makeCell()); } ! else ! { ! var numCellsToRemove:Number = (m_numrows - rows) * m_numcols; ! var removalPoint:Number = m_numcols * m_numrows; ! ! while (numCellsToRemove-- > 0) ! m_cells.removeObjectAtIndex(removalPoint); ! } ! m_numrows = rows; *************** *** 2268,2271 **** --- 2219,2257 ---- } + + /** + * Makes a cell based on the prototype instance or the cell class. + */ + private function makeCell():NSCell + { + var cell:NSCell; + + // + // Build the cell from the existing cell instance, or the cell + // class, depending on usingCellInstance. + // + if (m_usingcellinstance) + { + cell = NSCell(m_prototype.memberwiseClone()); + } + else + { + cell = NSCell( + org.actionstep.ASUtils.createInstanceOf(m_cellclass)); + } + + return cell; + } + + + /** + * Given a row and column, will return the corresponding index into + * the underlying data structure. + */ + private function indexFromRowColumn(row:Number, column:Number):Number + { + return (row * m_numcols) + column; + } + //****************************************************** //* Public Static Properties * |
From: Scott H. <sco...@us...> - 2005-05-27 05:15:02
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19117/src/org/actionstep Modified Files: NSArray.as Log Message: added ability to access internal array Index: NSArray.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSArray.as,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NSArray.as 17 May 2005 03:21:19 -0000 1.9 --- NSArray.as 27 May 2005 05:14:52 -0000 1.10 *************** *** 57,60 **** --- 57,69 ---- /** + * Returns the internal array. For super quick operations only. + */ + public function internalList():Array + { + return m_list; + } + + + /** * Returns the number of objects currently in the array. */ |
From: Scott H. <sco...@us...> - 2005-05-27 01:48:20
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19407/src/org/actionstep/test Modified Files: ASTestMatrix.as Log Message: new ver Index: ASTestMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestMatrix.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTestMatrix.as 17 May 2005 02:32:23 -0000 1.1 --- ASTestMatrix.as 27 May 2005 01:48:11 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- import org.actionstep.NSMatrix; + import org.actionstep.constants.NSButtonType; import org.actionstep.*; |