📄 defaultbuttontest.xml
字号:
<?xml version="1.0"?><!-- This one tests the support for default button support for BiApplicationWindow Pressing ESC should trigger the action on the cancelButton for the window Pressing ENTER should trigger the action on the acceptButton for the window--><Application> <Window caption="Default Button Test" width="400" height="470" centered="true"/> <Resources> <Script><![CDATA[function DefaultButtonTest() { var win = application.getWindow(); var okButton = new BiButton("OK"); var cancelButton = new BiButton("Cancel"); var applyButton = new BiButton("Apply"); win.add(okButton); win.add(cancelButton); win.add(applyButton); applyButton.setEnabled(false); applyButton.setRight(5); applyButton.setBottom(5); applyButton.setWidth(75); cancelButton.setRight(applyButton.getRight() + applyButton.getWidth() + 5); cancelButton.setBottom(5); cancelButton.setWidth(75); okButton.setRight(cancelButton.getRight() + cancelButton.getWidth() + 5); okButton.setBottom(5); okButton.setWidth(75); // event listeners okButton.addEventListener("action", this.onAction, this); cancelButton.addEventListener("action", this.onAction, this); applyButton.addEventListener("action", this.onAction, this); okButton._element.setAttribute("type", "submit"); win.setAcceptButton(okButton); win.setCancelButton(cancelButton); var textField = new BiTextField("Text field"); textField.setLocation(5, 5); textField.setRight(5); win.add(textField); var textArea = new BiTextArea("Text area"); textArea.setLocation(5, textField.getTop() + textField.getHeight() + 5); textArea.setRight(5); win.add(textArea);}DefaultButtonTest.prototype.onAction = function (e) { alert(e.getTarget().getText());};DefaultButtonTest.main = function () { new DefaultButtonTest(); }; ]]></Script> </Resources></Application>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -