📄 inline.xml
字号:
<?xml version="1.0"?><Application> <Window width="300" height="200"> <InlineComponent inlineId="test" id="test" width="100" height="150"> <TabPane left="0" right="0" top="0" bottom="0"> <TabPage text="Hello"> <List left="5" right="5" top="5" bottom="5"> <ListItem>Hello</ListItem> <ListItem>Inline</ListItem> <ListItem>World</ListItem> </List> </TabPage> <TabPage text="World"> <Button id="b" left="5" right="5" top="5" text="Popup"/> <Popup id="p" backColor="white" border="5 solid navy" preferredWidth="150" preferredHeight="200" opacity="0.9" top="0" left="0"> This is a popup </Popup> </TabPage> </TabPane> </InlineComponent> <!-- moved to construtor to do browser test <InlineComponent inlineId="graph" width="400" height="300"> <Graph id="graph" left="0" right="0" top="0" bottom="0"/> </InlineComponent> <InlineComponent inlineId="gauge" width="200" height="200"> <Gauge left="0" right="0" top="0" bottom="0"/> </InlineComponent> --> <MenuBar top="0" left="0" right="0" backColor="ThreeDFace"> <MenuBar.border> <Border bottomStyle="outset" bottomWidth="2"/> </MenuBar.border> <MenuButton text="File"> <Menu> <MenuItem text="Exit"/> </Menu> </MenuButton> </MenuBar> <!-- inline components for the table --> <InlineComponent inlineId="tr-1" width="75" height="25"> <Button left="0" right="0" top="0" bottom="0">Button</Button> </InlineComponent> <InlineComponent inlineId="tr-2" width="75" height="15"> <CheckBox left="0" right="0" top="0" bottom="0">Check box</CheckBox> </InlineComponent> <InlineComponent inlineId="tr-3" width="75" height="22"> <Spinner id="spinner" left="0" right="0" top="0" bottom="0" onchange="this.getComponentById('slider').setValue( event.getTarget().getValue() )"/> </InlineComponent> <InlineComponent inlineId="tr-4" width="200" height="22"> <Slider id="slider" left="0" right="0" top="0" bottom="0" onchange="this.getComponentById('spinner').setValue( event.getTarget().getValue() )"/> </InlineComponent> <InlineComponent inlineId="button" height="25" id="button"> <Button width="75" right="160" top="0" bottom="0" onaction="alert( 'Ok' )" text="OK"/> <Button width="75" right="80" top="0" bottom="0" onaction="alert( 'Cancel' )" text="Cancel"/> <Button width="75" right="0" top="0" bottom="0" onaction="alert( 'Apply' )" text="Apply" enabled="false"/> </InlineComponent> </Window> <Resources> <Package name="Charting"/> <Script><![CDATA[// define constructorfunction Inline(){ var win = application.getWindow(); // only add graph and gauge if IE if ( BiBrowserCheck.ie ) { var ic = new BiInlineComponent( "graph" ); ic.setSize( 400, 300 ); // sine chart animation var n = 36; var graph = new BiGraph; graph.getCategoryAxis().setMajorTickInterval( n / 4 ); graph.getCategoryAxis().setAxisBetweenCategories( false ); graph.getValueAxis().setMaximum( 1.2 ); graph.getValueAxis().setMinimum( -1.2 ); graph.getGridLines().setMajorValueStrokeColor( "#ddd" ); graph.getGridLines().setShowMajorCategory( false ); // build categories var cats = new Array( n ); for ( var i = 0; i < n; i++ ) { cats[i] = new BiChartCategory( graph, "c" + i, String(i * 360 / n) ); } graph.setCategories( cats ); var phi = 0; // build series var s = new Array( n ); for ( var i = 0; i < n; i++ ) { v = i / n * 2 * Math.PI + phi; s[i] = Math.sin( v ); } graph.addSeries( new BiChartSeries(graph, "s1", "sin(伪 - 蠁(t))", s) ); graph.getChartPresentationBySeriesId("s1").setMarkerVisible( false ); graph.setLocation(0, 0); graph.setRight(0); graph.setBottom(0); var serie = graph.getSeriesById( "s1" ); var t = new BiTimer( 50 ); t.addEventListener( "tick", function ( e ) { var c = graph.getCharts()[0]; phi += Math.PI / 50; for ( var i = 0; i < n; i++ ) { v = i / n * 2 * Math.PI - phi; serie.setValueByCategoryId("c" + i, Math.sin(v) ); } c.update(); }); graph.addEventListener( "mouseover", function (e) { t.stop(); }); graph.addEventListener( "mouseout", function (e) { t.start(); }); ic.add( graph ); win.add( ic ); graph.update(); t.start(); // end sine chart // Gauge block ic = new BiInlineComponent( "gauge" ); ic.setSize( 200, 230 ); var gauge = new BiGauge; gauge.setLocation( 0, 0 ); gauge.setRight( 0 ); gauge.setBottom( 30 ); var slider = new BiSlider; // prevent IE click through slider.setBackColor( "white" ); slider.setLeft( 0 ); slider.setRight( 0 ); slider.setBottom( 0 ); slider.setHeight( 25 ); slider.addEventListener( "change", function (e) { gauge.setValue( slider.getValue() ); }); ic.add( gauge ); ic.add( slider ); win.add( ic ); } win.setCanSelect( true ); var b = application.getComponentById( "b" ); var p = application.getComponentById( "p" ); p.positionRelativeToComponent( b, "vertical" ); b.addEventListener( "action", function ( e ) { p.setVisible( true ); });}// define static main methodInline.main = function () { new Inline();}; ]]></Script> </Resources></Application>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -