From: Richard K. <ric...@us...> - 2005-05-22 03:49:15
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18977/test Modified Files: ASTestTabView.as Added Files: ASTestControls.as ASTestMain.as ASTestRenderImage.as Log Message: removed ActionStep.as and added test/ASTestMain in its place Index: ASTestTabView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestTabView.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASTestTabView.as 15 May 2005 18:39:05 -0000 1.3 --- ASTestTabView.as 22 May 2005 03:49:06 -0000 1.4 *************** *** 39,43 **** // tabView.setTabViewType(org.actionstep.constants.NSTabViewType.NSNoTabsNoBorder); ! // tabView.setTabViewType(org.actionstep.constants.NSTabViewType.NSNoTabsLineBorder); var tabItem1:NSTabViewItem = (new NSTabViewItem()).initWithIdentifier(1); --- 39,43 ---- // tabView.setTabViewType(org.actionstep.constants.NSTabViewType.NSNoTabsNoBorder); ! //tabView.setTabViewType(org.actionstep.constants.NSTabViewType.NSNoTabsLineBorder); var tabItem1:NSTabViewItem = (new NSTabViewItem()).initWithIdentifier(1); --- NEW FILE: ASTestControls.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.ASTestControls { public static function test() { var triggerButton; var actionButton; var window1; var window2; var view1; var view2; var textField; var textField2; var box:NSBox; var target = new Object(); target.trigger = function(button) { TRACE("Bam"); } target.move = function(button) { if (view1.window() == window1) { window2.setContentView(view1); //window1.setContentView(view2); } else { window1.setContentView(view1); //window2.setContentView(view2); } } target.bam = function(editfield) { TRACE(editfield.stringValue()); } var app = NSApplication.sharedApplication(); window1 = (new NSWindow()).initWithContentRect(new NSRect(0,0,250,500)); window2 = (new NSWindow()).initWithContentRect(new NSRect(251,0,250,500)); view1 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,500)); view2 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,500)); //box = (new NSBox()).initWithFrame(new NSRect(10,10,160,100)); //box.setTitlePosition(NSTitlePosition.NSAboveTop); //box.setTitle("button"); triggerButton = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); triggerButton.setTitle("Draw"); triggerButton.setContinuous(true); triggerButton.setPeriodicDelayInterval(.3, .5); triggerButton.setBezelStyle(NSBezelStyle.NSShadowlessSquareBezelStyle); actionButton = (new NSButton()).initWithFrame(new NSRect(10,120,70,30)); actionButton.setTitle("Switch"); textField = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); textField2 = (new NSTextField()).initWithFrame(new NSRect(10,200,120,30)); view1.addSubview(box); //box.setContentView(triggerButton); view1.addSubview(triggerButton); view1.addSubview(actionButton); view1.addSubview(textField); view1.addSubview(textField2); triggerButton.setTarget(target); triggerButton.setAction("trigger"); actionButton.setTarget(target); actionButton.setAction("move"); window1.setContentView(view1); window2.setContentView(view2); app.run(); } public static function test_images() { var app = NSApplication.sharedApplication(); var window1 = (new NSWindow()).initWithContentRect(new NSRect(0,0,500,500)); var imageView = new org.actionstep.test.ASTestImageView(); imageView.initWithFrameImage(new NSRect(0,0,500,500), "NSHighlightedScrollerDownArrow"); window1.setContentView(imageView); app.run(); } } --- NEW FILE: ASTestMain.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.ASDebugger; import org.actionstep.test.*; class org.actionstep.test.ASTestMain { public static function main() { Stage.align="LT"; Stage.scaleMode="noScale"; ASDebugger.setLevel(ASDebugger.INFO); try { ASTestScrollers.test(); } catch (e:Error) { TRACE(e.message); } } } --- NEW FILE: ASTestRenderImage.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.ASTestRenderImage { public static function test() { var app = NSApplication.sharedApplication(); var window1 = (new NSWindow()).initWithContentRect(new NSRect(0,0,500,500)); var imageView = new org.actionstep.test.ASTestImageView(); imageView.initWithFrameImage(new NSRect(0,0,500,500), "NSHighlightedScrollerDownArrow"); window1.setContentView(imageView); app.run(); } } |