contextmenu

Setting a WPF ContextMenu's PlacementTarget property in XAML?

我们两清 提交于 2019-11-27 01:51:19
问题 <Button Name="btnFoo" Content="Foo" > <Button.ContextMenu Placement="Bottom" PlacementTarget="btnFoo"> <MenuItem Header="Bar" /> </Button.ContextMenu> </Button> gives me a runtime error 'UIElement' type does not have a public TypeConverter class I also tried <Button Name="btnFoo" Content="Foo" > <Button.ContextMenu Placement="Bottom" PlacementTarget="{Binding ElementName=btnFoo}"> <MenuItem Header="Bar" /> </Button.ContextMenu> </Button> and that put the ContextMenu in the top left corner of

Is it possible to hide/remove arbitrary context menu items in Eclipse (3.6)

微笑、不失礼 提交于 2019-11-27 01:49:54
问题 My question can be split into three: Is it possible to hide/remove arbitrary context menu items in Eclipse (3.6) by ... standard UI? some existing plug-in? custom plug-in? I failed to find ways to do this by methods 1 and 2. If the only option is creating custom plug-in, could anyone push me towards the right direction where to start (I have some experience in Java, but not in Eclipse plug-ins). 回答1: You can hide menus or menu entries through the standard GUI: see help To hide a menu item or

jsTree and Context Menu: modify items

时光总嘲笑我的痴心妄想 提交于 2019-11-27 01:19:29
问题 I'm using jsTree 3.0.0 and I need to modify the context in one of the following ways: Change label language for the default items, disable some default items and add new items. Rewrite all items and bind to some new items the create, rename and delete function. I tried several approaches but nothing worked. For example, this returns Uncaught TypeError: Object [object global] has no method 'create' when I click on create. "contextmenu":{ "items": function($node) { return { createItem : {

How can I add a context menu to the Windows Explorer for a Java application?

假装没事ソ 提交于 2019-11-27 01:04:06
How would one go about adding a submenu item to the windows explorer context menu (like for example 7-Zip does) for a Java application? I am aware of two ways to do it. The fancy way is to write a windows shell extension, which is how powerarchiver, winzip etc do it I believe (this involves running code to determine what the context menu items will be dependent on the file chosen). The simple way, for simple functionality, is you can add an entry in the registry : HKEY_CLASSES_ROOT\<file type>\shell\<display text>\command Where <file type> is the files that this context menu should apply to i

How to retrieve the element where a contextmenu has been executed

丶灬走出姿态 提交于 2019-11-27 00:31:00
I am trying to write a google chrome extension where I use a contextmenu. This contextmenu is available on editable elements only (input texts for example). When the contextmenu is clicked and executed I would like to retrieve in the callback function the element (the input text) on which the contextmenu has been executed in order to update the value associated to this input text. Here is the skeleton of my extension: function mycallback(info, tab) { // missing part that refers to the question: // how to retrieve elt which is assumed to be // the element on which the contextMenu has been

WPF Context menu on left click

醉酒当歌 提交于 2019-11-26 22:56:33
问题 I have a WPF application..In which I have an Image control in Xaml file. On right click of this image I have a context menu. I would like to have same to be displayed on "Left click" also. How do I do this in MVVM way ? 回答1: Here is a XAML only solution. Just add this style to your button. This will cause the context menu to open on both left and right click. Enjoy! <Button Content="Open Context Menu"> <Button.Style> <Style TargetType="{x:Type Button}"> <Style.Triggers> <EventTrigger

Default ContextMenu Style - WPF

一个人想着一个人 提交于 2019-11-26 22:50:12
问题 I am trying to modify the default style of the ContextMenu in WPF. Normally you can creat a copy of the default in Expression Blend using the Edit Control Parts (Template) > Edit a Copy menu option. However I can't work out how to do this with a ContextMenu. Any idea how I can get the default style to modify? I am trying to disable the left side of the context menu where the icons are normally shown. Thanks! Update: Maybe I wasn't clear about removing the icons. For example, if you have a

Copy text from TextView on Android

北战南征 提交于 2019-11-26 22:49:16
问题 I have a ListView where each item is a TextView . I want to enable the long press behaviour similar to an EditText that displays the default context menu with items like "Select all", "Cut all", "Copy all", etc. Is there an easy way to enable this for a TextView ? 回答1: I think I have a solution. Just call registerForContextMenu(yourTextView); and your TextView will be registered for receiving context menu events. Then override onCreateContextMenu in your Activity : @Override public void

WPF: Displaying a Context Menu for a GridView's Items

早过忘川 提交于 2019-11-26 22:44:33
问题 I have the following GridView : <ListView Name="TrackListView" ItemContainerStyle="{StaticResource itemstyle}"> <ListView.View> <GridView> <GridViewColumn Header="Title" Width="100" HeaderTemplate="{StaticResource BlueHeader}" DisplayMemberBinding="{Binding Name}"/> <GridViewColumn Header="Artist" Width="100" HeaderTemplate="{StaticResource BlueHeader}" DisplayMemberBinding="{Binding Album.Artist.Name}" /> <GridViewColumn Header="Album" Width="100" HeaderTemplate="{StaticResource BlueHeader}"

Creating dynamic context menu in Chrome Extension is failing

谁都会走 提交于 2019-11-26 22:02:50
I am trying to create entries on the Chrome context menu based on what is selected. I found several questions about this on Stackoverflow, and for all of them the answer is: use a content script with a "mousedown" listener that looks at the current selection and creates the Context Menu. I implemented this, but it does not always work. Sometimes all the log messages say that the context menu was modified as I wanted, but the context menu that appears is not updated. Based on this I suspected it was a race condition: sometimes chrome starts rendering the context menu before the code ran