contextmenu

鼠标右键点击弹出菜单(jQuery)

我怕爱的太早我们不能终老 提交于 2019-11-30 09:40:37
禁用浏览器默认事件,此处是兼容写法 $(document).contextmenu(function (e) { var event = e || window.event; if (event.preventDefault) { event.preventDefault(); // 防止浏览器默认行为(W3C) } else { event.returnValue = false; // IE中阻止浏览器行为 } }); 封装右键函数rightClickMouse(),也可将禁用默认浏览器事件封装到此函数中,由于我的项目中如果没有先选中列表项,就不会调用右键函数,因此首先全局禁用浏览器默认事件了~ function rightClickMouse(obj, callback) {//给选择器obj绑定右键事件 $(document).delegate(obj, 'mousedown', function (e) { var $t = $(this); if (e.which == 3) { if (typeof callback == 'function') { //右键执行回调函数 callback($t); } } }); } 右键菜单默认隐藏,相对于body绝对定位(absolute),z-index值尽量大,使其位于界面最上层,通过获取鼠标点击的位置来对菜单进行定位;

Create windows right click context menu for SPECIFIC folders

谁说我不能喝 提交于 2019-11-30 08:46:56
问题 How can I create a context menu that appears for files/folders inside a particular folder. Say there is a directory "D:\RandomCodes" How do I create a custom context menu item "Open in MyApp" for any file/folder inside this? This menu item should not appear for any other directory. I know if I add the entry in HKCR/Directory/Shell, it'll work, but then it'll appear for all files and folders everywhere. Please guide me through this. 回答1: Is possible modifing your code for IShellExtInit:

How to add a submenu entry to Eclipse Package Explorer context menu item using org.eclipse.ui.menus?

末鹿安然 提交于 2019-11-30 08:22:18
问题 I am trying to add a submenu entry to an item from the context menu of the Eclipse Package Explorer. The menu entry is already defined via org.eclipse.ui.popupMenus in another plugin, not in the one that I am working at. (That plugin is added to the dependencies list of my plugin). There are also items added in its submenu, but also using org.eclipse.ui.popupMenus, and I am trying to do this via org.eclipse.ui.menus. To begin with, I did the following: I added org.eclipse.ui.commands and org

How to create a right-click context menu for a button in WPF

烂漫一生 提交于 2019-11-30 07:27:39
问题 i know how to create a left-click context menu for a button, but I am not too sure how to do it for a right click? (i.e. how to specify that the context menu should appear on a right-click, not a left click). Many thanks. 回答1: Here is a sample: <Button Content="button" Name="btn" Width="100"> <Button.ContextMenu> <ContextMenu> <MenuItem Header="Cut"/> <MenuItem Header="Copy"/> <MenuItem Header="Paste"/> </ContextMenu> </Button.ContextMenu> </Button> 来源: https://stackoverflow.com/questions

onCreateContextMenu() for EditText doesn't work on real device

本小妞迷上赌 提交于 2019-11-30 07:24:34
Just tried to test my app on real device (HTC Desire Z with Android 2.2). And found that my context menus doesn't work at all on EditText s. Otherwise context menus works: in ListView , ImageView and so on. On emulator everything works fine... When I tap on EditText it shows something like zoom frame and then shows unusual (not standard Android alike) context menu which reads: "select text", "select all". It doesn't show my menus. Here are screenshots: Before tap During tap After tap (just ordinary select text, select all, paste) but no my menu like in emulator - look here Here's source code

“Edit with IDLE” option missing from context menu

时光怂恿深爱的人放手 提交于 2019-11-30 07:11:34
问题 I have Python 2.7.5 that installed with ArcGIS 10.2.2. When I first right-clicked a .py script I'd previously written it listed the "Edit with IDLE" option in the context menu. However, this option no longer appears when I right-click a .py file. I have read numerous threads concerning this issue and attempted some of them, such as modifying/removing registry keys and then reinstalling/repairing the software. I am not interested in using an IDE at this point, though many will be happy to know

WPF Context Menus in Caliburn Micro

纵饮孤独 提交于 2019-11-30 06:51:22
I'm trying to get a context menu within a ListBox ItemTemplate to call a method on the parent view model, passing in the item that was clicked on as a parameter. I have this working for other buttons in the item template, but for the context menu it seems to be failing. I have the following xaml (abbreviated for clarity): <ListBox> <ListBox.GroupStyle> <GroupStyle> ... </GroupStyle> </ListBox.GroupStyle> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ContextMenu> <ContextMenu Name="cm"> <MenuItem Header="Open" cal:Message.Attach="Open($dataContext)"> </MenuItem> </Grid.ContextMenu>

Silverlight Datagrid select on right click

橙三吉。 提交于 2019-11-30 05:36:34
问题 Is there a way for a right click event to select a row in toolkit datagrid? I'm using toolkit context menu which works nicely, but the problem is, only left click is able to select rows, and I need right click to be able to do that if I want my context menu to work properly. Any help is appreciated 回答1: You can find a solution here. Basically it goes like this: private void dg_LoadingRow(object sender, DataGridRowEventArgs e) { e.Row.MouseRightButtonDown += new MouseButtonEventHandler(Row

Column-specific context menu for Primefaces DataTable

六眼飞鱼酱① 提交于 2019-11-30 05:18:14
How can I define context menu for each column differently in Primefaces datatable? Putting <p:contextMenu> inside <p:column> does not work properly. I want context menu to be different depending on which column user right-clicked in. This does not work (context menu is created the same for all columns): <p:dataTable value="#{values}" var="value" selectionMode="single" selection="#{selectedValue}" id="table"> <p:column headerText="Col 1"> <h:outputText value="#{value.balance}"> <f:convertNumber type="currency"></f:convertNumber> </h:outputText> <p:contextMenu> <p:menuitem value="Report"></p

Android: Context menu on single click

人盡茶涼 提交于 2019-11-30 04:43:28
I have an Intent that extends a ListActivity. In my onCreate method after having populated the list adapter I use registerForContextMenu(getListView()); to register for a context menu. Now it is working and the context menu has its original function which is; once I click and hold down on an item the context menu opens. Can I open the context menu on a single click (without having to hold down on the list)? All help is appreciated. call activity.openContextMenu(l) onitem click event to open contextmenu on single click and onLongClick call activity.closeContextMenu() Example import android.app