?? focustest.xml
字號:
<?xml version="1.0"?><!-- This tests the focusin, focusout, focus and bour events--><application> <window caption="Focus Test" width="300" height="500"/> <resources> <script><![CDATA[function FocusTest() { var win = application.getWindow(); var tf = new BiTextField; var pf = new BiPasswordField; var out = new BiLabel; var blurButton = new BiButton("Blur"); //tf.setHeight( 22 ) //pf.setHeight( 22 ) //tf.setTabIndex( 1 ); //pf.setTabIndex( 1 ); blurButton.setTabIndex(-1); blurButton.setHideFocus( true ); out.setBorder(new BiBorder(1, "solid", "ThreeDDarkShadow")); out.setBackColor("window"); out.setOverflow("auto"); out.setPadding(2); out.setTabIndex(1); //out.setCanSelect(true); win.add(tf); win.add(pf); win.add(out); win.add(blurButton); tf.setLocation(5, 5); tf.setRight(5); pf.setLocation(5, tf.getTop() + tf.getHeight() + 5); pf.setRight(blurButton.getWidth() + 10); blurButton.setTop(tf.getTop() + tf.getHeight() + 5); blurButton.setRight(5) out.setLocation(5, pf.getTop() +pf.getHeight() + 5); out.setRight(5); out.setBottom(5); tf.setText("text"); pf.setText("password"); tf.addEventListener("focus", this.onfocusevent, this); tf.addEventListener("blur", this.onfocusevent, this); tf.addEventListener("focusin", this.onfocusevent, this); tf.addEventListener("focusout", this.onfocusevent, this); pf.addEventListener("focus", this.onfocusevent, this); pf.addEventListener("blur", this.onfocusevent, this); pf.addEventListener("focusin", this.onfocusevent, this); pf.addEventListener("focusout", this.onfocusevent, this); blurButton.addEventListener("action", function (e) { pf.setFocused(false); }); this.out = out;/* var m = new BiMenu; var mi = new BiMenuItem("Clear"); m.add(mi); mi.addEventListener("action", function (e) { out.setText(""); }); out.setContextMenu(m);*/}FocusTest.prototype.onfocusevent = function (e) { var s = "type: <b>" + e.getType() + "</b><br>" + "target: " + e.getTarget() + "<br>" + "relatedTarget: " + e.getRelatedTarget() + "<hr>"; this.out.setHtml(this.out.getHtml() + s); this.out.setScrollTop(9999999);};FocusTest.main = function () { new FocusTest; }; ]]></script> </resources></application>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -