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: Tay R. C. <rc...@us...> - 2005-07-15 12:19:42
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15681/actionstep/org/actionstep/test Added Files: ASTestSheet.as Log Message: Simple sheet test --- NEW FILE: ASTestSheet.as --- /* * Copyright (c) 2005, InfoEther, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3) The name InfoEther, Inc. may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ import org.actionstep.*; import org.actionstep.test.*; import org.actionstep.constants.* class org.actionstep.test.ASTestSheet { public static var self = ASTestSheet, app:NSApplication = NSApplication.sharedApplication(), main:NSWindow, error:NSWindow, other:NSWindow, view1, view2,// view3, begin:NSButton, end:NSButton, textField:NSTextField, textField2:NSTextField public static function test() { TRACE("app: "+app); main= (new NSWindow()).initWithContentRectStyleMask(new NSRect(50,50,250,250), NSWindow.NSTitledWindowMask); main.setTitle("Main"); //error = (new NSWindow()).initWithContentRectStyleMask(new NSRect(125,100,250,250), NSWindow.NSTitledWindowMask); //error.setTitle("Error"); other = (new NSWindow()).initWithContentRectStyleMask(new NSRect(400,100,250,250), NSWindow.NSTitledWindowMask); other.setTitle("Some Other Window"); view1 = (new ASTestView()).initWithFrame(new NSRect(0,0,25,25)); view1.setBorderColor(new NSColor(0xFFF000)); view2 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,250)); view2.setBorderColor(new NSColor(0xFF0000)); //view3 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,250)); //view3.setBorderColor(new NSColor(0xFF0000)); begin = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); begin.setTitle("Error..."); begin.sendActionOn(NSEvent.NSLeftMouseUpMask); begin.setBezelStyle(NSBezelStyle.NSShadowlessSquareBezelStyle); end = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); end.setTitle("OK"); end.sendActionOn(NSEvent.NSLeftMouseUpMask); end.setBezelStyle(NSBezelStyle.NSShadowlessSquareBezelStyle); textField = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); textField2 = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); view1.addSubview(begin); view1.addSubview(textField); view2.addSubview(end); view2.addSubview(textField2); begin.setTarget(self); begin.setAction("trigger"); end.setTarget(self); end.setAction("stop"); main.setContentView(view1); error.setContentView(view2); //other.setContentView(view3); view2.setHidden(true); app.run(); } static var alert:NSAlert; //tracking starts before modal can start posing! public static function trigger(button) { TRACE("Starting sheet..."); alert = (new NSAlert()).init(); alert.addButtonWithTitle("OK"); alert.addButtonWithTitle("Cancel"); alert.addButtonWithTitle("Don't Save"); alert.setMessageText("Delete the record"); alert.setInformativeText("Deleted records cannot be restored."); alert.setAlertStyle(NSAlertStyle.NSWarning) main.resignKeyWindow(); view2.setHidden(false); alert.beginSheetModalForWindowModalDelegateDidEndSelectorContextInfo(main, self, "alertDidEndReturnCodeContextInfo", null); } public static function alertDidEndReturnCodeContextInfo(sheet, ret, ctxt) { var ans = ASUtils.findMatch([NSAlertReturn], ret); TRACE("button clicked: "+ans.prop); TRACE("releasing sheet... "+(sheet.release() ? "successful!" : "failed!")); } //look like NSObject public static function respondsToSelector(sel:String):Boolean { return self.hasOwnProperty(sel); } public static function toString():String { return "Test::ASTestPanel" } } |
From: Tay R. C. <rc...@us...> - 2005-07-15 12:18:47
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15545/actionstep/org/actionstep Modified Files: NSModalSession.as Log Message: added support for sheets and typed return values Index: NSModalSession.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSModalSession.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NSModalSession.as 22 Jun 2005 10:14:24 -0000 1.2 --- NSModalSession.as 15 Jul 2005 12:18:32 -0000 1.3 *************** *** 1,57 **** ! /* ! * Copyright (c) 2005, InfoEther, Inc. ! * All rights reserved. ! * ! * Redistribution and use in source and binary forms, with or without modification, ! * are permitted provided that the following conditions are met: ! * ! * 1) Redistributions of source code must retain the above copyright notice, ! * this list of conditions and the following disclaimer. ! * ! * 2) Redistributions in binary form must reproduce the above copyright notice, ! * this list of conditions and the following disclaimer in the documentation ! * and/or other materials provided with the distribution. ! * ! * 3) The name InfoEther, Inc. may not be used to endorse or promote products ! * derived from this software without specific prior written permission. ! * ! * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ! * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ! * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ! * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ! * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ! * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ! * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ! * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ! * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! * POSSIBILITY OF SUCH DAMAGE. ! */ ! ! import org.actionstep.NSObject; ! import org.actionstep.NSWindow; ! ! class org.actionstep.NSModalSession extends NSObject { ! public var runState:Number, ! entryLevel:Number, //not supported ! window:NSWindow, ! previous:NSModalSession; ! ! //additional, AS specific stuff ! public var callback:Object, ! selector:String; ! ! public function NSModalSession(run:Number, entry:Number, win:NSWindow, prev:NSModalSession, call:Object, sel:String) { ! runState = run; ! entryLevel = entry; ! window = win; ! previous = prev; ! ! callback = call; ! selector = sel; ! } ! ! public function description():String { ! return "NSModalSession()"; ! } } \ No newline at end of file --- 1,65 ---- ! /* ! * Copyright (c) 2005, InfoEther, Inc. ! * All rights reserved. ! * ! * Redistribution and use in source and binary forms, with or without modification, ! * are permitted provided that the following conditions are met: ! * ! * 1) Redistributions of source code must retain the above copyright notice, ! * this list of conditions and the following disclaimer. ! * ! * 2) Redistributions in binary form must reproduce the above copyright notice, ! * this list of conditions and the following disclaimer in the documentation ! * and/or other materials provided with the distribution. ! * ! * 3) The name InfoEther, Inc. may not be used to endorse or promote products ! * derived from this software without specific prior written permission. ! * ! * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ! * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ! * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ! * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ! * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ! * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ! * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ! * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ! * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ! * POSSIBILITY OF SUCH DAMAGE. ! */ ! ! import org.actionstep.NSObject; ! import org.actionstep.NSWindow; ! ! import org.actionstep.constants.NSRunResponse; ! ! class org.actionstep.NSModalSession extends NSObject { ! public var runState:NSRunResponse; ! public var entryLevel:Number; //not supported (yet) ! public var window:NSWindow; ! public var previous:NSModalSession; ! //not part of Openstep/Cocoa ! public var docWin:NSWindow; ! public var isSheet:Boolean; ! ! //additional, AS specific stuff ! public var callback:Object; ! public var selector:String; ! ! public function NSModalSession(run:NSRunResponse, entry:Number, win:NSWindow, prev:NSModalSession, call:Object, sel:String, sheet:NSWindow) { ! runState = run; ! entryLevel = entry; ! window = win; ! previous = prev; ! ! callback = call; ! selector = sel; ! ! docWin = sheet ! isSheet = (sheet==null) ? false : true; ! } ! ! public function description():String { ! return "NSModalSession()"; ! } } \ No newline at end of file |
From: Tay R. C. <rc...@us...> - 2005-07-15 12:17:52
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15369/actionstep/org/actionstep Modified Files: NSApplication.as Log Message: added support for sheets and typed return values Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** NSApplication.as 14 Jul 2005 22:04:03 -0000 1.21 --- NSApplication.as 15 Jul 2005 12:17:36 -0000 1.22 *************** *** 44,47 **** --- 44,49 ---- import org.actionstep.ASTheme; + import org.actionstep.constants.NSRunResponse; + class org.actionstep.NSApplication extends NSResponder { *************** *** 61,72 **** public static var NSApplicationWillUnhideNotification = ASUtils.intern("NSApplicationWillUnhideNotification"); public static var NSApplicationWillUpdateNotification = ASUtils.intern("NSApplicationWillUpdateNotification"); ! ! public static var NSRunStoppedResponse:Number = -1000; ! public static var NSRunAbortedResponse:Number = -1001; ! public static var NSRunContinuesResponse:Number = -1002; private static var m_sharedApplication:NSApplication; ! private var m_active:Boolean; private var m_keyWindow:NSWindow; private var m_mainWindow:NSWindow; --- 63,74 ---- public static var NSApplicationWillUnhideNotification = ASUtils.intern("NSApplicationWillUnhideNotification"); public static var NSApplicationWillUpdateNotification = ASUtils.intern("NSApplicationWillUpdateNotification"); ! ! public static var NSRunStoppedResponse:Number = -1000; ! public static var NSRunAbortedResponse:Number = -1001; ! public static var NSRunContinuesResponse:Number = -1002; private static var m_sharedApplication:NSApplication; ! private var m_active:Boolean; private var m_keyWindow:NSWindow; private var m_mainWindow:NSWindow; *************** *** 76,82 **** private var m_windowsNeedDisplay:Boolean; ! private var m_modalSession:NSModalSession; ! private var m_modalCallback:Object; ! private var m_modalSelector:String; public static function sharedApplication():NSApplication { --- 78,85 ---- private var m_windowsNeedDisplay:Boolean; ! private var m_modalSession:NSModalSession; ! private var m_modalCallback:Object; ! private var m_modalSelector:String; ! private var m_sheetFlags:Array; public static function sharedApplication():NSApplication { *************** *** 96,100 **** m_notificationCenter.addObserverSelectorNameObject(this, "__windowDidResignMain", NSWindow.NSWindowDidResignMainNotification, null); ! m_active = false; return this; } --- 99,103 ---- m_notificationCenter.addObserverSelectorNameObject(this, "__windowDidResignMain", NSWindow.NSWindowDidResignMainNotification, null); ! m_active = false; return this; } *************** *** 119,126 **** return NSWindow.instances(); } ! ! public function isActive():Boolean { ! return m_active; ! } // Event handling --- 122,129 ---- return NSWindow.instances(); } ! ! public function isActive():Boolean { ! return m_active; ! } // Event handling *************** *** 140,144 **** private var m_eventFilter = null; ! public function callObjectSelectorWithNextEventMatchingMaskDequeue(callback:Object, selector:String, mask:Number, dequeue:Boolean):Void { m_eventFilter = {object: callback, selector: selector, mask: mask, dequeue: dequeue}; --- 143,147 ---- private var m_eventFilter = null; ! public function callObjectSelectorWithNextEventMatchingMaskDequeue(callback:Object, selector:String, mask:Number, dequeue:Boolean):Void { m_eventFilter = {object: callback, selector: selector, mask: mask, dequeue: dequeue}; *************** *** 267,411 **** ASEventMonitor.instance().trackKeyboardEvents(); //! What else should we do in run? ! m_active = true; } ! ! //modal ! public function beginModalSessionForWindow(win:NSWindow, call:Object, sel:String):NSModalSession { ! m_modalSession = new NSModalSession(NSRunContinuesResponse, null, win, m_modalSession, call, sel); ! if(win instanceof NSPanel) { ! win.center(); ! win.setLevel(NSWindow.NSModalPanelWindowLevel); ! } ! win.orderFrontRegardless(); ! if(isActive()) { ! if(win.canBecomeKeyWindow()) { ! win.makeKeyWindow(); ! } else if (win.canBecomeMainWindow()) { ! win.makeMainWindow(); ! } ! } ! return m_modalSession; ! } ! ! public function endModalSession(sess:NSModalSession) { ! var tmp:NSModalSession = m_modalSession; ! if (sess == null) { ! var e:NSException = NSException.exceptionWithNameReasonUserInfo ! ("NSInvalidArgumentException", "null pointer passed to endModalSession", null); ! TRACE(e); ! e.raise(); } ! /* Remove this session from linked list of sessions. */ ! while (tmp != null && tmp != sess) { ! tmp = tmp.previous; ! } ! if (tmp == null) { ! //very impt! can cause player to crash ! var e:NSException = NSException.exceptionWithNameReasonUserInfo ! ("NSInvalidArgumentException", "unknown session passed to endModalSession", null); ! TRACE(e); ! e.raise(); } ! while (m_modalSession != sess) { tmp = m_modalSession; m_modalSession = tmp.previous; if (tmp.window!=null) { ! tmp.window.setLevel(tmp.entryLevel); ! } ! } ! m_modalSession = m_modalSession.previous; ! if (sess.window != null) { sess.window.setLevel(sess.entryLevel); } ! //send callback with result, set lastrun to true ! var o = sess.callback ! o[sess.selector].call(o, sess.runState, true); ! //end posing ! m_sharedApplication.sendEvent = m_sharedApplication.originalSendEvent; ! } ! ! public function runModalSession(sess:NSModalSession):Void { ! if (sess != m_modalSession) { ! var e:NSException = NSException.exceptionWithNameReasonUserInfo ! ("NSInvalidArgumentException", "wrong session", null); ! TRACE(e); ! e.raise(); } var win = sess.window; ! win.orderFrontRegardless(); ! if(win.canBecomeKeyWindow()) { ! win.makeKeyWindow(); ! } else if (win.canBecomeMainWindow()) { ! win.makeMainWindow(); ! } ! //start posing ! m_sharedApplication.originalSendEvent = m_sharedApplication.sendEvent; ! m_sharedApplication.sendEvent = m_sharedApplication.modalSendEvent; ! } ! ! private function modalSendEvent(event:NSEvent) { ! var done = false; ! var sess = m_modalSession; ! if (event != null) { ! var eventWindow:NSWindow = event.window; ! /* ! * We handle events for the session window, events for any ! * window which works when modal, and any window management ! * events. All others are ignored/discarded. ! */ ! if (!(eventWindow == sess.window ! || eventWindow.worksWhenModal() == true ! || event.type == NSEvent.NSAppKitDefined)) { ! event = null; ! } ! } ! var o = sess.callback ! o[sess.selector].call(o, sess.runState); ! if(event!=null) { ! m_sharedApplication.originalSendEvent(event); ! } ! } ! ! public function runModalForWindow (win:NSWindow, callb:Object, sel:String):Void { ! var sess:NSModalSession = beginModalSessionForWindow(win, m_sharedApplication, "modalWin"); ! runModalSession(sess); ! m_modalCallback = callb; ! m_modalSelector = sel; ! } ! ! private function modalWin(ret:Number, lastrun:Boolean) { ! if(!lastrun && ret!=NSRunContinuesResponse) { ! endModalSession(m_modalSession); ! } ! var o = m_modalCallback; ! var s = m_modalSelector; ! o[s].call(o, ret); ! } ! ! public function stopModal() { ! stopModalWithCode(NSRunStoppedResponse); ! } ! ! public function stopModalWithCode(ret:Number):Void { ! if(m_modalSession == null) { ! var e:NSException = NSException.exceptionWithNameReasonUserInfo ! ("NSInvalidArgumentException", "not in a modal session", null); ! TRACE(e); ! e.raise(); ! } ! m_modalSession.runState = ret; ! endModalSession(m_modalSession); ! } ! ! //note: can return null ! public function modalWindow():NSWindow { ! return m_modalSession.window; ! } ! ! //this function is not found in Cocoa ! public function runningModal():Boolean { ! return (m_modalSession==null) ? false : true; ! } ! private function __windowWillClose(notification:NSNotification) { --- 270,450 ---- ASEventMonitor.instance().trackKeyboardEvents(); //! What else should we do in run? ! m_active = true; } ! ! //modal ! public function beginModalSessionForWindow(win:NSWindow, call:Object, sel:String, docWin:NSWindow):NSModalSession { ! m_modalSession = new NSModalSession(NSRunResponse.NSContinues, null, win, m_modalSession, call, sel, docWin); ! if(win instanceof NSPanel) { ! win.center(); ! win.setLevel(NSWindow.NSModalPanelWindowLevel); } ! win.orderFrontRegardless(); ! if(isActive()) { ! if(win.canBecomeKeyWindow()) { ! win.makeKeyWindow(); ! } else if (win.canBecomeMainWindow()) { ! win.makeMainWindow(); ! } } ! return m_modalSession; ! } ! ! public function endModalSession(sess:NSModalSession) { ! var tmp:NSModalSession = m_modalSession; ! if (sess == null) { ! var e:NSException = NSException.exceptionWithNameReasonUserInfo ! ("NSInvalidArgumentException", "null pointer passed to endModalSession", null); ! TRACE(e); ! e.raise(); ! } ! /* Remove this session from linked list of sessions. */ ! while (tmp != null && tmp != sess) { ! tmp = tmp.previous; ! } ! if (tmp == null) { ! //very impt! can cause player to crash ! var e:NSException = NSException.exceptionWithNameReasonUserInfo ! ("NSInvalidArgumentException", "unknown session passed to endModalSession", null); ! TRACE(e); ! e.raise(); ! } ! while (m_modalSession != sess) { tmp = m_modalSession; m_modalSession = tmp.previous; if (tmp.window!=null) { ! tmp.window.setLevel(tmp.entryLevel); ! } ! } ! m_modalSession = m_modalSession.previous; ! if (sess.window != null) { sess.window.setLevel(sess.entryLevel); } ! //send callback with result, set lastrun to true ! var o = sess.callback ! o[sess.selector].call(o, sess.runState, true); ! //end posing ! m_sharedApplication.sendEvent = m_sharedApplication.originalSendEvent; ! } ! ! public function runModalSession(sess:NSModalSession):Void { ! if (sess != m_modalSession) { ! var e:NSException = NSException.exceptionWithNameReasonUserInfo ! ("NSInvalidArgumentException", "wrong session", null); ! TRACE(e); ! e.raise(); } var win = sess.window; ! win.orderFrontRegardless(); ! if(win.canBecomeKeyWindow()) { ! win.makeKeyWindow(); ! } else if (win.canBecomeMainWindow()) { ! win.makeMainWindow(); ! } ! //start posing ! m_sharedApplication.originalSendEvent = m_sharedApplication.sendEvent; ! m_sharedApplication.sendEvent = m_sharedApplication.modalSendEvent; ! } ! ! private function modalSendEvent(event:NSEvent) { ! var done = false; ! var sess:NSModalSession = m_modalSession; ! if (event != null) { ! var eventWindow:NSWindow = event.window; ! /* ! * We handle events for the session window, events for any ! * window which works when modal, and any window management ! * events. All others are ignored/discarded. ! */ ! if (!sess.isSheet && ! !( eventWindow == sess.window ! || eventWindow.worksWhenModal() == true ! || event.type == NSEvent.NSAppKitDefined)) { ! event = null; ! } else if(eventWindow == sess.docWin) { ! event = null; ! } ! //if window is a sheet, allow other windows to receive events ! } ! var o = sess.callback ! o[sess.selector].call(o, sess.runState); ! if(event!=null) { ! m_sharedApplication.originalSendEvent(event); ! } ! } ! ! public function runModalForWindow (win:NSWindow, callb:Object, sel:String, docWin:NSWindow):Void { ! var sess:NSModalSession = beginModalSessionForWindow(win, m_sharedApplication, "modalWin", docWin); ! runModalSession(sess); ! m_modalCallback = callb; ! m_modalSelector = sel; ! } ! ! private function modalWin(ret:Number, lastrun:Boolean) { ! if(!lastrun && ret!=NSRunResponse.NSContinues) { ! endModalSession(m_modalSession); ! } ! var o = m_modalCallback; ! var s = m_modalSelector; ! o[s].call(o, ret); ! } ! ! public function stopModal() { ! stopModalWithCode(NSRunResponse.NSStopped); ! } ! ! //can be both NSRunResponse or NSAlertReturn ! public function stopModalWithCode(ret):Void { ! if(m_modalSession == null) { ! var e:NSException = NSException.exceptionWithNameReasonUserInfo ! ("NSInvalidArgumentException", "not in a modal session", null); ! TRACE(e); ! e.raise(); ! } ! m_modalSession.runState = ret; ! endModalSession(m_modalSession); ! } ! ! //note: can return null ! public function modalWindow():NSWindow { ! return m_modalSession.window; ! } ! ! //this function is not found in Cocoa ! public function runningModal():Boolean { ! return (m_modalSession==null) ? false : true; ! } ! //end--modal ! ! //sheets ! public function beginSheetModalForWindowModalDelegateDidEndSelectorContextInfo ! (sheet:NSWindow, docWin:NSWindow, delegate, sel:String, ctxt:Object):Void { ! m_sheetFlags = arguments; ! runModalForWindow(sheet, this, "sheetCallback", docWin); ! } ! ! private function sheetCallback(ret:Number) { ! if(ret==NSRunResponse.NSContinues) return; ! ! var args = m_sheetFlags; ! var sheet = args[0]; ! var delegate = args[2]; ! var sel = args[3]; ! var ctxt = args[4]; ! ! if(delegate.respondsToSelector(sel)) { ! delegate[sel].call(delegate, sheet, ret, ctxt); ! } ! } ! ! public function endSheet(sheet:NSWindow):Void { ! TRACE("end sheet") ! stopModal(); ! } ! ! public function endSheetReturnCode(sheet:NSWindow, returnCode:NSRunResponse):Void { ! stopModalWithCode(returnCode); ! } ! //end--sheets private function __windowWillClose(notification:NSNotification) { |
From: Tay R. C. <rc...@us...> - 2005-07-15 11:50:43
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10387/actionstep/org/actionstep Modified Files: NSObject.as Log Message: added respondsToSelector Index: NSObject.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSObject.as,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NSObject.as 28 Jun 2005 10:01:36 -0000 1.11 --- NSObject.as 15 Jul 2005 11:50:34 -0000 1.12 *************** *** 138,149 **** return NSObject(res); } ! ! public function copy() { ! var f = this["copyWithZone"]; ! if(f instanceof Function) { ! return f.call(this); ! } else { ! throw new Error("Class doesn't implement NSCopying"); ! } ! } } \ No newline at end of file --- 138,153 ---- return NSObject(res); } ! ! public function copy() { ! var f = this["copyWithZone"]; ! if(f instanceof Function) { ! return f.call(this); ! } else { ! throw new Error("Class doesn't implement NSCopying"); ! } ! } ! ! public function respondsToSelector(sel:String):Boolean { ! return hasOwnProperty(sel); ! } } \ No newline at end of file |
From: Tay R. C. <rc...@us...> - 2005-07-15 11:49:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/constants In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10117/actionstep/org/actionstep/constants Modified Files: NSRunResponse.as Log Message: Return values for modal loop runs Index: NSRunResponse.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/constants/NSRunResponse.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NSRunResponse.as 20 Jun 2005 02:15:48 -0000 1.1 --- NSRunResponse.as 15 Jul 2005 11:49:40 -0000 1.2 *************** *** 28,43 **** * POSSIBILITY OF SUCH DAMAGE. */ ! class org.actionstep.constants.NSRunResponse { ! // Modal run responses ! public static var ! NSRunStoppedResponse:NSRunResponse = new NSRunResponse(0), ! NSRunAbortedResponse:NSRunResponse = new NSRunResponse(1), ! NSRunContinuesResponse:NSRunResponse = new NSRunResponse(2); ! public var value:Number; ! private function NSRunResponse(num:Number) { ! value = num; } ! } \ No newline at end of file --- 28,41 ---- * POSSIBILITY OF SUCH DAMAGE. */ ! class org.actionstep.constants.NSRunResponse { ! public static var NSStopped:NSRunResponse = new NSRunResponse(-1000); ! public static var NSAborted:NSRunResponse = new NSRunResponse(-1001); ! public static var NSContinues:NSRunResponse = new NSRunResponse(-1002); ! public var value:Number; ! private function NSRunResponse(value:Number) { ! this.value = value; } ! } |
From: Tay R. C. <rc...@us...> - 2005-07-15 11:49:04
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/constants In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9760/actionstep/org/actionstep/constants Added Files: NSModalReturn.as Log Message: Modal return values --- NEW FILE: NSModalReturn.as --- /* * Copyright (c) 2005, InfoEther, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3) The name InfoEther, Inc. may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ //Modal Panel Return Values class org.actionstep.constants.NSModalReturn { public static var NSOK:NSModalReturn = new NSModalReturn(1); public static var NSCancel:NSModalReturn = new NSModalReturn(0); public var value:Number; private function NSModalReturn(value:Number) { this.value = value; } } |
From: Tay R. C. <rc...@us...> - 2005-07-15 11:48:33
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/constants In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9626/actionstep/org/actionstep/constants Added Files: NSAlertStyle.as Log Message: Alerting styles used by NSAlert --- NEW FILE: NSAlertStyle.as --- (This appears to be a binary file; contents omitted.) |
From: Tay R. C. <rc...@us...> - 2005-07-15 11:48:09
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/constants In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9534/actionstep/org/actionstep/constants Added Files: NSAlertReturn.as Log Message: Return values for NSAlert, ASAlertPanel, etc. --- NEW FILE: NSAlertReturn.as --- (This appears to be a binary file; contents omitted.) |
From: Richard K. <ric...@us...> - 2005-07-14 22:04:13
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28183 Modified Files: NSApplication.as Log Message: use makeKeyAndOrderFront and get rid of setKeyWindow and setMainWindow methods Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** NSApplication.as 14 Jul 2005 21:55:50 -0000 1.20 --- NSApplication.as 14 Jul 2005 22:04:03 -0000 1.21 *************** *** 169,174 **** try { if (event.type == NSEvent.NSLeftMouseDown) { ! m_currentEvent.window.orderFront(); ! setKeyWindow(m_currentEvent.window); } m_currentEvent.window.sendEvent(m_currentEvent); --- 169,173 ---- try { if (event.type == NSEvent.NSLeftMouseDown) { ! m_currentEvent.window.makeKeyAndOrderFront(); } m_currentEvent.window.sendEvent(m_currentEvent); *************** *** 441,455 **** } - public function setMainWindow(value:NSWindow) { - value.makeMainWindow(); - m_mainWindow = value; - } - public function setKeyWindow(value:NSWindow) { - value.makeKeyWindow(); - m_keyWindow = value; - } - - - // Setting the delegate --- 440,443 ---- |
From: Richard K. <ric...@us...> - 2005-07-14 21:56:51
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26645 Modified Files: ASEventMonitor.as Log Message: beginning of key events and change the way event times are set Index: ASEventMonitor.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASEventMonitor.as,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ASEventMonitor.as 29 Jun 2005 06:57:47 -0000 1.15 --- ASEventMonitor.as 14 Jul 2005 21:56:42 -0000 1.16 *************** *** 49,52 **** --- 49,56 ---- private var m_lastMouseDownEvent:NSEvent; + private var m_keyTracker:Object; + + private var m_timeOffset:Number; + public static function instance():ASEventMonitor { if (g_instance == null) { *************** *** 78,81 **** --- 82,86 ---- if (m_index == 1) m_index = 0; m_lastMouseDownTime = 0; + m_timeOffset = (new Date()).getTime() - getTimer(); } *************** *** 99,104 **** } ! private function trackKeyboardEvents() { ! //! Track keyboard events... } --- 104,141 ---- } ! public function trackKeyboardEvents() { ! if (m_keyTracker != null) { //Already tracking ! return; ! } ! var self = this; ! m_keyTracker = new Object(); ! m_keyTracker.onKeyDown = function() { ! self.keyDown(); ! } ! m_keyTracker.onKeyUp = function() { ! self.keyUp(); ! } ! Key.addListener(m_keyTracker); ! } ! ! private var m_lastKeyDown:Number; ! ! private function keyDown() { ! var event = NSEvent.keyEventWithType(NSEvent.NSKeyDown, new NSPoint(_root._xmouse, _root._ymouse), ! buildModifierFlags(), m_timeOffset+getTimer(), null /* window */, null /*contact*/, String.fromCharCode(Key.getAscii()), ! String.fromCharCode(Key.getAscii()), (m_lastKeyDown == Key.getCode()), Key.getCode()); ! m_lastKeyDown = Key.getCode(); ! m_app.sendEvent(event); ! } ! ! private function keyUp() { ! if (m_lastKeyDown == Key.getCode) { ! m_lastKeyDown = 0; ! } ! var event = NSEvent.keyEventWithType(NSEvent.NSKeyUp, new NSPoint(_root._xmouse, _root._ymouse), ! buildModifierFlags(), m_timeOffset+getTimer(), null /* window */, null /*contact*/, String.fromCharCode(Key.getAscii()), ! String.fromCharCode(Key.getAscii()), (m_lastKeyDown == Key.getCode()), Key.getCode()); ! m_lastKeyDown = Key.getCode(); ! m_app.sendEvent(event); } *************** *** 106,110 **** var modifierFlags = buildModifierFlags(); var event = NSEvent.otherEventWithType(NSEvent.NSPeriodic, new NSPoint(_root._xmouse, _root._ymouse), ! modifierFlags, (new Date()).getTime(), eval(m_mouseTrackingClip._dropTarget).view, null /* context*/, 0 /*subType */, null /*data1 */, null /*data 2*/); m_app.sendEvent(event); --- 143,147 ---- var modifierFlags = buildModifierFlags(); var event = NSEvent.otherEventWithType(NSEvent.NSPeriodic, new NSPoint(_root._xmouse, _root._ymouse), ! modifierFlags, m_timeOffset+getTimer(), eval(m_mouseTrackingClip._dropTarget).view, null /* context*/, 0 /*subType */, null /*data1 */, null /*data 2*/); m_app.sendEvent(event); *************** *** 131,135 **** m_lastMouseDownEvent = NSEvent.mouseEventWithType(NSEvent.NSLeftMouseDown, new NSPoint(x, y), ! modifierFlags, (new Date()).getTime(), eval(targetPath).view, null /* context */, m_eventCounter++, 1 /*click count*/, 0).memberwiseClone(); m_lastMouseDownTime = getTimer(); --- 168,172 ---- m_lastMouseDownEvent = NSEvent.mouseEventWithType(NSEvent.NSLeftMouseDown, new NSPoint(x, y), ! modifierFlags, m_timeOffset+getTimer(), eval(targetPath).view, null /* context */, m_eventCounter++, 1 /*click count*/, 0).memberwiseClone(); m_lastMouseDownTime = getTimer(); *************** *** 144,148 **** var event = NSEvent.mouseEventWithType(NSEvent.NSLeftMouseUp, new NSPoint(_root._xmouse, _root._ymouse), ! modifierFlags, (new Date()).getTime(), eval(targetPath).view, null /* context */, m_eventCounter++, 1 /*click count*/, 0); m_app.sendEvent(event); --- 181,185 ---- var event = NSEvent.mouseEventWithType(NSEvent.NSLeftMouseUp, new NSPoint(_root._xmouse, _root._ymouse), ! modifierFlags, m_timeOffset+getTimer(), eval(targetPath).view, null /* context */, m_eventCounter++, 1 /*click count*/, 0); m_app.sendEvent(event); *************** *** 158,162 **** if (m_currentMouseTargetPath != "") { event = NSEvent.enterExitEventType(NSEvent.NSMouseExited, new NSPoint(_root._xmouse, _root._ymouse), ! 0 /*modifierFlags:Number*/, (new Date()).getTime(), eval(m_currentMouseTargetPath).view, null /* context */, m_eventCounter++, 0/*trackingNumber:Number*/, null/*userData:Object*/); m_app.sendEvent(event); --- 195,199 ---- if (m_currentMouseTargetPath != "") { event = NSEvent.enterExitEventType(NSEvent.NSMouseExited, new NSPoint(_root._xmouse, _root._ymouse), ! buildModifierFlags() , m_timeOffset+getTimer(), eval(m_currentMouseTargetPath).view, null /* context */, m_eventCounter++, 0/*trackingNumber:Number*/, null/*userData:Object*/); m_app.sendEvent(event); *************** *** 165,169 **** if (m_currentMouseTargetPath != "") { event = NSEvent.enterExitEventType(NSEvent.NSMouseEntered, new NSPoint(_root._xmouse, _root._ymouse), ! 0 /*modifierFlags:Number*/, (new Date()).getTime(), eval(targetPath).view, null /* context */, m_eventCounter++, 0/*trackingNumber:Number*/, null/*userData:Object*/); m_app.sendEvent(event); --- 202,206 ---- if (m_currentMouseTargetPath != "") { event = NSEvent.enterExitEventType(NSEvent.NSMouseEntered, new NSPoint(_root._xmouse, _root._ymouse), ! buildModifierFlags() , m_timeOffset+getTimer(), eval(targetPath).view, null /* context */, m_eventCounter++, 0/*trackingNumber:Number*/, null/*userData:Object*/); m_app.sendEvent(event); *************** *** 171,175 **** } event = NSEvent.mouseEventWithType(NSEvent.NSMouseMoved, new NSPoint(_root._xmouse, _root._ymouse), ! 0 /*modifierFlags:Number*/, (new Date()).getTime(), eval(targetPath).view, null /* context */, m_eventCounter++, 0/*clickCount:Number*/, 0/*pressure:Number*/); m_app.sendEvent(event); --- 208,212 ---- } event = NSEvent.mouseEventWithType(NSEvent.NSMouseMoved, new NSPoint(_root._xmouse, _root._ymouse), ! buildModifierFlags(), m_timeOffset+getTimer(), eval(targetPath).view, null /* context */, m_eventCounter++, 0/*clickCount:Number*/, 0/*pressure:Number*/); m_app.sendEvent(event); |
From: Richard K. <ric...@us...> - 2005-07-14 21:56:02
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26411 Modified Files: NSApplication.as Log Message: key and main window now using notifications and start key event pump Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NSApplication.as 6 Jul 2005 19:02:56 -0000 1.19 --- NSApplication.as 14 Jul 2005 21:55:50 -0000 1.20 *************** *** 32,35 **** --- 32,36 ---- import org.actionstep.NSEvent; import org.actionstep.NSNotificationCenter; + import org.actionstep.NSNotification; import org.actionstep.NSResponder; import org.actionstep.NSPanel; *************** *** 89,96 **** public function init():NSApplication { m_notificationCenter = NSNotificationCenter.defaultCenter(); m_active = false; return this; } ! public function description():String { return "NSApplication"; --- 90,103 ---- public function init():NSApplication { m_notificationCenter = NSNotificationCenter.defaultCenter(); + m_notificationCenter.addObserverSelectorNameObject(this, "__windowWillClose", NSWindow.NSWindowWillCloseNotification, null); + m_notificationCenter.addObserverSelectorNameObject(this, "__windowDidBecomeKey", NSWindow.NSWindowDidBecomeKeyNotification, null); + m_notificationCenter.addObserverSelectorNameObject(this, "__windowDidBecomeMain", NSWindow.NSWindowDidBecomeMainNotification, null); + m_notificationCenter.addObserverSelectorNameObject(this, "__windowDidResignKey", NSWindow.NSWindowDidResignKeyNotification, null); + m_notificationCenter.addObserverSelectorNameObject(this, "__windowDidResignMain", NSWindow.NSWindowDidResignMainNotification, null); + m_active = false; return this; } ! public function description():String { return "NSApplication"; *************** *** 105,122 **** } - public function setKeyWindow(value:NSWindow) { - value.makeKeyWindow(); - m_keyWindow = value; - } - public function mainWindow():NSWindow { return m_mainWindow; } - public function setMainWindow(value:NSWindow) { - value.makeMainWindow(); - m_mainWindow = value; - } - public function windows():Array { return NSWindow.instances(); --- 112,119 ---- *************** *** 269,272 **** --- 266,270 ---- // Start tracking mouse events ASEventMonitor.instance().trackMouseEvents(); + ASEventMonitor.instance().trackKeyboardEvents(); //! What else should we do in run? m_active = true; *************** *** 410,413 **** --- 408,455 ---- return (m_modalSession==null) ? false : true; } + + + private function __windowWillClose(notification:NSNotification) { + } + + private function __windowDidBecomeKey(notification:NSNotification) { + if (m_keyWindow == null && (notification.object instanceof NSWindow)) { + m_keyWindow = NSWindow(notification.object); + } else { + TRACE("Non-NSWindow tried to become key: "+notification.object); + } + } + + private function __windowDidBecomeMain(notification:NSNotification) { + if (m_mainWindow == null && (notification.object instanceof NSWindow)) { + m_mainWindow = NSWindow(notification.object); + } else { + TRACE("Non-NSWindow tried to become main: "+notification.object); + } + } + + private function __windowDidResignKey(notification:NSNotification) { + if (m_keyWindow == notification.object) { + m_keyWindow = null; + } + } + + private function __windowDidResignMain(notification:NSNotification) { + if (m_mainWindow == notification.object) { + m_mainWindow = null; + } + } + + public function setMainWindow(value:NSWindow) { + value.makeMainWindow(); + m_mainWindow = value; + } + public function setKeyWindow(value:NSWindow) { + value.makeKeyWindow(); + m_keyWindow = value; + } + + + // Setting the delegate |
From: Richard K. <ric...@us...> - 2005-07-14 21:53:50
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25856 Modified Files: NSWindow.as Log Message: key and main window now using notifications Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** NSWindow.as 13 Jul 2005 15:49:53 -0000 1.20 --- NSWindow.as 14 Jul 2005 21:53:42 -0000 1.21 *************** *** 76,79 **** --- 76,80 ---- // Notifications + public static var NSWindowWillCloseNotification = ASUtils.intern("NSWindowWillCloseNotification"); public static var NSWindowDidBecomeKeyNotification = ASUtils.intern("NSWindowDidBecomeKeyNotification"); public static var NSWindowDidBecomeMainNotification = ASUtils.intern("NSWindowDidBecomeMainNotification"); *************** *** 124,132 **** //if(m_keyWin==null) { //m_keyWin = x; ! m_app.setKeyWindow(this); //} //if(m_mainWin==null) { //m_mainWin = x; ! m_app.setMainWindow(this); //} } --- 125,133 ---- //if(m_keyWin==null) { //m_keyWin = x; ! //m_app.setKeyWindow(this); //} //if(m_mainWin==null) { //m_mainWin = x; ! //m_app.setMainWindow(this); //} } *************** *** 169,172 **** --- 170,175 ---- m_rootView = (new ASRootWindowView()).initWithFrameWindow(m_frameRect, this); setContentView((new NSView()).initWithFrame(NSRect.withOriginSize(convertScreenToBase(m_contentRect.origin), m_contentRect.size))); + makeKeyWindow(); + makeMainWindow(); return this; } *************** *** 383,387 **** if (!m_isMain) { m_isMain = true; ! m_notificationCenter.postNotificationWithNameObject(NSWindowDidBecomeKeyNotification, this); } } --- 386,390 ---- if (!m_isMain) { m_isMain = true; ! m_notificationCenter.postNotificationWithNameObject(NSWindowDidBecomeMainNotification, this); } } |
From: Tom C. <tom...@us...> - 2005-07-14 19:33:28
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24207 Modified Files: NSDictionary.as Log Message: Reverting NSDictionary back to 1.5 Index: NSDictionary.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSDictionary.as,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NSDictionary.as 14 Jul 2005 19:01:17 -0000 1.7 --- NSDictionary.as 14 Jul 2005 19:33:20 -0000 1.8 *************** *** 177,181 **** */ public function initWithObjectsAndKeys():NSDictionary ! { var args:Array = arguments; var obj:Object; --- 177,184 ---- */ public function initWithObjectsAndKeys():NSDictionary ! { ! TRACE(arguments); ! TRACE(arguments.length); ! var args:Array = arguments; var obj:Object; *************** *** 580,584 **** public static function dictionaryWithObjectsAndKeys():NSDictionary { ! return (new NSDictionary()).initWithObjectsAndKeys.apply(arguments); } } --- 583,590 ---- public static function dictionaryWithObjectsAndKeys():NSDictionary { ! var dict:NSDictionary = new NSDictionary(); ! dict.initWithObjectsAndKeys.apply(dict, arguments); ! ! return dict; } } |
From: Tom C. <tom...@us...> - 2005-07-14 19:01:29
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17161/src/org/actionstep Modified Files: NSDictionary.as Log Message: Hm, I think this was leftover from some previous code... if not, please let me know and I'll revert this checkin Index: NSDictionary.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSDictionary.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NSDictionary.as 14 Jul 2005 13:36:51 -0000 1.6 --- NSDictionary.as 14 Jul 2005 19:01:17 -0000 1.7 *************** *** 580,584 **** public static function dictionaryWithObjectsAndKeys():NSDictionary { ! return (new NSDictionary()).initWithObjectsAndKeys.apply(dict, arguments); } } --- 580,584 ---- public static function dictionaryWithObjectsAndKeys():NSDictionary { ! return (new NSDictionary()).initWithObjectsAndKeys.apply(arguments); } } |
From: Scott H. <sco...@us...> - 2005-07-14 13:37:04
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4822/src/org/actionstep Modified Files: NSDictionary.as Log Message: removed TRACEs removed local variable use in dictionaryWithObjectsAndKeys Index: NSDictionary.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSDictionary.as,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NSDictionary.as 14 Jul 2005 03:00:39 -0000 1.5 --- NSDictionary.as 14 Jul 2005 13:36:51 -0000 1.6 *************** *** 177,184 **** */ public function initWithObjectsAndKeys():NSDictionary ! { ! TRACE(arguments); ! TRACE(arguments.length); ! var args:Array = arguments; var obj:Object; --- 177,181 ---- */ public function initWithObjectsAndKeys():NSDictionary ! { var args:Array = arguments; var obj:Object; *************** *** 583,590 **** public static function dictionaryWithObjectsAndKeys():NSDictionary { ! var dict:NSDictionary = new NSDictionary(); ! dict.initWithObjectsAndKeys.apply(dict, arguments); ! ! return dict; } } --- 580,584 ---- public static function dictionaryWithObjectsAndKeys():NSDictionary { ! return (new NSDictionary()).initWithObjectsAndKeys.apply(dict, arguments); } } |
From: Scott H. <sco...@us...> - 2005-07-14 03:00:48
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24853/src/org/actionstep Modified Files: NSDictionary.as Log Message: Fixed bug in dictionaryWithObjectsAndKeys Implemented description() method Index: NSDictionary.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSDictionary.as,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NSDictionary.as 10 Jun 2005 02:56:17 -0000 1.4 --- NSDictionary.as 14 Jul 2005 03:00:39 -0000 1.5 *************** *** 178,181 **** --- 178,184 ---- public function initWithObjectsAndKeys():NSDictionary { + TRACE(arguments); + TRACE(arguments.length); + var args:Array = arguments; var obj:Object; *************** *** 246,250 **** public function description():String { ! return "NSDictionary"; } --- 249,265 ---- public function description():String { ! var ret:String = "NSDictionary("; ! ! for (var key:String in m_dict) ! { ! ret += "\"" + key + "\"=>" + m_dict[key].toString() + ","; ! } ! ! if (count() > 0) ! ret = ret.substr(0, ret.length -1); ! ! ret += ")"; ! ! return ret; } *************** *** 568,572 **** public static function dictionaryWithObjectsAndKeys():NSDictionary { ! return (new NSDictionary()).initWithObjectsAndKeys(arguments); } } --- 583,590 ---- public static function dictionaryWithObjectsAndKeys():NSDictionary { ! var dict:NSDictionary = new NSDictionary(); ! dict.initWithObjectsAndKeys.apply(dict, arguments); ! ! return dict; } } |
From: Richard K. <ric...@us...> - 2005-07-13 15:50:02
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12900 Modified Files: NSWindow.as NSView.as ASRootWindowView.as Log Message: change release to use removeFromSuperview for root windows Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ASRootWindowView.as 8 Jul 2005 01:36:54 -0000 1.11 --- ASRootWindowView.as 13 Jul 2005 15:49:53 -0000 1.12 *************** *** 138,141 **** --- 138,145 ---- } } + + public function removeFromSuperview() { + removeMovieClips(); + } private function updateFrameMovieClipSize():Void { Index: NSView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSView.as,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** NSView.as 13 Jul 2005 09:49:18 -0000 1.25 --- NSView.as 13 Jul 2005 15:49:53 -0000 1.26 *************** *** 235,238 **** --- 235,239 ---- m_subviews[i].removeMovieClips(); } + release(); m_mcFrame.removeMovieClip(); m_mcFrame = null; *************** *** 1048,1059 **** } ! public function release():Boolean { ! var x:Array = m_subviews, result:Boolean = true; ! for(var i in x) { ! result = result && x[i].release(); ! } ! m_mcFrame.removeMovieClip(); ! m_mcBounds.removeMovieClip(); ! return (m_mcFrame==m_mcBounds==null && result) ? true : false; } } \ No newline at end of file --- 1049,1054 ---- } ! public function release() { ! // Override } } \ No newline at end of file Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NSWindow.as 13 Jul 2005 09:51:48 -0000 1.19 --- NSWindow.as 13 Jul 2005 15:49:53 -0000 1.20 *************** *** 544,553 **** public function release():Boolean { ! var x = m_rootView.release(); ! var y = m_contentView.release(); ! ! if(x==y==true) return true; ! ! return false; } --- 544,549 ---- public function release():Boolean { ! m_rootView.removeFromSuperview(); ! return true; } |
From: Tay R. C. <rc...@us...> - 2005-07-13 09:52:02
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18846/actionstep/org/actionstep Modified Files: NSWindow.as Log Message: added - release() for cleanup Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NSWindow.as 7 Jul 2005 05:14:42 -0000 1.18 --- NSWindow.as 13 Jul 2005 09:51:48 -0000 1.19 *************** *** 542,545 **** --- 542,554 ---- return m_title; } + + public function release():Boolean { + var x = m_rootView.release(); + var y = m_contentView.release(); + + if(x==y==true) return true; + + return false; + } // Field editor |
From: Tay R. C. <rc...@us...> - 2005-07-13 09:49:29
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17851/actionstep/org/actionstep Modified Files: NSView.as Log Message: added - release() for cleanup Index: NSView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSView.as,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** NSView.as 11 Jul 2005 19:01:09 -0000 1.24 --- NSView.as 13 Jul 2005 09:49:18 -0000 1.25 *************** *** 1047,1050 **** return result; } ! } \ No newline at end of file --- 1047,1059 ---- return result; } ! ! public function release():Boolean { ! var x:Array = m_subviews, result:Boolean = true; ! for(var i in x) { ! result = result && x[i].release(); ! } ! m_mcFrame.removeMovieClip(); ! m_mcBounds.removeMovieClip(); ! return (m_mcFrame==m_mcBounds==null && result) ? true : false; ! } } \ No newline at end of file |
From: Richard K. <ric...@us...> - 2005-07-11 19:14:10
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26130 Modified Files: NSTabView.as Log Message: reshape child if tabview reshapes Index: NSTabView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSTabView.as,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NSTabView.as 1 Jun 2005 03:32:41 -0000 1.7 --- NSTabView.as 11 Jul 2005 19:13:55 -0000 1.8 *************** *** 145,148 **** --- 145,158 ---- } + public function setFrame(rect:NSRect) { + super.setFrame(rect); + m_selected.view().setFrame(contentRect()); + } + + public function setFrameSize(size:NSSize) { + super.setFrameSize(size); + m_selected.view().setFrame(contentRect()); + } + public function selectTabViewItem(item:NSTabViewItem) { if (m_delegate != null) { |
From: U5eR <u5...@us...> - 2005-07-11 19:01:31
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20379/src/org/actionstep Modified Files: NSView.as Log Message: fixed bug where subviews' movie clips weren't being removed correctly. Index: NSView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSView.as,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NSView.as 24 Jun 2005 02:19:41 -0000 1.23 --- NSView.as 11 Jul 2005 19:01:09 -0000 1.24 *************** *** 156,159 **** --- 156,164 ---- public function createMovieClips():Void { + if (m_mcFrame != null) + { + //return if already created + return; + } try { m_mcFrame = createFrameMovieClip(); *************** *** 335,341 **** var i; ! for(i=0;i<superview.subviews.length;i++) { ! if (superview.subviews[i] == this) { ! superview.subviews.splice(i,1); break; } --- 340,347 ---- var i; ! var parentSubviews = superview.subviews(); ! for(i=0;i<parentSubviews.length;i++) { ! if (parentSubviews[i] == this) { ! parentSubviews.splice(i,1); break; } *************** *** 368,374 **** var i; ! for(i=0;i<superview.subviews.length;i++) { ! if (superview.subviews[i] == this) { ! superview.subviews.splice(i,1); break; } --- 374,381 ---- var i; ! var parentSubviews = superview.subviews(); ! for(i=0;i<parentSubviews.length;i++) { ! if (parentSubviews[i] == this) { ! parentSubviews.splice(i,1); break; } |
From: Richard K. <ric...@us...> - 2005-07-11 04:23:57
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23614 Modified Files: ASList.as Log Message: update background on refresh Index: ASList.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASList.as,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ASList.as 11 Jul 2005 02:44:27 -0000 1.7 --- ASList.as 11 Jul 2005 04:23:39 -0000 1.8 *************** *** 240,243 **** --- 240,244 ---- public function refresh():Void { m_listView.computeHeight(); + m_listView.setNeedsDisplay(true); } |
From: Richard K. <ric...@us...> - 2005-07-11 03:33:06
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31320 Modified Files: NSTextFieldCell.as Log Message: fix text colors Index: NSTextFieldCell.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSTextFieldCell.as,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NSTextFieldCell.as 17 Jun 2005 22:15:34 -0000 1.16 --- NSTextFieldCell.as 11 Jul 2005 03:32:53 -0000 1.17 *************** *** 63,66 **** --- 63,67 ---- m_textField = null; m_textFormat = null; + m_textColor = NSColor.systemFontColor(); m_actionMask = NSEvent.NSKeyUpMask | NSEvent.NSKeyDownMask; } *************** *** 97,100 **** --- 98,102 ---- m_textField = m_controlView.createBoundsTextField(); m_textFormat = m_font.textFormatWithAlignment(m_alignment); + m_textFormat.color = m_textColor.value; m_textField.self = this; m_textField.text = stringValue(); *************** *** 137,140 **** --- 139,143 ---- public function setTextColor(value:NSColor) { m_textColor = value; + m_textFormat.color = m_textColor.value; if (m_controlView && (m_controlView instanceof NSControl)) { NSControl(m_controlView).updateCell(this); *************** *** 149,152 **** --- 152,156 ---- super.setFont(font); m_textFormat = m_font.textFormat(); + m_textFormat.color = m_textColor.value; if (m_textField != null) { m_textField.embedFonts = m_font.isEmbedded(); |
From: Richard K. <ric...@us...> - 2005-07-11 03:32:27
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31020 Modified Files: ASTheme.as Log Message: adjust by one pixel for scroller thumb lines Index: ASTheme.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTheme.as,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ASTheme.as 22 Jun 2005 05:12:31 -0000 1.16 --- ASTheme.as 11 Jul 2005 03:32:18 -0000 1.17 *************** *** 279,285 **** ASDraw.outlineRectWithRect( mc, rect, drawScroller_outlineColors); if (rect.size.width > rect.size.height) { ! var x1 = rect.origin.x + rect.size.width/2; ! var x2 = x1 + 10; ! x1 -= 10; var y1 = rect.origin.y + 3; var y2 = rect.origin.y + rect.size.height - 4; --- 279,285 ---- ASDraw.outlineRectWithRect( mc, rect, drawScroller_outlineColors); if (rect.size.width > rect.size.height) { ! var x1 = rect.origin.x + rect.size.width/2-1; ! var x2 = x1 + 6; ! x1 -= 6; var y1 = rect.origin.y + 3; var y2 = rect.origin.y + rect.size.height - 4; *************** *** 294,300 **** } } else { ! var y1 = rect.origin.y + rect.size.height/2; ! var y2 = y1 + 10; ! y1 -= 10; var x1 = rect.origin.x + 3; var x2 = rect.origin.x + rect.size.width - 4; --- 294,300 ---- } } else { ! var y1 = rect.origin.y + rect.size.height/2-1; ! var y2 = y1 + 6; ! y1 -= 6; var x1 = rect.origin.x + 3; var x2 = rect.origin.x + rect.size.width - 4; |
From: Richard K. <ric...@us...> - 2005-07-11 02:44:37
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5096 Modified Files: ASList.as ASListItem.as ASListView.as Log Message: added ability to set the visibility of list items Index: ASListItem.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASListItem.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASListItem.as 20 Jun 2005 04:30:20 -0000 1.3 --- ASListItem.as 11 Jul 2005 02:44:27 -0000 1.4 *************** *** 37,40 **** --- 37,41 ---- private var m_selected:Boolean private var m_image:NSImage + private var m_visible:Boolean; public static function listItemWithLabelData(label:String, data:Object) { *************** *** 44,47 **** --- 45,49 ---- public function ASListItem() { m_selected = false; + m_visible = true; } *************** *** 83,85 **** --- 85,95 ---- m_label = value; } + + public function setVisible(value:Boolean) { + m_visible = value; + } + + public function isVisible():Boolean { + return m_visible; + } } \ No newline at end of file Index: ASListView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASListView.as,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ASListView.as 9 Jul 2005 04:32:41 -0000 1.7 --- ASListView.as 11 Jul 2005 02:44:27 -0000 1.8 *************** *** 150,154 **** } m_text = "" ! var items:Array = m_list.items().internalList(); for(var i = 0;i < items.length;i++) { if (items[i].isSelected()) { --- 150,154 ---- } m_text = "" ! var items:Array = m_list.visibleItems(); for(var i = 0;i < items.length;i++) { if (items[i].isSelected()) { *************** *** 184,188 **** private function drawSelectedItems(rect:NSRect) { ! var items:Array = m_list.items().internalList(); if (items.length > 0) { var height = (m_textField.textHeight+1)/items.length; --- 184,188 ---- private function drawSelectedItems(rect:NSRect) { ! var items:Array = m_list.visibleItems(); if (items.length > 0) { var height = (m_textField.textHeight+1)/items.length; *************** *** 206,215 **** var location:NSPoint = event.mouseLocation; location = convertPointFromView(location); ! var height = (m_textField.textHeight+1)/m_list.numberOfItems(); selectItemAtIndex(Math.floor(location.y/height)); } public function selectItemAtIndex(index:Number) { ! var items:Array = m_list.items().internalList(); if (m_multipleSelection) { } else { --- 206,215 ---- var location:NSPoint = event.mouseLocation; location = convertPointFromView(location); ! var height = (m_textField.textHeight+1)/m_list.numberOfVisibleItems(); selectItemAtIndex(Math.floor(location.y/height)); } public function selectItemAtIndex(index:Number) { ! var items:Array = m_list.visibleItems(); if (m_multipleSelection) { } else { Index: ASList.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASList.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ASList.as 10 Jul 2005 04:14:18 -0000 1.6 --- ASList.as 11 Jul 2005 02:44:27 -0000 1.7 *************** *** 213,217 **** return m_internalList; } ! /** * Removes all the items from the list. --- 213,217 ---- return m_internalList; } ! /** * Removes all the items from the list. *************** *** 237,240 **** --- 237,244 ---- m_listView.computeHeight(); } + + public function refresh():Void { + m_listView.computeHeight(); + } /** *************** *** 244,247 **** --- 248,255 ---- return m_internalList.count(); } + + public function numberOfVisibleItems():Number { + return visibleItems().length; + } public function selectedItem():ASListItem { *************** *** 272,275 **** --- 280,305 ---- } + public function visibleItems():Array { + var result:Array = new Array(); + var items:Array = m_internalList.internalList(); + for(var i = 0;i < items.length;i++) { + if (items[i].isVisible()) { + result.push(items[i]); + } + } + return result; + } + + public function invisibleItems():Array { + var result:Array = new Array(); + var items:Array = m_internalList.internalList(); + for(var i = 0;i < items.length;i++) { + if (!items[i].isVisible()) { + result.push(items[i]); + } + } + return result; + } + public function deselectAllItems() { var updated:Boolean = false; |