contextmenu

GWT: Select a TreeItem with right click

不想你离开。 提交于 2019-12-04 15:38:36
I'm capturing a right click event to show a context menu. What I haven't been able to figure out, is how to make the right click actually select the TreeItem, prior to showing of context menu. All help is appreciated. private Tree tree = new Tree() { @Override public void onBrowserEvent(Event event) { if (event.getTypeInt() == Event.ONCONTEXTMENU) { DOM.eventPreventDefault(event); showContextMenu(event); } super.onBrowserEvent(event); } @Override protected void setElement(Element elem) { super.setElement(elem); sinkEvents(Event.ONCONTEXTMENU); } }; ONMOUSEDOWN event gets fired before

Is there any way to change the Context Menu of a Web browser using Wpf (C#)

Deadly 提交于 2019-12-04 14:16:07
问题 I would to change the menuitems in the default context menu provided in the Web Browser Control. I have already tried: webbrowser.contextmenu = mycontextmenu. Nothing changed. Is there a way to do this? 回答1: Answer - YES. There is a setting in the webbrowser control for: .IsWebBrowserContextMenuEnabled = false; Setting this to false disables the IE contextmenu, allowing whichever one you set to rule the roots. Simples.. 回答2: The short answer is yes. See this article on codeproject. Here is

Enabling jQuery contextMenu item on ajax request

眉间皱痕 提交于 2019-12-04 13:15:23
I'm trying to update contextmenu item if ajax requests alters my div content. Here is what I mean I have a div like this : <div id="" class="message" data-options='{"update":"YES", "delete":"NO"> </div> And context Menu jquery part (this happens only once when body loads): $.contextMenu({ selector: '.message', trigger: 'left', callback: function(key, options) { var m = "clicked: " + key; window.console && console.log(m) || alert(m); }, items: { "update": { name: "Update", disabled: function(key, opt) { return (this.data("options").update === "NO") }, }, "delete": { name: "Delete", disabled:

How to save an image by selecting “save image as…” in a context menu using Selenium Webdriver (Python)

允我心安 提交于 2019-12-04 13:07:07
问题 I'm trying to use selenium webdriver to save a specific image to a directory. I was looking to do this by simulating a right click on the img element and selecting "save image as...". With the following code I can open the context menu, but I'm unable to select the correct option. browser = WebDriver(executable_path=CHROMEDRIVER_PATH) browser.get(URL) img = browser.find_element_by_tag_name('img') ActionChains(browser).context_click(img).perform() I also tried: ActionChains(browser).context

Android NULL menuInfo in onCreateContextMenu and onContextItemSelected only with manual call to openContextMenu in onListItemClick. Long click works

让人想犯罪 __ 提交于 2019-12-04 13:06:27
I have parsed through a lot of the posts here and haven't found anything quite like my problem. Basically I am trying to call openContextMenu(l) in onListItemClick . Doing so creates a context menu with no menuInfo . Performing a long click will work correctly. After the long click is performed, my code will start working and actually get a menuInfo that is not null. I have a ListActivity that is filled with a SimpleCursorAdapter which grabs data from SQL . In my onCreate I registerForContextMenu(getListView()) . I have also tried using registerForContextMenu(l) just before the openContextMenu

How do I make context menus for my software?

女生的网名这么多〃 提交于 2019-12-04 12:54:14
So the idea is to make an encryption software which will work only on .txt files and apply some encryption functions on it and generate a new file. To avoid the hassle of user having to drag-and-drop the file, I have decided to make an option similar to my anti-virus here. I want to learn how to make these for various OS, irrespective of the architecture :) What are these menus called? I mean the proper name so next time I can refer to them in a more articulate way How to make these? My initial understanding: What I think it will do is: pass the file as an argument to the main() method and

How to add a Column ContextMenu in the WPF DataGrid

允我心安 提交于 2019-12-04 12:18:07
I'm trying to add a context menu to a column in the WPF datagrid and don't quite see how this is possible. I know how to add one to the datagrid, but I would like to have different menu items based on the column as well have the menu click event be aware of column or better yet the cell that the context menu was chosen for. My ultimate goal is to create a context menu that has a "Clear" menu item which will be used to null out the data in that column. I don't want an empty string or false in the case of a check box column, I want the underlying data to be nulled out. If anyone has a suggestion

Accepting File Argument in Python (from Send To context menu)

非 Y 不嫁゛ 提交于 2019-12-04 11:59:09
I'm going to start of by noting that I have next to no python experience. alt text http://www.aquate.us/u/9986423875612301299.jpg As you may know, by simply dropping a shortcut in the Send To folder on your Windows PC, you can allow a program to take a file as an argument. How would I write a python program that takes this file as an argument? And, as a bonus if anyone gets a chance -- How would I integrate that with a urllib2 to POST the file to a PHP script on my server? Thanks in advance. Edit-- also, how do I make something show up in the Sendto menu? I was under the impression that you

How can I get the element that was right-clicked via a Google Chrome context menu?

与世无争的帅哥 提交于 2019-12-04 11:36:35
问题 I am creating a context menu item in Google chrome like so: chrome.contextMenus.create({ "title":"My Context Menu Item", "contexts":["editable"], "onclick": onClick }); The onClick callback receives two arguments: an OnClickInfo object and a tab object. Neither object appears to contain a reference to the DOM element that was right-clicked when invoking the context menu. I have console.logged both of these objects but don't see any reference to the targeted element anywhere. The desired

How can I set up a context menu in Google Chrome so that all of the menu are top level?

天大地大妈咪最大 提交于 2019-12-04 09:32:35
I am working on a Google Chrome extension and I have set up several right click context menu items. I see that there is something in the syntax for adding a menu item which allows you to choose a parentID, but I don't see anything that would allow you to choose to have all the menu items as top level items. Here's an example of my plugin with a single top level menu item and then several sub menu items: I'd like to bring those out to the top level because I use them a lot. This is the code that I have so far, but I can't figure out how to pull them all up a level: chrome.contextMenus.create({