⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menutest.xml

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 XML
字号:
<Application>	<Window caption="Menu Test" width="500" height="300"/>	<Resources>		<Script><![CDATA[function MenuTest() {	var win = application.getWindow();	var out = new BiLabel;	//out.setTabIndex(1);	out.setBorder(new BiBorder(1, "solid", "ThreeDDarkShadow"));	out.setBackColor("window");	out.setOverflow("auto");	out.setPadding(2);	out.setLocation(5, 5);	out.setRight(5);	out.setBottom(5);	win.add(out);	this._outLabel = out;	// Radio Group for radio button menu items	var radioGroup = new BiRadioGroup;	radioGroup.addEventListener("change", function (e) {		this.print("<span style='color: red'><b>" + e.getTarget().getSelected().getText() +			"</b> is now selected</span>");	}, this);	// define the menu	var m = new BiMenu;	this.menu = m;	var mi, i;	for (i = 0; i < 18; i++) {		if (i == 10 || i == 14)			mi = new BiMenuSeparator;		else if (i >= 11 &&  i <= 13) {			mi = new BiCheckBoxMenuItem("Check Box Menu Item " + i, i % 2 == 0);			mi.addEventListener("change", this.onCheckBoxMenuItemChange, this);		}		else if (i >= 15 && i <= 17) {			mi = new BiRadioButtonMenuItem("Radio Button Menu Item " + i, i % 2 == 0);			mi.addEventListener("change", this.onCheckBoxMenuItemChange, this);			mi.setGroup(radioGroup);		}		else			mi = new BiMenuItem("Menu Item <" + i + ">");		mi.addEventListener("action", this.onMenuItemAction, this);		m.add( mi );	}	// use some setters	m.getChildren()[4].setHtml("<strong>Changed</strong> the <i>HTML</i>");	m.getChildren()[4].setMnemonic("t");	m.getChildren()[3].setIcon( new BiImage("images/folder.open.16.png") );	m.getChildren()[2].setMnemonic("2");	m.getChildren()[1].setIcon( new BiImage("images/folder.open.16.png") );	m.getChildren()[1].setEnabled(false);	m.getChildren()[6].setShortcutText("Ctrl+6");	m.getChildren()[8].setVisible(false);	m.getChildren()[11].setChecked(true);	// add sub menu	var m2 = new BiMenu;	m2.add( new BiMenuItem("Sub Menu") );	m.getChildren()[5].setSubMenu(m2);	win.addEventListener("contextmenu", function (e) {		m.setLocation(e.getScreenX(), e.getScreenY());		m.setVisible(true);	});	// to reflect the short cut text	win.addEventListener("keydown", function (e) {		if (e.getKeyCode() == 54 && e.getCtrlKey())			alert(m.getChildren()[6].getText());	});}MenuTest.prototype.onMenuItemAction = function (e) {	this.print("action: <b>" + e.getTarget().getText() + "</b> was clicked");};MenuTest.prototype.onCheckBoxMenuItemChange = function (e) {	this.print("change: <b>" + e.getTarget().getText() + "</b> changed to " + e.getTarget().getChecked());};MenuTest.prototype.print = function (s) {	this._outLabel.setHtml(this._outLabel.getHtml() + s + "<br>");	this._outLabel.setScrollTop(9999999);};MenuTest.main = function () { new MenuTest; };		]]></Script>	</Resources></Application>

⌨️ 快捷键说明

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