right-click

Cocoa: Right Click NSStatusItem

随声附和 提交于 2019-11-27 12:55:46
I am a .Net developer who need to port a small project into Mac, so I know next to nothing about Objective C. In fact the code below was just a bunch of grasping at straws and shooting in the dark. Trying to build a Status Menu program that opens one or another window depending on if it is a left-click or a right-click/ctrl+click. Here is what I have, and it works for left-click only (obviously): -(void) awakeFromNib{ NSBundle *bundle = [NSbundle mainBundle]; statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain]; [statusImage = [[NSImage alloc]

Right click to select a row in a Datagridview and show a menu to delete it

人盡茶涼 提交于 2019-11-27 11:17:54
I have few columns in my DataGridView, and there is data in my rows. I saw few solutions in here, but I can not combine them! Simply a way to right-click on a row, it will select the whole row and show a menu with an option to delete the row and when the option selected it will delete the row. I made few attempts but none is working and it looks messy. What should I do? Data-Base I finally solved it: In Visual Studio, create a ContextMenuStrip with an item called "DeleteRow" Then at the DataGridView link the ContextMenuStrip Using the code below helped me getting it work. this.MyDataGridView

How to distinguish between left and right mouse click with jQuery

谁都会走 提交于 2019-11-27 07:34:05
问题 How do you obtain the clicked mouse button using jQuery? $('div').bind('click', function(){ alert('clicked'); }); this is triggered by both right and left click, what is the way of being able to catch right mouse click? I'd be happy if something like below exists: $('div').bind('rightclick', function(){ alert('right mouse button is pressed'); }); 回答1: As of jQuery version 1.1.3, event.which normalizes event.keyCode and event.charCode so you don't have to worry about browser compatibility

Right Clicking on JButton

倖福魔咒の 提交于 2019-11-27 05:37:36
trying to add a mouseAdapter to a JButton for a right click to flag the cell. Problem is when I instantiate it onto the button, it won't let me. Maybe because it already has an actionlistener on it? I'm not too sure. Any help is appreciated. I'm creating a Minesweeper game, fyi. button = new JButton[size][size]; ButtonListener bl = new ButtonListener(); for (int r = 0; r < size; r++) { for (int c = 0; c < size; c++) { button[r][c] = new JButton(""); button[r][c].addActionListener(bl); button[r][c].addMouseListener (new MouseAdapter());`` // error message: cannot instantiate the type

How to pass in multiple file/folder paths via a right-click event (verb) to an executable?

可紊 提交于 2019-11-27 04:53:35
Related: How to add new items to right-click event on Folders and Files in Windows? I added custom right-click verb to all files by adding registry keys to HKEY_CLASSES_ROOT\*. End result looks like this HKEY_CLASSES_ROOT*\Shell\TestRightClick\Command -------Default = c:\RightClickTest.exe "%1" Problem: when selecting multiple files c:\RightClickTest.exe will be called several times(number of selected files) What I need: pass-in multiple files paths to one executable As I stated in the previous question, you're going to have to be intelligent about this inside your application. One instance of

wpf listview right-click problem

泪湿孤枕 提交于 2019-11-27 03:30:02
问题 so I have attached a context menu (right-click menu) to a wpf listview. unfortunately, when you right-click it brings up both the menu and selects whatever item you are over. Is there a way to shut off this right-click select behavior while still allowing the context menu? 回答1: The key is setting the PreviewMouseRightButtonDown event in the correct place. As you'll notice, even without a ContextMenu right clicking on a ListViewItem will select that item, and so we need to set the event on

Adding a right click menu to an item

南笙酒味 提交于 2019-11-27 01:44:58
问题 I have been searching for a while for a simple right-click menu for a single item. For example if I right-click on a picture I want a little menu to come up with my own labels: Add, Remove etc. If anyone could help I would be most greatful. Thanks for looking. Here is the completed code: ContextMenu cm = new ContextMenu(); cm.MenuItems.Add("Item 1", new EventHandler(Removepicture_Click)); cm.MenuItems.Add("Item 2", new EventHandler(Addpicture_Click)); pictureBox1.ContextMenu = cm; 回答1: Add a

Java Swing JTable; Right Click Menu (How do I get it to “select” aka highlight the row)

心不动则不痛 提交于 2019-11-27 00:53:50
问题 Short: I need a "right-click event" to highlight the cell row. I am using a JTable inside a ScrollPane in Java Swing (Netbeans Matisse). I have a MouseClicked event listener on the JTable that does the following: if (evt.getButton() == java.awt.event.MouseEvent.BUTTON3) { System.out.println("Right Click"); JPopUpMenu.show(myJTable, evt.getX(), evt.getY()) } The problem is... whenever I execute a right click on the JTable, the row isn't highlighted (I set the selection to rows only btw). I

Cocoa: Right Click NSStatusItem

你离开我真会死。 提交于 2019-11-26 18:14:13
问题 I am a .Net developer who need to port a small project into Mac, so I know next to nothing about Objective C. In fact the code below was just a bunch of grasping at straws and shooting in the dark. Trying to build a Status Menu program that opens one or another window depending on if it is a left-click or a right-click/ctrl+click. Here is what I have, and it works for left-click only (obviously): -(void) awakeFromNib{ NSBundle *bundle = [NSbundle mainBundle]; statusItem = [[NSStatusBar

Right click to select a row in a Datagridview and show a menu to delete it

ε祈祈猫儿з 提交于 2019-11-26 15:29:57
问题 I have few columns in my DataGridView, and there is data in my rows. I saw few solutions in here, but I can not combine them! Simply a way to right-click on a row, it will select the whole row and show a menu with an option to delete the row and when the option selected it will delete the row. I made few attempts but none is working and it looks messy. What should I do? 回答1: I finally solved it: In Visual Studio, create a ContextMenuStrip with an item called "DeleteRow" Then at the