本文整理汇总了TypeScript中nw.gui.default.Menu类的典型用法代码示例。如果您正苦于以下问题:TypeScript gui.default.Menu类的具体用法?TypeScript gui.default.Menu怎么用?TypeScript gui.default.Menu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了gui.default.Menu类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: showFileContextMenu
showFileContextMenu(document:Models.IDocument, ev) {
var menu1 = new gui.Menu();
menu1.append(new gui.MenuItem({ label: 'Reveal in ' + this.getExplorerName(), click: () => {
gui.Shell.showItemInFolder(document.path);
}}));
menu1.append(new gui.MenuItem({ label: 'Copy path to clipboard', click: () => {
var clipboard = gui.Clipboard.get();
clipboard.set(document.path, 'text');
}}));
menu1.append(new gui.MenuItem({ type: "separator" }));
menu1.append(new gui.MenuItem({ label: 'Rename', click: () => {
this.renameFile(document);
}}));
menu1.append(new gui.MenuItem({ label: 'Delete', click: () => {
}}));
menu1.popup(ev.x, ev.y);
ev.stopImmediatePropagation();
}
开发者ID:bihai,项目名称:Notedown,代码行数:21,代码来源:ViewFolderController.ts
示例2: showGenericContextMenu
showGenericContextMenu(ev) {
var menu1 = new gui.Menu();
menu1.append(new gui.MenuItem({ label: 'New Document', click: () => {
this.newFile();
}}));
menu1.append(new gui.MenuItem({ label: 'New Folder', click: () => {
this.addFolder();
}}));
menu1.append(new gui.MenuItem({ type: "separator" }));
menu1.append(new gui.MenuItem({ label: 'Reveal in ' + this.getExplorerName(), click: () => {
gui.Shell.openExternal(this.folder.path);
}}));
menu1.popup(ev.x, ev.y);
}
开发者ID:bihai,项目名称:Notedown,代码行数:19,代码来源:ViewFolderController.ts
示例3: showFolderContextMenu
showFolderContextMenu(folder:Models.IFolder, ev) {
var menu1 = new gui.Menu();
menu1.append(new gui.MenuItem({ label: 'Reveal in ' + this.getExplorerName(), click: () => {
gui.Shell.openExternal(folder.path);
}}));
menu1.append(new gui.MenuItem({ type: "separator" }));
menu1.append(new gui.MenuItem({ label: 'Rename', click: () => {
this.renameFolder(folder);
}}));
menu1.append(new gui.MenuItem({ label: 'Delete', click: () => {
}}));
menu1.popup(ev.x, ev.y);
ev.stopImmediatePropagation();
}
开发者ID:bihai,项目名称:Notedown,代码行数:19,代码来源:ViewFolderController.ts
示例4: require
/// <reference path="../typings/tsd.d.ts" />
var gui = require('nw.gui'),
win = gui.Window.get(),
menu = new gui.Menu();
menu.append(
new gui.MenuItem({
label: "menuItem01",
click: () => {
console.log("click menuItem!!");
}
}));
menu.popup(20,20);
开发者ID:n-kats,项目名称:nditor,代码行数:14,代码来源:gui.ts
示例5: require
var gui = require("nw.gui");
var mainWindow = gui.Window.get();
var menu = new gui.Menu({type: 'menubar'});
var menu_file = new gui.Menu();
var menu_help = new gui.Menu();
menu.append(new gui.MenuItem({ label: "File", submenu: menu_file}));
menu.append(new gui.MenuItem({ label: "Help", submenu: menu_help}));
menu_file.append(new gui.MenuItem({ label: "Exit", click: () => {
mainWindow.close();
}}));
menu_help.append(new gui.MenuItem({ label: "Reload Dev", click: () => {
mainWindow.reloadDev();
}}));
menu_help.append(new gui.MenuItem({ label: "Show Dev Tools", click: () => {
mainWindow.showDevTools();
}}));
menu_help.append(new gui.MenuItem({ type: "separator" }));
menu_help.append(new gui.MenuItem({ label: "About"}));
mainWindow.menu = menu;
/**
* Disable DragDrop in the window
*/
window.ondragover = function(e) { e.preventDefault(); return false };
window.ondrop = function(e) { e.preventDefault(); return false };
开发者ID:bihai,项目名称:Notedown,代码行数:30,代码来源:app.ts
注:本文中的nw.gui.default.Menu类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论