Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1410/test
Added Files:
ASTestKeyEvents.as
Log Message:
test of key/tab order
--- NEW FILE: ASTestKeyEvents.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.ASTestKeyEvents {
public static function test() {
var window1;
var window2;
var view1;
var view2;
var textField1;
var textField2;
var button:NSButton;
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));
textField1 = (new NSTextField()).initWithFrame(new NSRect(10,20,120,30));
textField2 = (new NSTextField()).initWithFrame(new NSRect(10,60,120,30));
button = (new NSButton()).initWithFrame(new NSRect(10,100,70,30));
button.setTitle("Submit");
textField1.setNextKeyView(textField2);
textField2.setNextKeyView(button);
button.setNextKeyView(textField1);
view1.addSubview(textField1);
view1.addSubview(textField2);
view1.addSubview(button);
window1.setContentView(view1);
window1.setInitialFirstResponder(textField1);
window2.setContentView(view2);
app.run();
}
}
|