mouseover

Subclassing QLabel to show native 'Mouse Hover Button indicator'

半城伤御伤魂 提交于 2019-11-29 22:55:21
问题 I have a QLabel with a 'StyledPanel, raised' frame. It is clickable, by subclassing QLabel; class InteractiveLabel(QtGui.QLabel): def __init__(self, parent): QtGui.QLabel.__init__(self, parent) def mouseReleaseEvent(self, event): self.emit(QtCore.SIGNAL('clicked()')) However, a general opinion is that this 'Box' is not easily recognised as clickable. In an effort toward usability, I'd like the 'Box' to show it is clickable when the mouse is hovered over it. Obviously a reaction to a mouse

How to retrieve zoom factor of a WinForms PictureBox?

北城余情 提交于 2019-11-29 19:16:50
问题 I need the precise position of my mouse pointer over a PictureBox. I use the MouseMove event of the PictureBox. On this PictureBox, I use the "zoom" property to show an image. What is the correct way for getting the position of the mouse on the original (unzoomed) image? Is there a way to find the scale factor and use it? I think need to use imageOriginalSize/imageShowedSize to retrieve this scale factor. I use this function: float scaleFactorX = mypic.ClientSize.Width / mypic.Image.Size

MouseOver highlighting style returning to default after a second (Caused by Aero?)

不问归期 提交于 2019-11-29 17:30:31
I'd trying to style my ComboBoxes to match the rest of the UI but I'm having problems with the IsMouseOver highlighting. It highlights with the color I specify for a second and then fades back to the default color, kind of a cool effect but not what I'm going for. Here is my style: <Style TargetType="ComboBox"> <Style.Triggers> <Trigger Property="ComboBox.IsMouseOver" Value="True"> <Setter Property = "Background" Value="Red"/> </Trigger> </Style.Triggers> </Style> What can I do to make the background color stay? The problem is indeed due to the default template for the ComboBox. If you use

jquery continuous animation on mouseover

北城余情 提交于 2019-11-29 10:37:19
I am trying to have an animation run only when the mouse is over an object. I can get one iteration of the animation and then have it set back to normal on mouse out. But I'd like the animation to loop on mouseover. How would I do it, using setInterval? I'm a little stuck. Doug Neiner It could be done like this: $.fn.loopingAnimation = function(props, dur, eas) { if (this.data('loop') == true) { this.animate( props, dur, eas, function() { if( $(this).data('loop') == true ) $(this).loopingAnimation(props, dur, eas); }); } return this; // Don't break the chain } Now, you can do this: $("div

Change ListViewItem background colour on mouse over

放肆的年华 提交于 2019-11-29 10:03:52
I need some help here. I can't understand why none of the solutions I found work for my case. Let's consider a Listview with these items: <ListView.Items> <ListViewItem> <TextBlock xml:space="preserve"> 1 <Bold>I'm bold</Bold> </TextBlock> </ListViewItem> <ListViewItem> <TextBlock xml:space="preserve"> 2 Im not </TextBlock> </ListViewItem> </ListView.Items> Initially on hover each row I saw the highlight of the TextBlock in its default light blue. It only underlined the area with text: I don't want that highlight I want the one of the whole row, and I want to decide the colour. I also want the

How to detect a keypress AND a mouseover at the same time

若如初见. 提交于 2019-11-29 09:24:17
Okay so I can detect a mouseover using .on('mouseover') and I can detect keypresses using $(document).keypress(function(e) { console.log(e.which); } but how do I detect which image my mouse is hovering over when I press a certain button? the idea is to be able to delete an image by pressing d while hovering over it. any ideas ? You can just toggle a class or data-attribute that shows you which one is currently being hovered $('img').hover(function(){ $(this).toggleClass('active'); // if hovered then it has class active }); $(document).keypress(function(e) { if(e.which == 100){ $('.active')

How can I delay a MouseOver in Java?

南楼画角 提交于 2019-11-29 08:52:22
I've got a short question and I hope somebody can help me. Please look at the following code snippet: public void mouseEntered(MouseEvent e){ //wait 2 seconds. //if no other mouseEntered-event occurs, execute the following line //otherwise restart, counting the 2 seconds. foo(); } Can somebody help me with that problem? I want to realize a behavior like an ToolTip: you enter a region with your mouse. If your mouse stays in that position, do something. Start a Timer with a delay of 2 seconds in your mouseEntered() method that calls whatever it is you want to do. Set up a new handler (

Possible to make labels appear when hovering over a point in matplotlib in stem plot?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 05:08:44
I am new to matplotlib and I am looking to label stems in a stem plot with x,y co-od when mouse hovers over that point. When I searched everything was meant for scatter plot (Possible to make labels appear when hovering over a point in matplotlib? present code is like this: def plot_matching(mzs,ints,matching,scan_num): fig=p1.gcf() fig.canvas.set_window_title('MS/MS Viewer') rel_ints=relative_intensity(ints) p1.xlim(min(mzs)-100,max(mzs)+100) p1.ylim(min(rel_ints),max(rel_ints)+5) p1.title('Scan Number:'+scan_num) p1.xlabel('m/z') p1.ylabel('Relative intensity') mzs_rel=zip(mzs,rel_ints) for

Hover, mouseover and mouse out

牧云@^-^@ 提交于 2019-11-29 03:45:36
I'm learning and using jQuery and want to display a delete icon for some elements. I have an outer main div, which contains number of wrappers for elements. Inside the element wrapper, I want to display a delete icon when the user hovers over the element wrapper, and remove it when user moves out of the element wrapper. Using mouseover and mouseout , I can display and remove the icon, but as soon as I move my mouse over the delete icon it is removed because it fires the mouseout event for the element wrapper. What am I doing wrong? Two options for you : CSS's :hover pseudo-class (but only if

Writing a paint program à la MS Paint - how to interpolate between mouse move events?

倾然丶 夕夏残阳落幕 提交于 2019-11-28 21:37:16
I want to write a paint program in the style of MS Paint. For painting things on screen when the user moves the mouse, I have to wait for mouse move events and draw on the screen whenever I receive one. Apparently, mose move events are not sent very often, so I have to interpolate the mouse movement by drawing a line between the current mouse position and the previous one. In pseudocode, this looks something like this: var positionOld = null def handleMouseMove(positionNew): if mouse.button.down: if positionOld == null: positionOld = positionNew screen.draw.line(positionOld,positionNew)