📄 xmlresourceparsertest2.xml
字号:
<?xml version="1.0"?><!-- This example defines a new class called MyLabel that extends BiLabel. Then 3 MyLabel objects are created using markup. Finally a fourth MyLabel is created in the main procedure. This shows the order of execution 1. All resources (script) are loaded and interpreted (MyLabel constructor is defined). 2. The markup inside <window> is parsed and new components created and added 3. FileName.main is called if available--><Application xmlns:xhtml="http://www.w3.org/1999/xhtml"> <Window caption="XML Resource Test 2" width="300" height="200"> <MyLabel top="10">My First Label</MyLabel> <MyLabel top="35">My Second Label</MyLabel> <MyLabel top="60" id="l3">My <xhtml:strong>Third</xhtml:strong> Label</MyLabel> </Window> <Resources> <Script><![CDATA[///////////////////////////////////////////////////////////////////////////////// Define main application class and its entry point//function XmlResourceParserTest2() { // once main is called we can access the components defined using markup var l3 = application.getComponentById( "l3" ); var l4 = new MyLabel( "My Fourth Label" ); l4.setTop( l3.getTop() + 25 ); application.getWindow().add( l4 );}XmlResourceParserTest2.main = function (){ new XmlResourceParserTest2;};///////////////////////////////////////////////////////////////////////////////// Define MyLabel so that we can use it in the markup//function MyLabel( s ){ BiLabel.call( this, s ); this.setLeft( 10 ); this.setRight( 10 ); this.setHeight( 22 ); this.setBackColor( "Window" ); this.setBorder( new BiBorder( 1, "solid", "ThreeDShadow") ); this.setPadding( 3 );}MyLabel.prototype = new BiLabel;MyLabel.prototype._className = "MyLabel"; ]]></Script> </Resources></Application>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -