FAQ Database Discussion Community


Add Context Menu command in Atom.io

contextmenu,bookmarks,atom-editor
I'm trying to add a context menu command to the Atom editor so that I can easily toggle bookmarks. I added the following to my config.cson file: "context-menu": "atom-text-editor": Bookmark: "bookmarks:toggle-bookmark" I restarted Atom and right-clicked on a line of code, but the context menu hadn't changed. Is there something...

JavaFX TableView Context Menu Item shows up when run on Java 8 until update 5 but not on later ones

java,contextmenu,tableview,javafx-8
The code below runs as its name says on Java 8 update 5 but not on later ones: public class TableViewShowingOnlyAnAppendContextMenuItemIfRowIsEmptyElseDeleteIsIncluded extends Application { private final TableView<Name> table = new TableView<>(); private final ObservableList<Name> data = FXCollections.observableArrayList(new Name("Jacob"), new Name("Isabella"), new Name("Ethan"), new Name("Emma"), new Name("Michael")); public static void main(String[]...

Triggering a javascript event with inline parameters

javascript,html,forms,anchor,contextmenu
I have a form on my website which is submitted by clicking a link. I am trying to create a custom context menu so that a user can open the submitted form in a new tab, if desired. Because the pages are generated dynamically with cgi, the parameters of the...

How to add a live `directory ` template to PyCharm's `New` context menu?

intellij-idea,contextmenu,pycharm
In PyCharm, right clicking a folder in the "Project" hierarchy or pressing Alt + Insert will pop-up a context menu like the below image. For my projects, i create modules, and their base structure has many files. So how do i add a "Directory Template" in the context menu. Just...

Keep context menu open after user clicks checkbox?

google-chrome-extension,contextmenu
I have also asked this question here at the chromium Google group. I would like to be able to keep a context menu open even after a user checks, or unchecks, a checkbox. My plugin allows users to check which devices they are using when testing and when testing multiple...

How to gray out some context-menu options with an IExecuteCommand-based shell extension?

c++,windows,shell,winapi,contextmenu
When implementing a context-menu shell extension using the IExecuteCommand approach (as described in this blog post), how can a given menu option be grayed out? E.g. Suppose that the shell extension offers some menu options, and some of them should be grayed out basing on some state and conditions that...

picturebox click event fires before the picturebox's contextmenu menuitem click

c#,winforms,contextmenu,picturebox
I have a PictureBox.Click event and I also have a PictureBox.ContextMenu -- when I click on a menu item within the context menu, it fires the PictureBox.Click event first, then the event attached to the menu item. This is not what I want. Is there a way to fire the...

how to unbind/prevent context menu by keybord (key #93) with FF?

javascript,firefox,events,contextmenu,unbind
I want to prevent the default event on key #93 ("select key", between "alt gr" and "ctrl right" on AZERTY keybord). This key open context menu like right click. I tried : $(document).off('keydown'); $(document).off('keyup'); $(document).off('keypress'); $(document).on('keypress', function(e){ if(e.keyCode == 93) { e.preventDefault(); return false; } }); $(document).on('keyup', function(e){ if(e.keyCode ==...

jQuery contextmenu know what triggered

jquery,contextmenu
I'm currently using this contextmenu plugin: http://medialize.github.io/jQuery-contextMenu Now I've got a list on which I've bound a menu. The menu itself is working. But I need to know what element in the list has triggered the contextMenu, when I click on an item in the list. As far as I...

How to check if context menu has been closed?

contextmenu,visible,nw.js
I've been searching to see if there is a way to check whether the context menu in a nw.js app has been closed(if you click away from the menu or on another window, etc so that the menu disappears). I haven't been able to find an answer. I have it...

Disable application taskbar icon's context menu in Windows 8.0 and 8.1

windows,winapi,visual-c++,contextmenu,windows-taskbar
In Windows 7, 8 and 8.1, when a user right-clicks on an application's taskbar icon, a context menu appears. Furthermore, a user can right-click on the application's name again (from the context menu) and another context menu appears, as shown in this image for Windows Explorer: Is there a possible...

Context menu in list HTML / CSS / JavaScript / jQuery

javascript,css,twitter-bootstrap,menu,contextmenu
What is the best way to implement a menu for web in a list mode? What I have: a list view of some items on a client website that looks exactly like a finder (mac) window in list view. What I need: a way to implement a menu like the...

ContextMenu too-wide WPF

wpf,mvvm,contextmenu
I have built a ContextMenu dynamically using MVVM. The problem is : the content of MenuItems is all in right side ==> too wide ContextMenu. Do you have any ideea which is the problem? Thanks Here is the code in XAML: <TreeView.ContextMenu> <ContextMenu Name="RightClickMenu" ItemsSource="{Binding Path=SelectedItem.MenuItemsList}"> <ContextMenu.ItemTemplate > <DataTemplate> <!--...

Chrome Context menu is generating incorrect link

javascript,google-chrome,url,google-chrome-extension,contextmenu
I have written a context menu code similar to Google's Search in Google for '...' The code is working fine up to showing menu option and clicking. After selecting the menu option, new tab is created but Chrome tries to load chrome-extension://acpffpbkehpfofhgilcophibgbkhmmba/https://www.google.co.in/search?q=Wikipedia instead of https://www.google.co.in/search?q=Wikipedia. Please suggest what could be...

jQuery context menu item only clicked on text

jquery,css,contextmenu
When clicking an item in the context menu: It only works when clicking directly on the text. It would be nice if it can also work when clicking on the empty space next to the text. Here is the jsFiddle. (The fiddle doesn't seem to work although it works in...

Catching Modifier-Keys in WPF ContextMenu

wpf,contextmenu
I would like to use the LeftAlt and RightAlt keys to alter MenuItems within an open ContextMenu. I want this all happen while the menu is already open - not while right mouse is clicked to open the context menu. I did the following: ContextMenu.KeyDown += ContextMenu_KeyDown; void ContextMenu_KeyDown(object sender,...

preventDefault on mouse up

javascript,contextmenu,fabricjs,preventdefault
this code doesn't work. How can I prevent context menu in fabrics? canvas.on('mouse:up', function(options) { if(options.target){ switch(options.e.button){ case 0: // left click break; case 2: // right click options.e.preventDefault(); break; } } }); ...

WPF listbox with contextmenu canexecute not called until something selected

wpf,listbox,contextmenu,commandbinding
I have a ListBox the ItemTemplate bound to an ObservableCollection of my items. At the moment, I'm trying to implement Cut/Copy/Paste/SelectAll (To keep it short, I'll just show selectall here...) <UserControl.CommandBindings> <CommandBinding Command="SelectAll" CanExecute="SelectAll_CanExecute" Executed="SelectAll_Executed"/> </UserControl.CommandBindings> <ListBox x:Name="listbox" ItemsSource="{Binding}" Background="Transparent" SelectionMode="Extended" ScrollViewer.VerticalScrollBarVisibility="Auto">...

Disable/Enable context menu item depending on listview item

c#,.net,wpf,xaml,contextmenu
I have a UserControl with a ListView in it. In addition I have a class listViewItems.cs with a DisplayMemberBinding to a GridView in listView. Each ListView-Item has a context-menu. Now I'm trying to enable/disable the context-menu-items depending if a value in class ListViewItems is null I've tried a binding to...

Hide All Other Context Menu When One Is Opened

javascript,jquery,contextmenu
It's jquery Context menu plugin. working all fine but i need to hide all context menu when any other context menu is being opened. here is link of the plugin ContextMenuPluginLink ...

Change BackColor of ToolStripItem on Mouse Over [duplicate]

c#,winforms,design,contextmenu
This question already has an answer here: How to change Menu hover color - WINFORMS 2 answers So I have a MenuStrip in C# which I am trying to do a darkish theme for, but when I press the button for the dropdown menu well.... Is there a way...

ContextMenu in ListView, click on a menuitem doesn't fire the expected command

c#,wpf,listview,contextmenu,commandparameter
I have a listview, with contextmenu associated to each listviewitem. But a click on a menuitem doesn't call the corresponding Command myCommand. myCommand is linked to a "Execute" and a "Can Execute" methods. The "Can Execute" method works, but not the "Execute" one. it has a parameter. If I remove...

Qt5 custom context menu ignoring style sheet

qt,contextmenu,qss,qmenu,qstylesheet
I have a two editor classes, say BaseEditor and AdvancedEditor. BaseEditor inherits from QPlaintTextEdit and its standard context menu follows my style sheet properly. My AdvancedEditor now inherits from BaseEditor and reimplements the method void showContextMenu(const QPoint &point) to generate a custom context menu. In it I basically do the...

Proper way to restore a default contextmenu for an edit control?

.net,vb.net,winforms,inheritance,contextmenu
I'm in a situation where I want to decide whether to disable or enable the default edit contextmenu of a subclassed TextBox control, I've written this: Public Property DisableEditMenu As Boolean = False ''' <summary> ''' Raises the <see cref="E:System.Windows.Forms.Control.Enter"/> event. ''' </summary> ''' <param name="e">An <see cref="T:System.EventArgs"/> that contains...

How to enable or disable menu items based on SelectedItems in ListBox

c#,wpf,listbox,contextmenu
Is there a way to do this when the ContextMenu itself is defined inside the ListBox? I have my ListBox set up like this: <ListBox Name="lbxFoundFiles" Margin="10,115,10,5" SelectionMode="Multiple" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ItemsSource="{Binding FoundFilesInfo}" ItemTemplate="{DynamicResource FoundFilesListItem}"> <ListBox.ContextMenu> <ContextMenu> <MenuItem Name="cmiCopyClipboard" Header="Copy file to clipboard" Click="cmiCopyClipboard_Click" IsEnabled="{Binding...

WPF Merge ContextMenues in XAML

wpf,xaml,contextmenu
is it possible to merge two ContextMenues in XAML? I created two ContextMenues as resources. I use them in a couple of DataTemplates and it works fine. However, for some DataTemplates, I would like to merge the two ContextMenues. Unfortunately, this does not seem to work. Here's a bit of...

Javascript event.button returns no value for right click

javascript,jquery,html,contextmenu,right-click
I am trying to create a custom context menu for my website. I have been unable to accomplish the first task, which would be capturing and preventing the default of a right click. I have tried the following: function rclick(event) { if (event==null) {event = window.event;} var target = event.target...

WPF: get my object after ListView context menu right click instead of item index

wpf,listview,contextmenu
I have ListView contains my object: public ObservableCollection<MyObject> objects { get; set; } This is my Context menu right click event: private void MenuItem_Click(object sender, RoutedEventArgs e) { if (myListView.SelectedIndex == -1) return; int index = myListView.SelectedIndex; } So instead of take this index and find my object in my...

Qt press left click twice for context menu to dissapear

qt,contextmenu
I'm trying to use a context menu from Qt when I press right click. Here is what I've tried: connect(mtreeView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&))); Then void MainTreeViewController::showContextMenu(const QPoint& pos) { QPoint globalPos = mtreeView->mapToGlobal(pos); QMenu rightClickMenu; rightClickMenu.addAction(QString("Option")); rightClickMenu.exec(globalPos); } When I press right click, the menu appears, then if...

Add item above “Project” in eclipse project explorer contextmenu

eclipse,eclipse-plugin,ide,contextmenu,project-explorer
Iam working on a Eclipse based customizedIDE for our development environment. Here in a new perspective i have included a "Project Explorer" and in that iam able to add commands in the context menu but when i include A new Wizard (A project Wizard) in the "new" type it is...

Why does Source for ContextMenuOpening behave differently for Canvas and UserControl?

c#,wpf,events,contextmenu,source
I have a simple window: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:self="clr-namespace:WpfApplication1" Title="MainWindow" Height="435" Width="613"> <StackPanel> <Canvas Name="canvas"> <self:Red /> </Canvas> <UserControl Name="uc"> <self:Blue /> </UserControl> </StackPanel> </Window> Redand Blueare very simple UserControls: <UserControl...

Python Executable “Opened With…” (Windows)

python,windows,contextmenu
I've made a little Python (3.x) script and compiled it to a *.exe file using Py2Exe. What I would like is to click on a random file in explorer and "open it with..." (using the right mouse button) my executable. My program can then use the path of the selected...

How to get the input value from $(this).context

javascript,jquery,input,fullcalendar,contextmenu
My Full calender external events are displayed as following <?php foreach ($plants as $plant) { ?> <div class='fc-event evt'> <input type="hidden" value="<?php echo $plant->hcpd_id;?>" class="abc"> <p class="evt_name"><?php echo $plant->hcpd_name;?></p> </div> <?php } ?> And this is my jquery $('#external-events2 .fc-event').each(function() { var str = $(this).context; $(this).data('event', { title: $.trim($(this).text()), stick:...

Chrome Extension trouble with getting a ContextMenu to only load for a specific page

javascript,google-chrome,google-chrome-extension,contextmenu
I've started with the contextMenu example from Google. It creates a context menu using a background page which applies to all pages. I'm looking for a way to create the context menu's only specifically for a page. The example page I'm trying to target is any Reddit page. My manifest.json:...

Android toolbar context menu for listview items

android,android-listview,menu,contextmenu,android-toolbar
I am looking for help on how to implement a context menu in the toolbar for ListView items, like WhatsApp does it. The only tutorials I found so far are about a dialog that pops up, which is not what I want. Can someone help me or provide links with...

highlighting selected item in custom list view using context menu?

android,xml,android-layout,listview,contextmenu
I've been trying to set my background colour on this list view and with following multiple tutorials it just doesn't come up, yet no errors are shown. What I've got is an xml file called colours in the values folder: <resources> <drawable name="red_colour">#6D0E0E</drawable> </resources> Which links to an xml in...

Caliburn Micro and ContextMenu results in target not found

c#,wpf,contextmenu,caliburn.micro,caliburn
To start with, I have this situation: <components:ImageButton ImageSource="../Resources/Images/test.png" Height="32" Width="32" Style="{StaticResource MenuButtonWithContextMenuStyle}"> <components:ImageButton.ContextMenu> <ContextMenu> <MenuItem Header="Test" cal:Message.Attach="Test"/> </ContextMenu> </components:ImageButton.ContextMenu> </components:ImageButton> Along with this style: <Style TargetType="{x:Type components:ImageButton}"...

Create a menu and action on right click on a textbox

javascript,contextmenu,right-click
I want to create a menu for right click on a text box and upon clicking on that option I should be able to call a js function. How should I do it? Can anybody please help me? My code for the text box is: <g:textField size="40" name="txtBoxId" id="txtBoxId" title=""...

Error when getting ContextMenu and adding new item

contextmenu,javafx-8,menuitem
So I have controller class with this object: @FXML private TextArea textArea; then Im trying to add new MenuItem to its standard Items(that is "copy" and "select all") @Override public void initialize(URL location, ResourceBundle resources) { ContextMenu contextMenu = textArea.getContextMenu(); X contextMenu.getItems().add(new MenuItem("chuj")); textArea.setContextMenu(contextMenu); and line marked with X gets...

WPF context menu won't fully close before data heavy operation

wpf,contextmenu,dispatcher,close
I have a WPF application where a data-intensive operation is called by a context menu selection. I'm using Dispatcher to run the data-heavy operation in the background, but the context menu does not fully close before it begins - it starts to close (i.e. fade) but doesn't disappear completely before...

How do I add my own option to Finder's right click menu?

objective-c,osx,cocoa,contextmenu,finder
I have an app that basically takes a file path(s) and copies the data name and extension from it to be used in my app. I was wondering how to add on to the Finder right click menu (like Dropbox does) and do run some Objective-C code when clicked. (I...