contextmenu

Customizing Context Menu in WPF

▼魔方 西西 提交于 2019-12-04 02:44:25
I have a project here where I require customizing the context menu in my WPF application in which a button would be placed at the bottom of all the menuitems. However, if I were to add the button through the XAML, it would appear as another item in the collection in the context menu and the mouse-over highlight would act on it. I would like to have the context menu tuned to a grid-like style whereby I could customize the style underneath it. Any idea how I can achieve this (preferably in the XAML)? It's actually pretty straightforward in the XAML. Just define it under the element for which you

How to add item into popup copy/paste menu on a android selected textview?

夙愿已清 提交于 2019-12-04 02:36:56
please look this screenshot. In normal case, when text be selected, a popup menu opened, but only have cut/paste item. I want to know, how to add item just like this "web search / share" into this popup menu? What's this popup menu? I had tried to override Activity Context or Option Menu, but it' not. I had also tried to extends TextView and override it's Context menu, but no use, only show a normal dialog context menu, and this cut/paste menu disappered. jinsihou Before the api23,I have no ideal too. But now we can get it use ACTION_PROCESS_TEXT with api23. Include this code in the

Deleting items from ListView with a contextmenu in Android?

和自甴很熟 提交于 2019-12-03 22:30:46
问题 I'm trying to make a listmanager application in Android. I made a ListView, and an ArrayList into which I can add items with a button and an EditText. Then I made a context menu with an xml file, which I can delete listitems with, add new ones, edit them etc. The problem is that I don't know how to delete my items within the onContextItemSelected() method of my contextmenu. More precisely, I don't know how to refer to the listitems inside of this method, same with all the other operations,

add icon and separator to windows XP right click context menu

蹲街弑〆低调 提交于 2019-12-03 21:39:10
I need to add an icon to custom right click context menu and a separator before and after the menu items i added to right click menu for windows XP, I found some solutions that work for windows 7 but i an searching it for windows XP, Kindly help. For example you we can see the image of Tortoise SVN also the separator before and after the menu item. Try Add custom entry to Windows XP explorer context menu and this might help you too. You can customize the context menu using Ultimate Windows Context Menu Customizer 来源: https://stackoverflow.com/questions/12173011/add-icon-and-separator-to

context menu parent?

╄→гoц情女王★ 提交于 2019-12-03 18:01:34
问题 Hi I added a context menu on label (c#, winforms). my context menu having 3 child items and i want to display label text when i click on any one of context menu items. thanks in advance 回答1: The ContextMenuStrip control has a SourceControl property, that will have a reference to the control that opened it. You can use that to extract the text from the control: private void MenuStripItem_Click(object sender, EventArgs e) { ToolStripItem item = (sender as ToolStripItem); if (item != null) {

How to display a Windows 7 style context menu?

為{幸葍}努か 提交于 2019-12-03 16:04:34
In my .NET applications, context menus look like the left one. How can I apply the Windows 7 style on them in order to make them look like the right one? Right-click the tool box, Choose Items. Tick "ContextMenu", the one with Namespace = System.Windows.Forms and Directory = Global Assembly Cache. This .NET 1.x component is distinct from ContextMenuStrip, it uses native Windows menus. You'll lose some capabilities, I doubt you care. You'll need to write a line of code to assign the menu, the designer only lets you set the ContextMenuStrip property. Add that line to the constructor, like:

ContextMenu not popping up on Long click

纵然是瞬间 提交于 2019-12-03 15:46:15
The context menu is not popping up on the long click on the list items in the list view. I've extended the base adapter and used a view holder to implement the custom list with textviews and an imagebutton. adapter = new MyClickableListAdapter(this, R.layout.timeline, mObjectList); list.setAdapter(adapter); registerForContextMenu(list); Implementation of onCreateContextMenu @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { // TODO Auto-generated method stub super.onCreateContextMenu(menu, v, menuInfo); Log.d(TAG, "Entering Context Menu"); menu

Unity编辑器扩展-基本界面编写

情到浓时终转凉″ 提交于 2019-12-03 14:22:03
一.在编辑器上增加一个MenuItem 先进行第一步,给编辑器加个菜单,通过[MenuItem("AXX/BXX")]就可以在编辑器的上边菜单栏增加一个下拉菜单AXX,并增加一个按钮BXX。只要把这句话写在我们定义的函数上方就可以,然后我们点击这个按钮,就会调用这个我们自定义的函数。不过有一点一定要记住,这个函数要是static的!(想一想就可以知道是为什么,编辑器没有必要搞粗一个对象之类的,因为我们要调用的只是这个方法)例如: using UnityEngine; using UnityEditor; using System.Collections; public class EditorTest { [MenuItem("MyTools/EditorTest")] public static void ConfigDialog() { Debug.Log("EditorTest ToolButton is pressed!"); } } 我们的编辑器就多了这样的一个工具选项MyTools,点击出现了EditorTest下拉菜单,再点击按钮就会输出Log了,如下图所示: 二.创建一个对话框 如果我们嫌这个一个下拉菜单不爽,那我们就可以创建一个对话框,然后就可以在对话框里放更多的按钮或者一些工具条来调节相关内容,下面看一下在Unity编辑器中对话框的创建以及使用。 using

Unity 编辑状态下执行一个方法

北城以北 提交于 2019-12-03 14:08:08
Unity 给我们提供了很多方便开发的特性,本文将会介绍 一个比较常用的特性 : ContextMenu . ContextMenu特性常用于编辑模式下场景数据的设置. 举个例子: “Objects”组下有10个子物体,每个物体身上挂了一个"ObjectData"组件。 假设目前的需求是:1.在编辑模式下把每个物体“ObjectData”组件上的CubeID设置成跟物体名字索引相对应; 2.把每一个物体的 x 轴坐标都间隔为 1 排开。 一种方法就是手动去设置,但这太麻烦,如果是1000个物体就没完没了了。 这里就可以用 ContextMenu 特性 去实现。 创建一个SetData脚本组件,挂在到“Objects”物体上: 代码如下 : 之后右键点击“Objects”上的“SetData”脚本组件,就会发现菜单中多了一行“SetData”项目。 点击“SetData”即可完成设置. 最终效果: 在开发过程中,如果场景较大,点击运行往往需要等待好几秒,ContextMenu特效也可以让我们在编辑模式下(非运行)执行一些方法。 注:使用编辑器类Editor里面的MenuItem特性也可以达到创建实例、设置数据等目的,一个比较主要的区别是 :ContextMenu 作用的方法所在的类是可以继承自MonoBehaviour的,也就是说使用ContextMenu可以实现 如

ICommand.CanExecute being passed null even though CommandParameter is set

穿精又带淫゛_ 提交于 2019-12-03 13:51:49
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 OrangeNote:App.Screen}, Path=SelectedNotes}" /> ... However, while ICommand.Execute( object ) gets