Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30977/src/org/actionstep Modified Files: ASUtils.as NSArray.as NSControl.as NSEvent.as NSMatrix.as Removed Files: ASDefaultDrawer.as ASDraw.as ASDrawer.as ASDrawerProtocol.as Log Message: --- ASDrawerProtocol.as DELETED --- --- ASDefaultDrawer.as DELETED --- Index: NSArray.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSArray.as,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NSArray.as 17 May 2005 02:58:01 -0000 1.8 --- NSArray.as 17 May 2005 03:21:19 -0000 1.9 *************** *** 226,229 **** --- 226,266 ---- /** + * Searches the receiver for anObject and returns the index of the first + * equal object. Objects are considered equal when comparer returns TRUE. + * + * The comparer function must return TRUE if equal, FALSE if inequal, and + * take 2 objects as arguments (the objects to compare). + */ + public function indexOfObjectWithCompareFunction(anObject:Object, + comparer:Function):Number + { + return indexOfObjectWithCompareFunctionInRange(anObject, comparer, + new NSRange(0, m_list.length - 1)); + } + + + /** + * Searches the specified range for anObject and returns the index of the first + * equal object. Objects are considered equal when comparer returns TRUE. + * + * The comparer function must return TRUE if equal, FALSE if inequal, and + * take 2 objects as arguments (the objects to compare). + */ + public function indexOfObjectWithCompareFunctionInRange(anObject:Object, + comparer:Function, range:NSRange):Number + { + var startIdx = range.location; + var endIdx = range.location + range.length; + + for (var i:Number = startIdx; i <= endIdx; i++) + { + if (comparer(m_list[i], anObject)) + return i; + } + + return NSObject.NSNotFound; + } + + /** * Searches the receiver for anObject (testing for equality by comparing * object addresses) and returns the lowest index whose corresponding --- ASDraw.as DELETED --- Index: ASUtils.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASUtils.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASUtils.as 10 May 2005 02:19:19 -0000 1.3 --- ASUtils.as 17 May 2005 03:21:19 -0000 1.4 *************** *** 56,61 **** public static function createInstanceOf(klass:Function):Object { ! var res:Object = new Object(); res.__proto__ = klass.prototype; return res; } --- 56,62 ---- public static function createInstanceOf(klass:Function):Object { ! var res:Object = new klass(); res.__proto__ = klass.prototype; + return res; } --- ASDrawer.as DELETED --- Index: NSControl.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSControl.as,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NSControl.as 17 May 2005 02:30:04 -0000 1.7 --- NSControl.as 17 May 2005 03:21:19 -0000 1.8 *************** *** 342,350 **** } ! public function sendActionTo(action:String, to):Boolean { ! if (action==null) { return false; } ! return NSApplication.sharedApplication().sendActionToFrom(action, to, this); } --- 342,360 ---- } ! /** ! * Tells the NSApplication to trigger theAction in theTarget. ! * ! * If theAction is null, the call to sendActionTo is ignored. If theTarget ! * is null, NSApplication searches the responder chain for an object that ! * can respond to the message. ! * ! * This method returns TRUE if a target responds to the message, and FALSE ! * otherwise. ! */ ! public function sendActionTo(theAction:String, theTarget:Object):Boolean { ! if (theAction == null) { return false; } ! return NSApplication.sharedApplication().sendActionToFrom(theAction, theTarget, this); } Index: NSMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSMatrix.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NSMatrix.as 17 May 2005 02:30:46 -0000 1.6 --- NSMatrix.as 17 May 2005 03:21:19 -0000 1.7 *************** *** 1556,1561 **** var cell:NSCell = cellAtRowColumn(row, column); ! if (cell == null) ! return; cell.setHighlighted(true); // highlight the cell --- 1556,1568 ---- var cell:NSCell = cellAtRowColumn(row, column); ! // ! // For NSRadioModeMatrix - Deselect the old selection if not the ! // same as the new one. ! // ! if (m_mode == NSMatrixMode.NSRadioModeMatrix && cell != null && ! m_cell != null && cell != m_cell) ! { ! ! } cell.setHighlighted(true); // highlight the cell *************** *** 1566,1570 **** //! text selection } ! m_sel.addObject({row: row, column: column}); // add to the selection drawCellAtRowColumn(row, column); // draw the cell --- 1573,1580 ---- //! text selection } ! ! ! m_cell = cell; ! m_sel.addObject({row: row, column: column}); // add to the selection drawCellAtRowColumn(row, column); // draw the cell Index: NSEvent.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSEvent.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NSEvent.as 4 May 2005 22:26:14 -0000 1.3 --- NSEvent.as 17 May 2005 03:21:19 -0000 1.4 *************** *** 262,266 **** public function description():String { ! return "NSEvent(type="+type+")"; } --- 262,266 ---- public function description():String { ! return "NSEvent(type="+type+",mouseLocation="+mouseLocation+")"; } |