?? preferredsizetest.xml
字號:
<application> <window caption="PreferredSize Test" width="300" height="200"/> <resources> <script><![CDATA[function PreferredSizeTest() { var win = application.getWindow(); var ta = new BiTextArea; var cb = new BiCheckBox("Word Wrap", true); var l = new BiLabel; var b = new BiButton("Windows Pref Size"); var fsb = new BiLabel(); // fake status bar this.l = l; this.ta = ta; this.fsb = fsb; win.add(ta); win.add(cb); win.add(l); win.add(b); win.add(fsb); ta.setLocation(5,5); ta.setRight(5); ta.setHeight(50); cb.setLocation(5, 60); cb.setRight(5); fsb.setBorder(new BiBorder(1, "inset")); fsb.setLeft(0); fsb.setRight(0); fsb.setBottom(0); b.setRight(5); b.setBottom(fsb.getBottom() + fsb.getHeight() + 5); l.setBackColor("ThreeDShadow"); l.setForeColor("ThreeDHighlight"); l.setLocation(5, cb.getTop() + cb.getHeight() + 5); l.setRight(5); l.setBottom(b.getBottom() + b.getHeight() + 5); l.setWrap(true); ta.addEventListener("textchanged", function () { l.setText(ta.getText()); this.setStatus(); }, this); cb.addEventListener("change", function () { l.setWrap(cb.getChecked()); ta.setWrap( cb.getChecked() ) this.setStatus(); alert( cb.getChecked() ); }, this); win.addEventListener("resize", this.setStatus, this); b.addEventListener("click", function () { alert(win.getPreferredWidth() + ", " + win.getPreferredHeight()); }); ta.setText("text area"); //win.pack();}PreferredSizeTest.prototype.setStatus = function () { this.fsb.setText( "label: (" + this.l.getPreferredWidth() + ", " + this.l.getPreferredHeight() + ")" + ", text area: (" + this.ta.getPreferredWidth() + ", " + this.ta.getPreferredHeight() + ")" );};PreferredSizeTest.main = function () { new PreferredSizeTest; }; ]]></script> </resources></application>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -