contextmenu

A style intended for type 'MenuItem' cannot be applied to type 'Separator'

…衆ロ難τιáo~ 提交于 2019-12-12 20:42:53
问题 I'm working on WPF Window Application which uses ContextMenu . My ContextMenu in XAML (in Window.Resources): <ContextMenu x:Key="menuList" Placement="Bottom" > <ContextMenu.ItemContainerStyle> <Style TargetType="{x:Type MenuItem}"> <Setter Property="Header" Value="{Binding Name}"/> <EventSetter Event="Click" Handler="cm_RefreshChannelNotification"/> <Setter Property="IsChecked" Value="{Binding CFiltered}" /> <Setter Property="IsCheckable" Value="True"/> <Setter Property="StaysOpenOnClick"

How can I add different menu items to multiple context menus?

妖精的绣舞 提交于 2019-12-12 17:32:13
问题 I have two button each with a Context Menu, but I'm unsure how to change the menu items in the second menu. My code only shows my items for my first button. Button Button1 = (Button) findViewById(R.id.Button1); registerForContextMenu(Button1); Button Button2 = (Button) findViewById(R.id.Button3); registerForContextMenu(Button2); } @Override public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle(

Detectinig the target of the click using JavaScript?

纵然是瞬间 提交于 2019-12-12 17:24:30
问题 How do I detect what object or ID or the user right-clicked on? I'm using the onContextMenu to trigger a function but I don't know how to detect the target. 回答1: <html> <head> <script type="text/javascript"> if (document.addEventListener) { document.addEventListener('contextmenu', function(e) { alert(e.target.nodeName); //or e.target.getAttribute('id') e.preventDefault(); }, false); } else { document.attachEvent('oncontextmenu', function(e) { alert(window.event.srcElement.nodeName); //or e

Android ContextMenu for View (Not Activity)

有些话、适合烂在心里 提交于 2019-12-12 16:26:05
问题 I am using the following method to add a ContextMenu to a custom view i have built but i want to know how to react to the press of that contextmenu. This is not an Activity so i cannot do this: @override public boolean onOptionsItemSelected(MenuItem item) { Here is the code private View.OnCreateContextMenuListener vC = new View.OnCreateContextMenuListener() { @Override public void onCreateContextMenu(ContextMenu arg0, View arg1, ContextMenuInfo arg2) { // TODO Auto-generated method stub arg0

WPF treeview contextmenu command parameter

让人想犯罪 __ 提交于 2019-12-12 13:24:58
问题 I have TreeView with HierarchicalDataTemplate . On TreeView I have ContextMenu <TreeView Name="_packageTreeView" ItemsSource="{Binding PackageExtendedList}" Behaviors:TreeViewInPlaceEditBehavior.IsEditable="True"> <TreeView.ContextMenu> <ContextMenu StaysOpen="true"> <MenuItem Header="Добавить пакет" Height="20" Command="{Binding AddPackageCommand}" CommandParameter="{Binding ElementName=_packageTreeView, Path=SelectedItem}"> <MenuItem.Icon> <Image Source="/Resources/ManualAdd.png" Width="15"

How to get id like “invokedOn” text by a right click event with Bootstrap ContextMenu?

纵饮孤独 提交于 2019-12-12 12:26:40
问题 I am using Bootstrap 3.0 ContextMenu. here is a link http://jsfiddle.net/KyleMit/X9tgY/ I need to know how i can get the id or data-Id of the clicked element. i try many of the tricks but i cant get the clicked element id? Like when i clicked on "Jacob" row i get the "Jacob" after clicked. I also need from this line <td data-id="user-3"> <a data-id="user-3">Jacob<a/> <td/> "data-Id"? i tried var $selectedFileId = $(this).closest('a').html(); or alert($(this).parent('a').html()); 回答1: Use this

Eclipse plugin project explorer context menu

两盒软妹~` 提交于 2019-12-12 12:16:18
问题 This is part of plugin.xml working context menu for PackageExplorer now I wanted it for ProjecExplorer, so I tried rewrite it to ProjectExplorer but It doesn't work .. I searched the web and found that are problem with that, but I couldn't find working solution. Does anybony experience how to fix do it? <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="popup:org.eclipse.jdt.ui.PackageExplorer"> <command commandId="app.LoadXml" label="Load plan" style="push" mnemonic="L">

C# How to add my program to context menu?

烂漫一生 提交于 2019-12-12 11:14:59
问题 I have a c# executable file (created from a windows form application) and I would like to be able to add this file to the context menu. Furthermore, I should point out that I need to be able to add it to Windows XP, Vista, and 7. Thank you for any help, 回答1: It is not that difficult and it is called context menu. Check this out Add a context menu to the Windows Explorer Basically you will need to add item to the Registry.ClassesRoot.CreateSubKey registry. 回答2: Yeah add context menu using

Right mouse click detection on SVG shape in JavaScript not working

醉酒当歌 提交于 2019-12-12 10:36:26
问题 I need some help with my script in which I would like to detect RMB click. INFO: finally I want to display my own right-click menu on a dedicated SVG shape, which is displayed with a use of Raphael js lib, I found out that there are many different examples on web, even very simple ones to implement, like with jQuery - but I have to be able to detect wether RMB was clicked or any other. I have tried (without success on RMB) a following peace of code: <html> <head> <script type="text/javascript

Getting the control of a context menu

左心房为你撑大大i 提交于 2019-12-12 09:55:02
问题 I have a context menu that looks like this A |--1 |--2 |--3 I need to access the object that the context menu is called from, after selecting 1 2 or 3 meaning if this is a context menu of a textbox1 then I need to access that object, how do I do that? Forgot to mention, this is a WPF application. so Im using the System.Windows.Controls and the ContextMenu is created programmatically 回答1: You can walk up the tree and get the control from the ContextMenu.PlacementTarget, e.g. private void