mouseevent

Is accessing the ViewModel in code behind always violating the MVVM pattern?

人走茶凉 提交于 2019-12-05 00:51:55
问题 One thing I am really not sure about is how to properly pass mouse events to the ViewModel. There is the way of binding triggers using the interactivity extension like for instance in: WPF event binding from View to ViewModel? But this does not forward the MouseEventArgs to my knowledge, and this solution does not appear very elegant to me. So what would be the proper solution? One way is to register an event and to handle it in the code behind, e.g.: private void ListBox_PreviewMouseDown

Is there any way to disable some DOM element from capturing mouse events?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 23:44:06
I have an element which is on top of another element. I want to capture the mouseover event with the bottom element, but when the mouse cursor is over the top element the bottom element is not receiving the mouseover events. Is there any way to disable the top element from receiving mouse events? Ryan Rapp Elements can be easily disabled from receiving mouse events using, in your example, the following CSS: #region2 { pointer-events: none; } For more discussion, see this SO post . This is the best I can come up with. You could probably get pretty elaborate, but (to my knowledge) the greater z

Refill a SVG Path with onMouseEntered event in JavaFX

寵の児 提交于 2019-12-04 22:41:19
i'm working on a personal project which includes a .fxml document(created from a .svg file with NetBeans). Here is the Map as you can see.Moreover, all the regions are converted into a SVG Path in .fxml file. The thing is i can handle with mouse events with using JavaFX Scene Builder with a controller class however, i want to refill (or in other words repaint or highlight ) the region whenever mouse is entered on it. Here is main class public class JavaFXApplication1 extends Application { @Override public void start(Stage primaryStage) throws IOException { Parent root = FXMLLoader.load

how to implement mousemove while mouseDown pressed js

时光怂恿深爱的人放手 提交于 2019-12-04 21:32:25
问题 I have to implement mouse move event only when mouse down is pressed. I need to execute "OK Moved" only when mouse down and mouse move. I used this code $(".floor").mousedown(function() { $(".floor").bind('mouseover',function(){ alert("OK Moved!"); }); }) .mouseup(function() { $(".floor").unbind('mouseover'); }); 回答1: Use the mosemove event. From mousemove and mouseover jquery docs: The mousemove event is sent to an element when the mouse pointer moves inside the element. The mouseover event

which JLabel has been clicked?

和自甴很熟 提交于 2019-12-04 21:23:34
I have 6 JLabel and each is having a different instance of a mouselistener class attached. How to know which JLabel has been clicked ? These JLabel form a two dimentional array. John Snow You use getSource to get a refrence to the object which is clicked on: label1.addActionListener(new yourListener()); label2.addActionListener(new yourListener()); public class yourListener extends MouseAdapter{ public void mouseClicked(MouseEvent e){ JLabel labelReference=(JLabel)e.getSource(); labelReference.someMethod(); } } The easiest way I did something like that was, to use JButtons and make them look

OpenCV 2.3 with VS 2008 - Mouse Events

梦想与她 提交于 2019-12-04 20:44:31
问题 Obligatory - I'm a newbie. Have a job that involves programming and I'm teaching myself as I go. Needless to say as a teacher I get things wrong frequently and thoroughly. Where I'm at right now: I've created the class "Graph", it (surprisingly enough) makes graphs. But now I want to make it so that on a mouse click I modify the graph. But I can't seem to get a mouse handler to be a member function of the class. cv::setMouseCallback(windowName, onMouse, 0); // Set mouse handler to be onMouse

How can I only run an AJAX call on change when the mouse (or finger) is no longer dragging?

落花浮王杯 提交于 2019-12-04 18:12:18
I have series of interactive sliders that change calculated values. The calculations run on every tiny move of a dragged handle (via mousedown or touch drag event). I need to update a database with the values but would prefer only to grab the values after the user "drops" the handle. How can I determine if a finger or mouse is down, in order to skip the AJAX call? function handleIsBeingDragged() { // calculations based on all the input values here // pseudo-code to check for mouseup event if (mouseUp) { // save only if mouse is now up - to avoid hundreds of updates per drag event $.ajax(); } }

WindowScrollWheelFcn with slider in Matlab GUI

て烟熏妆下的殇ゞ 提交于 2019-12-04 17:21:50
I'm making a GUI in Matlab that scrolls through and displays ~600 medical images. I have an axes on which the images are displayed, and a scrollbar that presently goes through images one at a time when the end arrows are pressed. I'm trying to figure out how to incorporate the WindowScrollWheelFcn so I can use the scroll on the mouse to go through the images faster. This is my code: function ct_slider_Callback(hObject, eventdata, handles) set(gcf, 'WindowScrollWheelFcn', @wheel); set(gcf, 'CurrentAxes', handles.ct_image_axes); handles.currentSlice = round(get(handles.ct_slider, 'Value'));

How to use mouseDown and mouseUp on <button/> [duplicate]

拜拜、爱过 提交于 2019-12-04 15:55:00
This question already has answers here : WPF MouseLeftButtonUp Not Firing (3 answers) Closed 6 years ago . I have a button declared in XAML which has MouseDown and MouseUp attributes that both call a specified method... <Button x:Name="btnBackward" Content="Backward" MouseDown="btnBackward_MouseDown" MouseUp="btnBackward_MouseReleased" Width="50" Height="25" Margin="65,400,377,45"/> However, the method btnBackward_MouseReleased is never called. private void btnBackward_MouseReleased(object sender, System.Windows.Input.MouseEventArgs e) { Console.WriteLine("mousereleased"); this.isRewinding =

JavaFx Transparent window - yes please. Mouse transparent - no thanks

非 Y 不嫁゛ 提交于 2019-12-04 14:43:09
I would like to create a simple JavaFx class that shows the user a translucent rectangle (say an arbitrary 50% transparency) covering the users screen. It should simply allow me to get the Point of a mouse click event. This sounds trivial, but when I create transparent windows they always seem to be transparent to mouse events rather than just my requirement of semi-transparent visibility. The mouse event is never triggered. I've used setMouseTransparent(false) on the rectangle and the root pane, but this makes no difference. I'd be really grateful if somebody could indicate any errors