slidertest.xml

来自「在流览器上仿CS界面的JAVASCRIPT脚本」· XML 代码 · 共 101 行

XML
101
字号
<application>	<window caption="Slider Test" width="300" height="200"/>	<resources>		<script><![CDATA[function SliderTest() {	var win = application.getWindow();	var s = new BiSlider("vertical");	var s2 = new BiSlider();	var t = new BiTimer;	var startButton = new BiButton("Start");	var stopButton = new BiButton("Stop");	s.setTabIndex(1);	s2.setTabIndex(2);	startButton.setTabIndex(3);	stopButton.setTabIndex(4);	s.setLocation(5, 5);	s.setBottom(5);	win.add(s);	s2.setLocation(s.getLeft() + s.getWidth() + 5, 5);	s2.setRight(5);	win.add(s2);	stopButton.setRight(5);	stopButton.setBottom(5);	stopButton.setWidth(70);	win.add(stopButton);	startButton.setRight(stopButton.getWidth() + 10);	startButton.setBottom(5);	startButton.setWidth(70);	win.add(startButton);	var steps = 100;	var time = 5000;	var interval = time /steps;	//s.setMinimum(50);	//s2.setMinimum(50);	s.setMaximum(steps);	s2.setMaximum(steps);	t.setInterval(interval);	t.addEventListener("tick" , function () {		if (s.getValue() >= steps) {			t.stop();			startButton.setText("Start");			stopButton.setEnabled(false);		}		s.setValue(s.getValue() + 1);	});	startButton.addEventListener("action", function () {		if (t.getEnabled()) { // running			t.stop();			startButton.setText("Resume");		}		else {			if (s.getValue() == s.getMaximum()) {				s.setValue(0);			}			t.start();			startButton.setText("Pause");			stopButton.setEnabled(true);		}	});	stopButton.addEventListener("action", function () {		t.stop();		s.setValue(0)		stopButton.setEnabled(false);		startButton.setText("Start");	});	s.addEventListener("change", function () {		s2.setValue(s.getValue());		win.setCaption(s.getValue());	});	s2.addEventListener("change", function () {		s.setValue(s2.getValue());		win.setCaption(s.getValue());	});	//t.start();}SliderTest.main = function () { new SliderTest(); };		]]></script>	</resources></application>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?