w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to change position of window controls relative to the window size
Not necessarily the best way, but what I'd probably do is handle WM_SIZE and/or WM_SIZING and then in there use : m_Button.SetWindowPos(x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); where x and y are the new co-ordinates of the top-left of where you want your button.

Categories : Visual Studio 2010

How to position popup window relative to the window top?
Here is the working jsfiddle: http://jsfiddle.net/kcG9W/. You needed to calculate the scroll offset of the window, which would make the top look like 0px, then add 200 to that so the top would appear to be 200px. $('#thumbs img').click(function(){ $('.popup').fadeIn(300); $('#dark-overlay').fadeIn(300); var top = $(window).scrollTop() + 200 + 'px'; $('.popup').css({top:top}); });

Categories : Javascript

Position Relative to the window
You can use position:fixed Here is a jsfiddle for the same http://jsfiddle.net/aBaNM/ , even if you scroll the body, red div should be positioned there.

Categories : HTML

jQuery Tools | overlay position relative to body and not the browser window [solved]
After a bit back and forth have I finally figured out how to make this work. By just changing top:282 to top:top in the js-code - the position of the overlay places it self to the top of parent element. I didn't know that, and I can't remember having seen this in the documentation either...

Categories : Jquery

'Accordion' style panels - retain position of clicked element relative to the browser window
$("#accordian h3").click(function(){ //slide up all the link lists $("#accordian ul ul").slideUp(); //slide down the link list below the h3 clicked - only if its closed if(!$(this).next().is(":visible")) { $(this).next().slideDown(); } For more details click here

Categories : Jquery

Obtaining Windowed window's Position in X-window System?
Try Window child; XTranslateCoordinates(dpy, *curWin, root, 0, 0, &winPos[0], &winPos[1], &child); This should give you the top left corner. Repeat with (0, height-1), (width-1, 0) and (width-1, height-1) for the other corners.

Categories : C++

How to set window position in VB when window is not visible?
Try: FormTest.Left = 1000 FormTest.Visible = True FormTest.BringToFront() And if you want the window to start at the position you want when you use .Show() then: FormTest.StartPosition = FormStartPosition.Manual With this way it will start on the position you specified from the beggining.

Categories : Vb.Net

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#

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

Changing position of origin inside a window's Client area to get cursor position
The DPtoLP function converts device coordinates into logical coordinates. The conversion depends on the mapping mode of the device context, the settings of the origins and extents for the window and viewport, and the world transformation. http://msdn.microsoft.com/en-us/library/windows/desktop/dd162474(v=vs.85).aspx

Categories : Visual Studio 2010

Using relative urls with window.open
how to assign the url to the newly opened window You need to pass and URL to window.open() window.open('http://www.google.com');//will open www.google.com in new window. window.open('/relative_url'); //opens relatively(relative to current URL) specified URL Or, function OpenWindow(obj) { var w = window.open(); w.location = "hello.com/dummypage.html"; //how to assign the url to the newly opened window } Or, You can even say, w.location.assign("http://www.mozilla.org"); Refer Window.location

Categories : Javascript

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

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

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#

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++

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

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

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

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

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++

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

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

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

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

How do I make the height of a slider match that of an image relative to the width of the window?
Maybe if you use jsFiddle we could see the CSS along with the HTML and jQuery. I am just learning so excuse the question but I don't understand that the width of the container is set to 100% but the height is 325. Do you not have to say 325px or something?

Categories : Javascript

How to display error message inside a pop up window instead of moving to a new page?
Make use of JavaScript alert <?php if(isset($_POST['submit'])) { extract($_POST); $question=mysqli_real_escape_string($con,$question); $option[0]=mysqli_real_escape_string($con,$option[0]); $option[1]=mysqli_real_escape_string($con,$option[1]); $option[2]=mysqli_real_escape_string($con,$option[2]); $option[3]=mysqli_real_escape_string($con,$option[3]); mysqli_query($con,"insert into questions(question, op1,op2,op3,op4,correct,difflevel,ageGroup,catId) values ('$question','$option[0]','$option[1]','$option[2]','$option[3]',$correct,$difflevel,$ageGroup,$catId)") or die("Some error"); $questionId = mysqli_insert_id($con); if($_POST['catId']=="")//QUESTIONS MUST CONTAIN AT LEAST ONE CATEGORY echo "<script>alert('Please select c

Categories : PHP

Plotting an interactive line graph with a moving window - looking for advice
That should be pretty easy in both matlab and python/matplotlib. A matlab solution would look something like this (untested): %assume x and y data are in cell arrays, so they can be of different lengths line_handles = plot(x{1}, y{1}, x{2}, y{2}, x{3}, y{3}); rect = getrect; %select rectangle with mouse for i = 1:length(line_handles) if your_intersection_test(rect, x{i}, y{i}) set(line_handles(i), 'linewidth', 5) end end where I leave it to you to figure out how to test if a line crosses a rectangle (googling for 'test if line intersects rectangle' gives some useful results, but in your case it is a poly-line). A python solution should be almost similar,matplotlib.widgets.RectangleSelector might be useful for getting the rectangle with the mouse, but I have never used

Categories : Python

getting position from window
<div> <p>Hello</p> </div> <p></p> <script> var p = $("p:last"); var offset = p.offset(); p.html( "left: " + offset.left + ", top: " + offset.top ); </script>

Categories : Jquery

Prevent iOS safari from moving web-page window so drag event can happen
Try to add <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/> To head tag in your html

Categories : Javascript

CSS Trying to use width:100% to make a table expand relative to window size, creates an undesired space?
I think you're just seeing the fact that the images are aligned to the left. Try text-align:center;, like this: .table { display:table; margin-right:auto; margin-left:auto; width:100%; } .tablecell { display:table-cell; text-align:center; } jsFiddle: http://jsfiddle.net/q73LK/ As a side note, there is no need to use classes for the cells. You can do this instead: .table { display:table; margin-right:auto; margin-left:auto; width:100%; } .table div { display:table-cell; text-align:center; } As a second side note, you are missing "alt" attribute on your images. For valid HTML, you need to include the "alt" attribute. Like this: <div

Categories : CSS

How to set position of JSlider in window?
If you want your JSlider at the bottom try this: frame.add(slider, BorderLayout.SOUTH); at your code I think it is enough if you add to add(slider1); this: add(slider1, BorderLayout.SOUTH); EDIT: To display a set of slider on a JFrame with your picture, add your picture at a JPanel and your slider to a JPanel. So it is easier to place it. Than you could use: JPanel panel = new JPanel(new GridLayout(1, 0, 1, 0); panel.add(slider1); panel.add(slider2); ... add(panel, BorderLayout.SOUTH); add(picturepanel, BorderLayout.CENTER); All kinds of Layouts If you need more precision use a grid Layout!

Categories : Java

Position Fixed to the Window
You're definitely going to need to make use of JS for this as CSS won't be able to detect scrolling. Here's a basic example: <div id="scroller" class="floating"></div> This is our original element, where it's already partially down the page and floating in the middle. style like .floating{ margin-top: 50px; } We then need to use Javascript in order to measure when the user has scrolled down (I've done this using jQuery) $(window).scroll(function(){ if($(this).scrollTop() > 50){ $('#scroller').removeClass('floating'); $('#scroller').addClass('fixed'); }else{ $('#scroller').addClass('floating'); $('#scroller').removeClass('fixed'); } }); where you have an alternative css declaration for fixed like .fixed{ position: f

Categories : Javascript

How to set window position to locate it to the top of the screen on MFC?
I'm not seeing anything wrong, I've used this as Can you please try this with minor modification ::SetWindowPos(this->wndTopMost->GetSafeHwnd(), HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); or this->wndTopMost.SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

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

PyGtk - Call function when window position changes?
Just needed to attach to the "configure-event" in the end: #!/usr/bin/python import gtk class app(gtk.Window): def __init__(self): super(app, self).__init__() self.set_position(gtk.WIN_POS_CENTER) self.set_title("Window Position Test") self.set_decorated(True) self.set_has_frame(False) self.set_resizable(False) self.set_default_size(320, 50) self.connect("destroy", gtk.main_quit) vbox = gtk.VBox(spacing=4) hbox = gtk.HBox(spacing=4) self.pos_label = gtk.Label() vbox.add(self.pos_label) self.add(vbox) self.update_pos() self.show_all() self.connect("configure-event", self.update_pos) def update_pos(self, *args): ''' Get window position, display + log ''' pos = str( self.get_position() ) print( pos )

Categories : Python

Parallax background position in window calculation
With imgWindow the div that contains the image, something like that should be ok : // get the maximum window scroll var deseapearPos = $(window).height() - $('#imgWindow').offset().top; var imgWindowHeight=('#imgWindow').height(); var imageHeight = 500; $(window).scroll(function() { var currWinPos = $(window).scrollTop(); if (currWinPos < deseapearPos ) { // if imageWindow still on sight var newPos = /* your computation here */ // ( smthg like newPos = ( imageHeight - imgWindowHeight ) * (currWinPos/ deseapearPos ) ); $('#imgWindow').scrollTop(newPos); } }); ( imgWindow css style has a overflow: scroll )

Categories : Javascript

Creating a popup window on the click's position
Make sure your #popup div is position: absolute, not relative. Otherwise, its offset will be relative to where the block element would have been drawn. Here is a basic fiddle: jsFiddle edit: Should have mentioned - if you don't specify absolute yourself, when using the .offset() method, it will automatically use relative.

Categories : Javascript



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