click

Detect mouse click location within canvas

笑着哭i 提交于 2019-12-07 15:16:37
问题 I'm having a real issue trying to define a function for where I click on empty space. So far I have managed to define where I click on an object - of which there are 10 - but now I need a separate function for when I am not clicking on any of the objects. The general idea can be found at http://deciballs.co.uk/experience.html. The objects are the rings. My code is below... Any ideas? var shapeObj = function (context, canvas, settingsBox, radius) { this.ctx = context; this.canvas = canvas;

Simple ajax call not working with button click

两盒软妹~` 提交于 2019-12-07 13:11:50
问题 I am using Encosia's sample from his website on how to use ajax call When I click on the div it's working fine and when I replace button instead of div it's refreshing the whole page and I don't find any errors in firebug. Here is my code: Script: <script type="text/javascript"> $(document).ready(function () { // Add the page method call as an onclick handler for the div. $("#getdate").click(function () { $.ajax({ type: "POST", url: "Default.aspx/GetDate", data: "{}", contentType:

GTK+ (2.0) - signal “clicked” on GtkEntry?

安稳与你 提交于 2019-12-07 11:30:10
问题 I'm testing some signals with GTK+ 2.0. I'm looking for a way to get a signal emitted when I click on a GtkEntry. if (widgets_info[i].action & IG_INPUT) { widget->frame[i] = gtk_entry_new_with_max_length(MAX_INPUT_LENGTH); gtk_entry_set_text(widget->frame[i], widgets_info[i].text); catch_signal(widget->frame[i], MY_SIGNAL, &change_entry, widget); } I have a pre-selected text in my entry ( widgets_info[i].text ) and i want this text to disappear if the user click on my GtkEntry. Does someone

How to display a popup menu by mouse left click in swt?

故事扮演 提交于 2019-12-07 10:58:53
问题 How to display a popup menu by mouse left click? I know the default is for mouse right click. But I want to expand(display) the menu just by a normal selection of a button. (by normal left click). How to popup a popup menu by normal right click is as follows. final Button btnNewgroup = new Button(compositeTextClient, SWT.NONE); Menu menu = new Menu(btnNewgroup); btnNewgroup.setMenu(menu); MenuItem mntmNewItem = new MenuItem(menu, SWT.NONE); mntmNewItem.setText("New Item"); MenuItem

How to prevent react component click event bubble to document?

时光总嘲笑我的痴心妄想 提交于 2019-12-07 09:58:32
How to prevent react component click event from bubble up to document ? I can sure that there must be something was wrong with it! So, may be I should help myself fix it! I just have a box component which has a click event listener, and there are some link components in that box which are effected by a document click event. How can I remove this document click event? Can someone do me a favor? More details info can be found in following links! Here is the code link : https://github.com/ant-design/ant-design/issues/6576 Click has no effect, it should link to item3 ! Remove document 's click

VBA Check if button has been clicked

余生长醉 提交于 2019-12-07 09:44:24
问题 I think this is an easy fix, but I've been stuck at this trouble spot for hours now. Basically in the excel worksheet I have two buttons assigned to macros: 1 and 2. If the user clicks 1 first and then clicks then 2, 2 runs off of some of the variables from 1. But I need 2 to be able to operate independently if 2 is clicked first. Therefore, I need some way in the 2 code to ask if 1 button has been clicked. Both 1 and 2 are public subs. I think there is something that I am missing with the

affect only the clicked element in jquery for multiple elements with same class

情到浓时终转凉″ 提交于 2019-12-07 09:20:55
问题 i've been looking all over for a solution to this but i just can't figure out how. what i want is for the specific header that was clicked to be the only one to expand. demo is here: http://jsfiddle.net/bm92L0eg/1/ html: <h3 class="click-list">header a</h3> <ul class="open-list"> <li>item</li> <li>item</li> <li>item</li> </ul> <h3 class="click-list">header b</h3> <ul class="open-list"> <li>item</li> <li>item</li> <li>item</li> </ul> <h3 class="click-list">header c</h3> <ul class="open-list">

NSButtonCell in NSTableView: click handling

倖福魔咒の 提交于 2019-12-07 09:08:38
问题 I set NSButtonCell as a cell type in a Table Column in my NSTableView . I implemented an IBAction method, but I can't wire it with NSButtonCell in IB - the wire don't want to highlight a button from NSTableView . How to connect a method with NSButtonCell ? Or maybe there'se another way to handle its click event? Thanks 回答1: You should be able to wire up a connection from the cell by control+dragging to any object in your NIB. Just make sure the cell is actually selected, and that your action

Pop-up menu using mouse rightclick in JUNG

时光总嘲笑我的痴心妄想 提交于 2019-12-07 07:36:15
问题 I want to create a pop-up menu, which will appear if i right clicked on the canvas . How can I do this? which function should i modify? Any help would be appreciated. 回答1: Following code will create a popup menu when right-clicking either on the vertex or on the canvas... /** * a GraphMousePlugin that offers popup * menu support */ protected class PopupGraphMousePlugin extends AbstractPopupGraphMousePlugin implements MouseListener { public PopupGraphMousePlugin() { this(MouseEvent.BUTTON3

Sending a Mouse Click to a Specific Position without Moving the Mouse

不打扰是莪最后的温柔 提交于 2019-12-07 07:10:24
问题 I'm looking to send a mouse click to a specific position on a screen without affecting the mouse cursor's location. I've scoured and have tried everything under the sun with mouse_event (which is supposed to do this) mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0); However this ends up only sending a mouse click to wherever the position of the mouse is. So I end up having to move the mouse to get it to work. Cursor.Position = new Point(X, Y); Anyone have any idea how I can