contextmenu

How to add options to Android's native 'Edit text' context menu

家住魔仙堡 提交于 2019-12-05 07:30:50
Is it possible to add something to the list of items that shows up when a user long presses on any Edit Text? (Cut, copy paste, select text, select all, input method) I want to add another option to this menu, but cannot figure it out. There is a duplicate of this question here , and the last comment for the first answer says it's 'possible, but not pretty'. Then the thread dies. I'd really like to see any working example, dirty or not :) Is it possible to add something to the list of items that shows up when a user long presses on any Edit Text? If the EditText is in your activity, you can do

jQuery ContextMenu event not working in IOS 8.2

旧城冷巷雨未停 提交于 2019-12-05 06:51:34
I am using contextMenu event in .html sample, it will be fired when i long press on an DIV, but right now it is not working. Is something broken in latest IOS 8.2 version. Here is the sample code, <head> <title></title> <script src="Scripts/jquery-1.9.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#content").on("contextmenu", function () { alert("CM"); }); }); </script> </head> <body> <div id="content" style="height:300px; width:300px; background-color:gray;"></div> </body> Here is the working sample http://jsfiddle.net/4zu1ckgg/ Please someone help me

How to sort items in ToolStripItemCollection?

核能气质少年 提交于 2019-12-05 06:21:48
I add strings (items) dynamically to a ToolStripItemCollection by: Dim onClickHandler As System.EventHandler = New System.EventHandler(AddressOf Symbol_Click) Dim item As New ToolStripMenuItem(newSymbol, Nothing, onClickHandler) SomeToolStripMenuItem.DropDownItems.Add(item) So the items are not added in one go, but one-by-one based on external triggers throughout the program session. I would like to sort the drop-down-list every time I add a new item. What are my options to achieve that? SpeziFish Since ToolStripItemCollection has no "Sort"-Function, you have to listen on changes and write

Custom entry in the contextual menu

你。 提交于 2019-12-05 03:24:16
问题 Dropbox adds a custom entry in the Mac OS contextual menu, so that if I am in the Dropbox folder and right click on a file or folder, I see a Dropbox entry. How is it possible to add an entry in the system-wide contextual menu? Are there any hacks? How can I do it programmatically? 回答1: If you want to do it just within an App, check out this article from Apple named Displaying a Contextual Menu But I'm guessing you want to do this for all contextual menus, the bottom of the page I referred

SWT: How to recreate a default context menu for text fields

淺唱寂寞╮ 提交于 2019-12-05 02:30:47
问题 I need to add some items to the default context menu of a text control in SWT, but already found out I cannot modify this menu and have to create a new one from scratch. But how do I emulate the default functions Undo, Cut, Copy, Paste, Delete? Do I really have to re-implement all this Clipboard stuff for myself? And I don't even know how to access the Undo history of the control. Is there some maybe dirty hack to emulate the key codes that achieve the functionality? 回答1: The StyledText has

WPF: Hiding ContextMenu when empty

天涯浪子 提交于 2019-12-05 01:10:02
I have a context menu that gets menu items through databinding (I'm using the MVVM pattern): <ContextMenu ItemsSource="{Binding Path=ContextMenuItems}" /> This works fine. However, in the cases when there are no menu items to show, I don't want the context menu to show up at all. Is there a way to accomplish this? Some kind of XAML trigger maybe? I've tried catching the Opened event och closing the context menu when there are no children. This works but the context menu still flashes by... ThomasAndersson Maybe bind to your menu items collections count property and use a converter to set the

ICommand.CanExecute being passed null even though CommandParameter is set

半世苍凉 提交于 2019-12-04 21:16:25
问题 I have a tricky problem where I am binding a ContextMenu to a set of ICommand -derived objects, and setting the Command and CommandParameter properties on each MenuItem via a style: <ContextMenu ItemsSource="{Binding Source={x:Static OrangeNote:Note.MultiCommands}}"> <ContextMenu.Resources> <Style TargetType="MenuItem"> <Setter Property="Header" Value="{Binding Path=Title}" /> <Setter Property="Command" Value="{Binding}" /> <Setter Property="CommandParameter" Value="{Binding Source={x:Static

How to open the default popup from context menu in a chrome extension

心不动则不痛 提交于 2019-12-04 18:56:16
问题 I have developed a chrome extension that opens a popup when I click on the icon near the address bar. Everything works fine, however I want to add some functionality to it. So I thought I'd also add a context menu item so that the user can simply search for the highlighted word. I want the popup to showup when the user clicks on the item in the context menu(the default popup in the top right corner and not a new popup window or a new tab). Can I have this functionality? If yes, how do I

Override the general paste context menu in Android

两盒软妹~` 提交于 2019-12-04 18:27:04
I think that this is not possible but I think it is better to ask someone who knows the answer for sure. Is it possible to create an android application that affect the context menu in all applications so that when the user long press an edit text view, not only the paste option will be visible but also my customized paste function? What I want to do is to make it easy for the user to import texts from my application without leaving the application they are working in. One thing I have thought off is to create a service that listen for pressing volume up and down at the same time and copy my

Command binding not working in a dynamic MVVM Context Menu

狂风中的少年 提交于 2019-12-04 16:55:57
I am new to WPF. Like many others, I am trying to bind a ContextMenu to an ObservableCollection to create a dynamic context menu. Everything works except binding the Command property to the TheCommand property of the MenuItemViewModel class, that represents the menu item. The command is not fired. What am I doing wrong? To start from the beginning, the ContextMenu is a child of the Image and is shown when the mouse is over the Image . <Image.ContextMenu > <ContextMenu ItemsSource="{DynamicResource ContextMenu}" where the empty ContextMenu is defined as follows: <Window.Resources> <local