?? richedittest.xml
字號:
<?xml version="1.0"?><application> <window caption="Rich Edit Test" width="320" height="250" centered="true"/> <resources> <script><![CDATA[function RichEditTest() { var win = application.getWindow(); var bt = new BiToolBar; var b1 = new BiToolBarButton( "Bold" ); var b2 = new BiToolBarButton( "Italic" ); var b3 = new BiToolBarButton( "Underline" ); var b4 = new BiToolBarButton( "Html" ); bt.setBorder( new BiBorder( 0 ) ); bt.setLocation( 0, 1 ); bt.setRight( 0 ); bt.setHeight( 20 ); bt.add( b1 ); bt.add( b2 ); bt.add( b3 ); bt.add( b4 ); win.add( bt ); b1.addEventListener( "action", this.onToolBarAction, this ); b2.addEventListener( "action", this.onToolBarAction, this ); b3.addEventListener( "action", this.onToolBarAction, this ); b4.addEventListener( "action", this.onHtmlButtonAction, this ); var borderComp = new BiComponent; borderComp.setBorder( BiBorder.INSET_BORDER ); borderComp.setLocation( 0, 22 ); borderComp.setRight( 0 ); borderComp.setBottom( 0 ); var edit = new BiRichEdit; edit.setLocation( 0, 0 ); edit.setRight( 0 ); edit.setBottom( 0 ); this.editor = edit; borderComp.add( edit ); win.add( borderComp );}RichEditTest.prototype.onToolBarAction = function ( e ){ this.editor.setFocused( true ); this.editor.execCommand( e.getTarget().getText() );};RichEditTest.prototype.onHtmlButtonAction = function ( e ){ alert( this.editor.getContentHtml() ); this.editor.setContentHtml( "<html><head></head><body>Changed HTML</body></html>" );};RichEditTest.main = function () { new RichEditTest(); }; ]]></script> </resources></application>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -