mouseevent

How to disable the delivery of mouse events to the widget but not its children in Qt?

别来无恙 提交于 2019-12-02 23:43:18
For the last two days, I've been searching for a way to pass mouse events to the widgets behind a widget used as a container/parent for it's children. I know there is a way to make a widget transparent for mouse events like this: QWidget w; w.setAttribute( Qt::WA_TransparentForMouseEvents ); But this also disables the delivery of mouse events to its children! I want the children of the front widget and the widgets behind the front widget to receive the mouse events. Qt::WA_TransparentForMouseEvents: When enabled, this attribute disables the delivery of mouse events to the widget and its

Change style of surrounding border on mouse over

∥☆過路亽.° 提交于 2019-12-02 20:42:08
I have a Grid with a Border around it. Upon mouse over on the Grid , I want to change the style on the Border . How would I go about doing this? This is what I've tried, without any success so far: <Border Name="Border" BorderBrush="Transparent" BorderThickness="1" CornerRadius="2"> <Grid> <Grid.Style> <Style TargetType="{x:Type Grid}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="Border" Property="BorderBrush" Value="#FFB9D7FC" /> </Trigger> </Style.Triggers> </Style> </Grid.Style> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid

Why is the TreeViewItem's MouseDoubleClick event being raised multiple times per double click?

可紊 提交于 2019-12-02 20:31:12
XAML <TreeView Name="GroupView" ItemsSource="{Binding Documents}"> <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <EventSetter Event="MouseDoubleClick" Handler="OnTreeNodeDoubleClick"/> </Style> </TreeView.ItemContainerStyle> .... </TreeView> Code-Behind private void OnTreeNodeDoubleClick(object sender, MouseButtonEventArgs mouseEvtArgs) { Console.WriteLine("{3} MouseDoubleClick Clicks={0} ChangedButton={1} Source={2} Handled={4} ButtonState={5}", mouseEvtArgs.ClickCount, mouseEvtArgs.ChangedButton, mouseEvtArgs.OriginalSource, mouseEvtArgs.Timestamp, mouseEvtArgs

Handling Mouse Events in MVVM in WPF

倖福魔咒の 提交于 2019-12-02 19:45:25
I am Using MVVM with WPF. i am halted in a way, i want your views about this. i am firing Mouse Events using MouseBehaviour.cs class , Is there any other way to handle Mouse Events in MVVM WPF using System.Windows; using System.Windows.Input; namespace Lovatts.MouseBehaviours { public class MouseBehaviour { #region MouseUp public static readonly DependencyProperty MouseUpCommandProperty = DependencyProperty.RegisterAttached("MouseUpCommand", typeof(ICommand), typeof(MouseBehaviour), new FrameworkPropertyMetadata(new PropertyChangedCallback(MouseUpCommandChanged))); private static void

change cursor to finger pointer

老子叫甜甜 提交于 2019-12-02 16:26:48
I have this a and I don't know that I need to insert into the "onmouseover" so that the cursor will change to finger pointer like a regular link: <a class="menu_links" onclick="displayData(11,1,0,'A')" onmouseover=""> A </a> I read somewhere that I need to put: onmouseover="cursor: hand (a pointing hand)" But it's not working for me. Plus I'm not sure if this is considered JavaScript, CSS, or just plain HTML. <a class="menu_links" onclick="displayData(11,1,0,'A')" onmouseover="" style="cursor: pointer;"> A </a> It's css. Or in a style sheet: a.menu_links { cursor: pointer; } You can do this in

JavaScript click handler not working as expected inside a for loop [duplicate]

廉价感情. 提交于 2019-12-02 16:01:45
This question already has an answer here: How do JavaScript closures work? 86 answers I'm trying to learn JS and got an issue. I tried many things and googled but all in vain. Following piece of code doesn't work as expected. I should get value of i on click but it always returns 6. I'm pulling my hair out., please help. for (var i = 1; i < 6; i++) { console.log(i); $("#div" + i).click( function() { alert(i); } ); } jsfiddle Working DEMO This is a classic JavaScript closure problem. Reference to the i object is being stored in the click handler closure, rather than the actual value of i .

how to change Jtable image from one column to another column using mouse click event?

白昼怎懂夜的黑 提交于 2019-12-02 15:42:46
问题 I am trying to use the following java class to add an image to a Jtable. It has worked properly. My problem is when I try to change the third column picture to second column (swap) using a mouse click event. But it will not work. I change the place of testIcon2 , testIcon1 in the mouse click event. First I load the image like Object[][] data = {{testIcon, "book1"}, {testIcon1, "book2"}, {testIcon2, "book3"}, {testIcon3, "book4"}}; In mouse click: Object[][] data1 = {{testIcon, "book1"},

java: TrayIcon right click disabled on Mac OsX

℡╲_俬逩灬. 提交于 2019-12-02 14:53:03
问题 I'm trying to develop a Mac OsX app provided by a system tray icon, so after the first attempt with the simplest code to achieve it I noticed that every apps tray icon's (both system and user apps) on mac osX (10.8) allows to activate the relative popup menu with both left and right click on it but with my project only the left (MouseEvent.BOTTON1) button causes the popup menu to pulldown. Here's my code: public class SystemTrayDemo { private SystemTray tray; private TrayIcon tray_icon;

JFrame Glasspane is also over JDialog but shouldn't

假如想象 提交于 2019-12-02 13:13:28
I have a JFrame (undecorated) with a Glasspane. This Frame opens a JDialog (also undecorated and has also a glassPane) and hides itself (setVisible(false)). The Glasspanes are set with .setGlassPane(). The Dialog is opened with the Frame as owner. The GlassPane extends a JPanel and implements AWTEventListener. I use it for resizing the Frames and Dialogs, so it knows it's parent (the Frame/Dialog) - this is called "target". The Events inside the GlassPane are handled like this: public void eventDispatched(AWTEvent event) { if (target instanceof JFrame) { e = SwingUtilities.convertMouseEvent( (

How to click and drag something without it deselecting

浪尽此生 提交于 2019-12-02 12:24:09
The program is an animation that creates a car and/or truck icon on the screen. The way I have it now it isn't working correctly. Specifically, the program is not clicking and dragging right. If one object is not-selected, once clicked on, it will become bolder to show that it is selected. From there we want to be able to drag it and the program will redraw the image wherever the mouse goes. If the image is un-selected, when I click and drag it, it works fine. The problem I am having is if the image is already selected. If the image is already selected, when I move the mouse over to it and