📄 boxtest.xml
字号:
<Application> <Window caption="Box Test" width="400" height="400"> <Command id="orient-command" onuservaluechanged=" var c = event.getTarget(); var box = this.getComponentById( 'box' ); if ( box ) box.setOrient( c.getUserValue() )"/> <Command id="pack-command" onuservaluechanged=" var c = event.getTarget(); var box = this.getComponentById( 'box' ); if ( box ) box.setPack( c.getUserValue() )"/> <Command id="align-command" onuservaluechanged=" var c = event.getTarget(); var box = this.getComponentById( 'box' ); if ( box ) box.setAlign( c.getUserValue() )"/> <RadioGroup id="pref-width-group"/> <RadioGroup id="pref-height-group"/> <Box id="box" left="5" top="5" right="110" bottom="5" backColor="black" rightToLeft="false" orient="vertical"> <Label backColor="white" text="Hello 1"/> <Label backColor="white" text="Hello 2"/> <Component id="c" backColor="green" Box.flex="1" preferredWidth="100" maximumWidth="200" minimumWidth="100" preferredHeight="100" maximumHeight="200" minimumHeight="100" marginLeft="10" marginRight="10" marginTop="50" marginBottom="5"> <Component left="5" right="5" top="5" bottom="5" backColor="white" opacity="0.7"> <GridPanel left="5" right="5" top="5" bottom="5" backColor="black" border="1 solid black" vGap="1" hGap="1" rightToLeft="false" rows="*,*"> <Label backColor="white">1</Label> <Label backColor="white">2</Label> <Label backColor="white">3</Label> <Label backColor="white">4</Label> </GridPanel> </Component> </Component> <Label backColor="white" text="Hello 4" margin="1"/> <Label backColor="white" text="Hello 5" margin="2"/> <Label backColor="white" text="Hello 6"/> <Label backColor="white" text="Hello 7" margin="1"/> </Box> <GroupBox right="5" top="5" bottom="5" width="100"> <VBox top="5" left="5" right="5" bottom="5"> <Label labelFor="#orient-combo">Orient:</Label> <ComboBox id="orient-combo" command="#orient-command"> <ComboBoxItem userValue="vertical" text="vertical" selected="true"/> <ComboBoxItem userValue="horizontal" text="horizontal"/> </ComboBox> <Label labelFor="#pack-combo" marginTop="5">Pack:</Label> <ComboBox id="pack-combo" command="#pack-command"> <ComboBoxItem userValue="start" text="start" selected="true"/> <ComboBoxItem userValue="center" text="center"/> <ComboBoxItem userValue="end" text="end"/> </ComboBox> <Label labelFor="#align-combo" marginTop="5">Align:</Label> <ComboBox id="align-combo" command="#align-command"> <ComboBoxItem userValue="start" text="start"/> <ComboBoxItem userValue="center" text="center"/> <ComboBoxItem userValue="stretch" text="stretch" selected="true"/> <ComboBoxItem userValue="end" text="end"/> </ComboBox> </VBox> </GroupBox> </Window> <Resources> <Script><![CDATA[function BoxTest(){ var c = application.getComponentById( "c" ); var t = new BiTimer( 50 ); var v = 0; t.addEventListener( "tick", function ( e ) { v += 5 * Math.PI/ 180; c.setMargin( Math.abs( Math.round( 50 * Math.cos( v ) ) ) ); } ); //t.start();}BoxTest.main = function (){ new BoxTest;}; ]]></Script> </Resources></Application>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -