📄 dialogtest2.xml
字号:
<?xml version="1.0" encoding="UTF-8"?><!-- This tests the built in option pane dialogs--><Application> <Window caption="Dialog Test" width="500" height="500"/> <Resources> <Script><![CDATA[function DialogTest2() { var win = application.getWindow(); var btn = new BiButton("Message Dialog"); btn.setLocation(5, 5); win.add(btn); var btn2 = new BiButton("Option Dialog"); btn2.setLocation(5, 34); win.add(btn2); var btn3 = new BiButton("Confirm Dialog"); btn3.setLocation(5, 63); win.add(btn3); var btn4 = new BiButton("Input Dialog"); btn4.setLocation(5, 92); win.add(btn4); btn.addEventListener("action", function (e) { // create dialog var dialog = BiOptionPane.createMessageDialog("Hello World"); // end dialog creation dialog.addEventListener("dialogresult", this.onDialogResult, this); dialog.setVisible(true); }, this); btn2.addEventListener("action", function (e) { // create dialog var dialog = BiOptionPane.createOptionDialog("Please select a color", "Option Dialog Test", "question", null, null, ["Red", "Green", "Blue"], "Blue"); // end dialog creation dialog.addEventListener("dialogresult", this.onDialogResult, this); dialog.setVisible(true); }, this); btn3.addEventListener("action", function (e) { // create dialog var dialog = BiOptionPane.createConfirmDialog("Are you sure?", "Confirm Dialog Test"); // end dialog creation dialog.addEventListener("dialogresult", this.onDialogResult, this); dialog.setVisible(true); }, this); btn4.addEventListener("action", function (e) { // create dialog var dialog = BiOptionPane.createInputDialog("Please enter your name", "Input Dialog Test", null,null, "Erik"); // end dialog creation dialog.addEventListener("dialogresult", this.onDialogResult, this); dialog.setVisible(true); }, this);}function alert(s) { var dialog = BiOptionPane.createMessageDialog(s, "Alert", "warning"); dialog.setVisible(true);}DialogTest2.prototype.onDialogResult = function (e) { alert("dialogResult: " + e.getTarget().getDialogResult());};DialogTest2.main = function () { new DialogTest2; }; ]]></Script> </Resources></Application>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -