AIR: NativeMenu Separator, 右键菜单分割线

Categories: Flex; Tagged with: ; @ March 26th, 2009 10:26

菜单中的分割线: 通过将 NativeMenuItem 构造函数中的 isSeparator 属性设置为 true 创建一条分隔线。

		_menu = new NativeMenu();
		_menuAddTopOU = new NativeMenuItem(RM.getString(BUNDLE_OUSETUP, "ous.menu.addTopOU"));
		_menuAdd = new NativeMenuItem();
		_menuEdit = new NativeMenuItem();
		_menuRemove = new NativeMenuItem();
		_separator = new NativeMenuItem(null, true); //分割线

		_menu.addItem(_menuAddTopOU);
		_menu.addItem(_separator);
		_menu.addItem(_menuAdd);
		_menu.addItem(_menuEdit);
		_menu.addItem(_menuRemove);
		_menu.addEventListener(ContextMenuEvent.MENU_SELECT, onMenuSelected);
		_menu.addEventListener(Event.SELECT, onMenuItemSelected);
		_treeOUs.contextMenu = _menu;



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.