📄 richedittest.xml
字号:
<?xml version="1.0"?><Application autoNameMapping="true"> <Window caption="Rich Edit Test" width="320" height="250" centered="true"> <ToolBar id="tb" left="0" top="1" right="0" height="20" border="0"> <ToolBarButton id="b1" text="Bold"/> <ToolBarButton id="b2" text="Italic"/> <ToolBarButton id="b3" text="Underline"/> <ToolBarButton id="b4" text="Html"/> </ToolBar> <Component border="2 inset" left="0" top="22" right="0" bottom="0"> <RichEdit id="edit" left="0" top="0" right="0" bottom="0"> <RichEdit.contextMenu> <Menu> <MenuItem text="Alert HTML" onaction="alert( edit.getContentHtml() )"/> </Menu> </RichEdit.contextMenu> </RichEdit> </Component> </Window> <Resources> <Script><![CDATA[function RichEditTest(){ b1.addEventListener( "action", this.onToolBarAction, this ); b2.addEventListener( "action", this.onToolBarAction, this ); b3.addEventListener( "action", this.onToolBarAction, this ); b4.addEventListener( "action", this.onHtmlButtonAction, this ); this.editor = edit;}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 + -