📄 gaugetest.xml
字号:
<?xml version="1.0"?><!-- This is a test app for the gauge--><Application> <Window caption="Gauge" width="400" height="400" centered="true"/> <Resources> <Script><![CDATA[function GaugeTest() { var win = application.getWindow(); var g = new BiGauge; g.setLocation(7, 7) g.setMaximum(240) g.setWarningValue(200); g.setMinorTickInterval(2); var s1 = new BiGaugeSection(g, 40, 50); s1.setColor("green"); s1.setOpacity(0.5); g.add(s1); var s2 = new BiGaugeSection(g, 80, 90); s2.setColor("green"); s2.setOpacity(0.5); g.add(s2); g.setShowTitle(true); g.getTitle().setText("km/h"); var s = new BiSlider; s.addEventListener("change", function (e) { g.setValue(s.getValue()); }); s.setLeft(7); s.setRight(7); s.setBottom(7); s.setMaximum(240) function resize() { var w = win.getClientWidth(); var h = win.getClientHeight() - 40; var s = Math.min(w, h); g.setSize(s, s); g.setLocation( (w - s) / 2, (h - s) / 2 ); } win.addEventListener("resize", resize); resize(); win.add(g); win.add(s); var t = new BiTimer(100); t.addEventListener("tick", function (e) { g.setMinimum( Math.max(10, g.getMinimum() + 2) ); }); //t.start(); /* // test to overload value to change needle color g.setValue = function (n) { BiGauge.prototype.setValue.call(this, n); var c = Math.round( (n - this.getMinimum()) / (this.getMaximum() - this.getMinimum()) * 255 ); g.getNeedle().setFillColor("rgb(" + c + "," + 0 + "," + 0 + ")"); g.getNeedle().setStrokeColor("rgb(" + c + "," + 0 + "," + 0 + ")"); } */}GaugeTest.main = function () { new GaugeTest; }; ]]></Script> </Resources></Application>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -