📄 buttontest.xml
字号:
<?xml version="1.0" encoding="UTF-8"?><!-- This is a pretty basic test application but it test a few important features 1. Test PNG support 2. Tests grayscaled PNG 3. Tests windows size--><Application> <Window caption="Button Test" width="205" height="104" centered="true" resizable="false" fullScreen="false"> </Window> <Resources> <Script><![CDATA[function ButtonTest() { var win = application.getWindow(); var btn = new BiButton("Hello World"); btn.setIcon(new BiImage("images/folder.open.32.png")); btn.setIconPosition("top"); //btn.setEnabled(false); //btn.setPadding(0); //btn.setWidth(50); btn.setLocation(10, 10); //btn.setSize(52,52); win.add(btn); var btn2 = new BiButton("Hello World"); btn2.setIcon(new BiImage("images/folder.open.32.png")); btn2.setIconPosition("top"); btn2.setEnabled(false); //btn2.setPadding(0); //btn2.setWidth(50); btn2.setLocation(btn.getLeft() + btn.getWidth() + 5 , 10); //btn2.setSize(52,52); win.add(btn2); this._button = btn; this._button2 = btn2; btn.addEventListener("action", this.onButtonClick, this); btn2.addEventListener("action", this.onButtonClick, this); btn.getIcon().addEventListener("load", this.setWindowSize, this); btn2.getIcon().addEventListener("load", this.setWindowSize, this);}ButtonTest.prototype.onButtonClick = function (e) { alert("Window width: " + application.getWindow().getWidth() + "\nWindow height: " + application.getWindow().getHeight());};ButtonTest.prototype.setWindowSize = function () { var win = application.getWindow(); win.setSize( this._button2.getLeft() + this._button2.getWidth() + 10 + win.getInsetLeft() + win.getInsetRight(), this._button.getTop() + this._button.getHeight() + 10 + win.getInsetTop() + win.getInsetBottom() );};ButtonTest.main = function () { new ButtonTest;}; ]]></Script> </Resources></Application>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -