w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Moving a DIV repeatedly by clicking and holding down the mouse button
You'd have to do it repeatedly yourself with a setInterval until you catch the mouseup event. If you want some code, see this answer

Categories : Jquery

Drawing a line while moving the mouse and holding the right-click button
Try this, you need to invalidate the panel on every draw. private IList<Point> _pointList = new List<Point>(); private void panel1_MouseMove(object sender, MouseEventArgs e) { _pointList.Add( e.Location ); panel1.Invalidate(); //force a repaint } private void panel1_Paint( object sender, PaintEventArgs e ) { e.Graphics.DrawLines( Pens.Black, _pointList ); }

Categories : C#

WPF host Win32 window frozen because of multiple WM_NCHITTEST when moving mouse over the bottom right corner
I found the solution by setting the size of Win32 window to be 1 pixel (both width and height) smaller than the WPF Host Window, the issue is gone. I think it's because both Win32 and WPF windows were sharing the same non-client area and the messages got looping.

Categories : Wpf

Fabric.js – element is undefined when I move the mouse holding down the mouse button
I'm not all that familiar with Fabric.js, so there might be a better solution, but here's my take on it: canvas.on('mouse:move',function(options){ var pt = { x: options.e.clientX, y: options.e.clientY }; if( circle.containsPoint(pt) ) { if( !circle.mouseOver ) { circle.mouseOver = true; console.log( 'over circle, yo' ); circle.set('opacity', 0.5); canvas.renderAll(); } } else if( circle.mouseOver ) { circle.mouseOver = false; circle.set('opacity', 1.0); canvas.renderAll(); } }); Basically we're doing all the heavy lifting to see if we're over the object of interest, and changing its properties when we first mouse over it, and then again when we mouse out of it. You can combine this

Categories : Javascript

Keeping slide-out div flush with left side of window upon window resize
Simply add: $(window).resize(function(e) { if ($("#slideout").css('left') != '0px') $("#slideout").css('left', -($("#slideout").width() - 15)); }); http://codepen.io/anon/full/rjaHD

Categories : Jquery

Moving the mouse cursor asynchronous
You could use a Thread or a BackgroundWorker like this: BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (s, ex) => { SetCursorPos(0, 0); }; bw.RunWorkerAsync();

Categories : C#

jQuery drop down menu's height increases after moving mouse cursor through it
$('.parent').mouseenter(function() { $(this).parent().find("ul").slideDown('fast').show(); }); $('.parent').mouseleave(function() { $(this).parent().find("ul").slideUp('fast').hide(); }); This should work fine...

Categories : Jquery

Events are lost after moving layer from within a "dragmove" callback
When you use a drag event, KineticJS create a temporary layer on top as a result of which your events where not getting registered after the dragmove. Just add another handler for dragend like this: scroller.on('dragend', function(event){ layer.moveToTop(); layer.draw(); }); And here is the updated fiddle. For more details/explanation on the problem you faced, check this: https://github.com/ericdrowell/KineticJS/issues/219

Categories : Javascript

What is the difference between tap , mouse left button down and mouse pressed events?
For all practical purposes, the Tap and Click events are equivalent for a Button. The Click event was originally defined in Silverlight for desktop Windows and it is only defined for the Button control (and derivatives such as HyperlinkButton). You can think of the Click event as the "traditional" way to handle a Button press. The Tap event was added to the framework in Windows Phone 7.1 (Mango). Tap is defined in the UIElement class, which is the parent of many types of controls. You can handle a Tap event in a TextBlock, Image, and many other controls. Button is subclassed from UIElement as well, and thus can also receive Tap events. It is redundant that a Button can receive both Tap and Click events. reference if u also read the second answer u can get some more info

Categories : C#

My inputcommand keybinding to main window does not work when child window is focussed(same wpf window)?
The key bindings will only work if the Form is focused. You could redirect every Command in your new Window to the Main Window Change your Constructor to of the new Window to accept a Main Window and save this window: MainWindow mainWindow; public Window(MainWindow w) { mainWindow = w; } Whenever a Keybinding executes just do something like this: mainWindow.TabPress(); And show the Window with Window childwindow = new Window(this) { Title = "ChildWindow", Width = 200, Height = 300 }; childwindow.Show();

Categories : C#

How to restore/minimize my VCL application when mouse cursor is on Top left corner with Delphi XE2?
There is no event for detecting when the mouse enters a given area of the screen. You would have to track the mouse yourself in a short timer to periodically calling the Win32 API GetCursorPos() function or reading the RTL TMouse.CursorPos property. You can then use the TScreen.WorkAreaRect or TMonitor.WorkareaRectproperty with the Win32 APIPtInRect()` function to detect whether the mouse is currently inside of the chosen corner or not. As for the key combination, look at the Win32 API RegisterHotKey() function and the WM_HOTKEY window message. Update: alternatively, you can use a "hidden" window that has an alpha opacity of 1 so that it is practically hidden to the user but not to Windows. Put the window where you need it, then use TrackMouseEvent() to receive notifications when the

Categories : Delphi

javascript/jquery : Window.open opens child window but after few seconds child window get automatically closed for some urls(for IE and chrome)
It's because this code is executed on init on https://wpc.gcsip.com/wpc/wpc page // check that this page is not in a subwindow (e.g. after a session time out) if ( window.opener ) { window.opener.location = "wpc"; window.opener.focus(); window.close(); }

Categories : Javascript

SDL - Why moving the mouse changes button state?
event.button.state is a bit mask. It is declared as a char which can hold eight bits representing different states of the buttons. typedef struct{ Uint8 type; Uint8 state; Uint16 x, y; Sint16 xrel, yrel; } SDL_MouseMotionEvent; More information here, http://www.libsdl.org/docs/html/sdlgetmousestate.html http://www.libsdl.org/docs/html/sdlmousemotionevent.html

Categories : C

Moving a div from below another to above upon window resize
The issue you're talking about is broadly known as responsive design. Sample code which demonstrates possible solution for your problem is shown below. It uses resize event on the window element, and then hides chosen element, based on the actual window width. The redesign method finally should contain any appropriate logic, which designs the view accordingly to its actual width: $(document).ready(function () { redesign(); $(window).resize(function(){ redesign(); }); }); function redesign(){ if ($(window).width() < 640) { $("#divA").hide(); }else{ $("#divA").show(); } } Look at jsFiddle sample (obviously resize the window to see some results). If you're interested in moving DOM elements in relationship to each other, check jquery ins

Categories : HTML

How to close a popup window when a button on the popup window is click?
In the parent window I placed a function called close_Popup(). function closePopup() { $.window.closeAll(); } And in the popup window I used also the codes below to call the function in the parent window to close the popup window. $("#no").click(function() { top.closePopup(); }); the "top" javascript function is used to call the function "closePopup()" that resides in the parent window and it solves the problem.

Categories : Misc

Java - Mouse out of window
Check for MouseListener.mouseExited(MouseEvent).

Categories : Java

open the link from the popup window in an external window and then close the original popup window
Try <input name="Apply Online" type="button" id="Apply Online" value="Apply Online" ONCLICK="window.location.href='some_url';$.colorbox.close();"> or <input name="Apply Online" type="button" id="Apply Online" value="Apply Online" ONCLICK="window.location.href='some_url';parent.$.colorbox.close();">

Categories : Javascript

window.close closes the postbacked child window and a copy of child window still appears
The showModalDialog method will freeze JavaScript execution on the parent window until the dialog that it opens has closed, so we can rule out that as the reason why your second window opens. When FileUpload.aspx posts back from the server, it should work the same way as modeless aspx postbacks. I think you should be able to get rid of the window.open() method and you should be fine. Parent window: window.showModalDialog("FileUpload.aspx", "FileUpload", "center:yes;resizeable=yes;dialogHeight:300px;dialogWidth:600px;"); The Child window will call this when it's done. window.close();

Categories : Javascript

Image not moving in the browser window
When positioning an absolute element your absolute position is positioned inside of the nearest relative position. So it's absolutely positioned inside the relative position. Also your inline style has no closing "

Categories : HTML

WINAPI / c++: Moving borderless window
I know that I could do something like getting mouse click position, and then calculate where the window would end up everytime there comes a WM_MOUSEMOVE. But this solution is not stable, because when I move my mouse too fast, it gets out of the window, and then it won't react. You can fix that by calling SetCapture when you receive the mouse click. You then will continue to receive WM_MOUSEMOVE even after the mouse cursor leaves your window. When the user is finished dragging and release the mouse cursor, you then should call ReleaseCapture. What I ideally want to, is to create a window, that is able to be moved without borders or captions, where I don't need to track the mouse myself, but where Windows does it for me, like making the whole window a caption. If you really wan

Categories : C++

c++ Moving a Window with out changing its size
Use SetWindowPos() instead. It has flags that allow you to tell the system to not change the size. http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx

Categories : C++

Moving and Resizing a Surface Window itself
The code below at least allows you to drag; It gets around the problem you are having by using screen coordinates - as using window coordinates means the point of reference is changing as the window moves. See http://www.codeproject.com/Questions/671379/How-to-drag-window-with-finger-not-mouse for more info.. static void MakeDragging(Window window) { bool isDown = false; Point position = default(Point); window.MouseDown += (sender, eventArgs) => { if (eventArgs.LeftButton != MouseButtonState.Pressed) return; isDown = true; position = window.PointToScreen(eventArgs.GetPosition(window)); }; window.MouseUp += (sender, eventArgs) => { if (eventArgs.LeftButton !=

Categories : C#

Pictures moving when window resized
There's several ways you can do this. Without knowing all of the specifics I would recommend something like this. HTML: <div id="wrap"> <div id="left"><img src="#" /></div> <div id="right"> <div id="top"><img src="#" /></div> <div id="bottom"><img src="#" /></div> </div> </div> CSS: #wrap {min-width: 100px;} #left { width: 50px; float: left;} #right {width: 50px; float: left;} #top { width: 50px; } #bottom { width: 50px; } Just make sure the min-width on your wrap div is at least as wide as your images side by side. Working Fiddle: http://jsfiddle.net/6sFzk/2/

Categories : HTML

Moving chrome window using an extension
You can specify window position with chrome.windows API. With appropriate left and top values, windows can be placed on the second monitor.

Categories : Javascript

Get window handle from taskbar by mouse pos
WindowFromPoint() should do what you need, although it doesn't retrieve handles to disabled or hidden windows. If you need those too you can use ChildWindowFromPoint() to find children of the taskbar window.

Categories : C++

C++ mouse click on certain spot in window
Use SendInput() instead, then you can use flags to move the cursor relative to the window - Input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP; How i can simulate a double mouse click on window ( i khow handle) on x, y coordinate, using SendInput? http://www.cplusplus.com/forum/windows/97017/

Categories : C++

Moving the wpf button based on mouse position but it blinking
Your "flickering" is caused by the transform in your PreviewMouseMove handler. You are transforming the X and Y positions of the control, using the position of the mouse relative to your Button control, which will change every time your transform is applied. Every time the button position changes, your Mouse.GetPosition(sender as Button).X & Y will return different values, causing the button to change position again, and so on. One way around this would be to get the mouse position from a parent element (e.g. Grid, Canvas with a fixed position): <Grid Name="myGrid"> <Button Name="Samplebutton" PreviewMouseDown="Samplebutton_PreviewMouseDown" PreviewMouseUp="Samplebutton_PreviewMouseUp" PreviewMouseMove="Samplebutton_PreviewMouseMove"

Categories : C#

Prevent the child window from moving together with its parent
Check out WS_EX_TOOLWINDOW style, that is intended for floating things. And CCS_NOPARENTALIGN and the other styles around it.

Categories : C++

Preventing Vim preview window from moving main
There is no such autocmd event. But you can use WinEnter and BufDelete associated with previewwindow option to achieve something similar. Using WinEnter you can check previewwindow; if you are on preview window, you can set a buffer variable to differ this event from subsequent events that can be generated by moving to another window and back to preview window. You can also set au BufDelete <buffer> call MyRestoreMainWindow() to call your function when preview window is closed.

Categories : Vim

UIScrollView, modal window , contents moving
I'm not entirely sure as to why your scrollView would be automatically shifting out of position when you dismiss a modal VC, but I'd say your best bet is manually altering the content offset (as indicated in your answer). All you need to adjust is, when you tap on one of the images, keep a reference to that view (presumably an ImageView) in a property in the parent VC. When you call setContentOffset, do it like so (say you'd stored the view into a property called selectedView) self.scrollView.contentOffset = CGPointMake(self.selectedView.frame.origin.x, self.selectedView.frame.origin.y) That should adjust it to the right position (you can add or subtract a little to the values to offset it a bit if you want)

Categories : IOS

Find optimal linear fit in a moving window
The idea is to call lm only once with a matrix of responses. This is faster by a factor of 2, but assumes that y values are non-zero. If zero values are possible, you could check for that and use optWinLinFit0 as a fall-back. optWinLinFit1 <- function(x,y,win_length) { xfit <- x[seq_len(win_length)] xfit <- xfit-min(xfit) #get all windows of values in one matrix mat <- outer(y,rep(1,length(y))) require(Matrix) mat <- band(mat,k1=0,k2=win_length-1) mat <- as.matrix(mat) mat <- mat[,-(1:win_length-1)] nc <- ncol(mat) mat <- matrix(mat[mat!=0],ncol=nc) #regression with response matrix fit <- lm.fit(cbind(1,xfit),mat) #find fit with smallest sigma^2 winner <- which.min(1/(win_length-2)*colSums(fit$residuals^2)) y <- mat[,

Categories : Performance

Lock mouse/UI until window fully loads vb.net
The Form.Shown event is the one you want to handle. I would put the controls in a disabled state and then enable everything in the Form.Shown event handler, like this: Private Sub Form1_Shown(sender as Object, e as EventArgs) Handles Form1.Shown ' Put logic here to enable your form controls here End Sub Read the MSDN documentation for Form.Shown Event.

Categories : Vb.Net

get mouse event in cocoa window controller
I would recommend subclassing NSTextField and handling the events there. As trojanfoe said, it has mouse-handling built in. Plus the feature you describe sounds like something that you might use again, in the same app or another. Just setting the class to your custom NSTextField will save time. It could look something like this: DCOHoverTextField.h #import <Cocoa/Cocoa.h> /** An `NSTextField` subclass that supports mouse entered/exited events. */ @interface DCOHoverTextField : NSTextField @end DCOHoverTextField.m #import "DCOHoverTextField.h" @interface DCOHoverTextField() /* Holds the tracking area for the `NSTextField`. */ @property (strong) NSTrackingArea *trackingArea; @end @implementation DCOHoverTextField - (void)updateTrackingAreas { // Remove tracking area i

Categories : Objective C

Popup window with information on mouse over hyperlink
If you're looking for a much more code-simple popup tooltip, I am enjoying a customized version of this: http://devseo.co.uk/examples/pure-css-tooltips/# If this is too fancy for you it was just some css3 transitions on top of this more basic version, explained well here: http://sixrevisions.com/css/css-only-tooltips/

Categories : PHP

HTML Prevent moving objects (div's) on window resize
Try wrapping the items you dont want resized into a div let call it "wrapper". Then set the min-width on "wrapper" to lets say 510px. anything inside of this div container should not be changed. Also, try to keep the html markup in lowercase. :) <!DOCTYPE HTML> <html> <head> <style> body {font-family:'Arial'; font-size:90%} html, body {height:100%; margin:0; padding:0} #panel {background:black; color:white; width:186px; height: calc(100% - 75px); float:left} #content {height: calc(100% - 75px)} #spacer {background:black; font-size:400%; color:white ; height:75px} #calcFrame {height: calc(100% - 3px); width: calc(100% - 186px); margin:0; padding:0} #wrapper {min-width: 510px;}

Categories : HTML

Eclipse: two windows, moving code editor from one window to the other
It doesn't work with version 4.2 (Juno) and up. Editor parts are bound to their parent window. They can be detached from it but not moved to a different one. You need to open the editor in the other window separately. As Konstantin Komissarchik notes in the comments: "It is a regression as part of transitioning to the 4.x platform architecture. There is already a bug report. Hopefully, it will be fixed soon. http://bugs.eclipse.org/bugs/show_bug.cgi?id=384308"

Categories : Java

Concurrent Moving Average Window in Java using a Queue?
I can't think of a way unless you are OK with getting slightly wrong values. On the other hand, one of the most performance conscious implementation uses a lock, too (the metrics library). Lock acquisition got very fast since JDK6. If I were you I'd just use a lock.

Categories : Java

Is there a jquery event associated with the mouse leaving a subModal window?
Yes, it's called mouseleave Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.

Categories : Jquery

popup window needs to stay up if mouse leaves via another panel
Add mouseenter, mouseleave events for B & when those events occurs trigger A's corresponding events. This is very inefficient, but works. Also keep in mind that, If self.pop.getView() returns same element for each call, you will have to unbind & rebind the events. $(this.filterFlag).mouseover(function(){ var that = this; var c = self.pop.getView(); self.view.appendChild(c); $(c).mouseenter(function() { $(that).mouseenter(); }) .mouseleave(function() { $(that).mouseleave(); }); }); $(this.filterFlag).mouseleave(function(){ self.view.removeChild(self.pop.getView()); //but if mouse leaves into the popup, don't hide pop up. }); Here is a sample fiddle. CSS solution will be more efficient. HTML: <div class='parent'> <

Categories : Javascript

Ways to open info window when the mouse is over a marker
You could do something like this: $.goMap.createListener({type:'marker', marker:'testMarker'}, 'mouseover', function() { google.maps.event.trigger($($.goMap.mapId).data('testMarker'), 'click'); }); It just triggers Google's own event to click on the marker 'testMarker'. Hope it helps.

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.