popup

How do you print from a popup window in javascript?

心不动则不痛 提交于 2019-12-22 05:13:23
问题 I have a .Net application that dynamically creates a small HTML page and pops it up in a new window using the javascript document.open method. Everything with that functionality is working fine. Now I want to add a button to the HTML page that prints the page. I have tried using the following code to no avail: <a href='print.html' onClick='window.print();return false;'> <img src='images/printer.png' height='32px' width='32px'></a> When the button is clicked in the popup window, nothing

modal pop up window to fit within browser view if resize height

允我心安 提交于 2019-12-21 23:41:42
问题 I've went to this tutorial to do a modal pop up window, and it seems pretty nice for what I need to do. However, I was wondering if someone can help me figure out what I need to calculate to change the dialog box so it'll follow whenever you resize the browser. This tutorial is good because if you resize the browser (width-wise), the box will follow and go into the middle. But if it is height-wise, it wont. Tutorial : Here I'm thinking it has to do with these codes : // get the screen height

how to open a popup on hover event with clickable contant

馋奶兔 提交于 2019-12-21 22:05:29
问题 i am currently working with leaflet. and i am trying to create a popup with with clickable content. now i found how i can bind popups on click event with content: marker.on('click', function(e){ marker.bindPopup("<div />").openPopup(); } and i found out how to create the popup on hover: marker.on('mouseover', function(e){ e.target.bindPopup("<div />").openPopup(); }}); marker.on('mouseout', function(e){ e.target.closePopup(); }}); now what i cant seem to do is make the popup stay open in

Take screenshot of wpf popup window

倾然丶 夕夏残阳落幕 提交于 2019-12-21 21:27:12
问题 I try to take a screenshot of an application writen in WPF and the application is not captured, must I use a special tool to take the screenshot? 回答1: You can use RenderTargetBitmap to generate an image from your WPF control. public const int IMAGE_DPI = 96; public Image GenerateImage(T control) where T : Control, new() { Size size = RetrieveDesiredSize(control); Rect rect = new Rect(0, 0, size.Width, size.Height); RenderTargetBitmap rtb = new RenderTargetBitmap((int)size.Width, (int)size

Callback for a popup window in JavaScript

最后都变了- 提交于 2019-12-21 21:08:09
问题 I hope I did my homework well, searching the Internets for the last couple of hours and trying everything before posting here, but I'm really close to call it impossible, so this is my last resort. I want a simple thing (but seems like hard in JavaScript): Click button -> Open Window (using window.open) Perform an action in the popup window and return the value to parent (opener) But I want to achieve it in a systematic way, having a callback defined for this popup; something like: var wnd =

Netbeans add popup menu with visual editor

五迷三道 提交于 2019-12-21 20:59:54
问题 I need to add a popup menu to the JFrame , but when I drop that component there it just dissappears. I can see it in code, but there is no way to edit anything about it. Is there a way I can edit it like say menu bar ? I use Netbeans 7.2.1 if that is important. PS - Yes, I tried googling and found only this, but it is not helping... 回答1: Okay, I figured it out by myself. Open Windows -> Navigation -> Navigator it will show a navigator window with all components currently on jFrame. In that

Chrome extension popup showing by condition

心已入冬 提交于 2019-12-21 19:54:37
问题 I want to show popup by click, but only if condition is false. After click to extension icon background js searchig for tab with current name. If tab found background js continues working. If not found - i want to show popup with instructions. Can`t understand how to just show popup in this case. I can set popup by browserAction.setPopup(), but popup will be displayed only after next clicks. I just want to show my popup one time. It is definitely posible, I've seen this behavior on other

The proper way to handle popup closing

╄→尐↘猪︶ㄣ 提交于 2019-12-21 19:26:14
问题 I'm looking for close event for popup. I've found one for XUL, but I need it for HTML. Popup has closed property. >>> var popup = open('http://example.com/', 'popup', 'height=400,width=500'); >>> popup.closed false Well, I can check it once at half second. function open_popup() { var popup = open('http://example.com/', 'popup', 'height=450,width=450'); var timer = setInterval(function(){ if (popup.closed) { alert('popup closed!'); clearInterval(timer); } }, 500); } I've tested it on Chrome 4

The proper way to handle popup closing

痴心易碎 提交于 2019-12-21 19:23:05
问题 I'm looking for close event for popup. I've found one for XUL, but I need it for HTML. Popup has closed property. >>> var popup = open('http://example.com/', 'popup', 'height=400,width=500'); >>> popup.closed false Well, I can check it once at half second. function open_popup() { var popup = open('http://example.com/', 'popup', 'height=450,width=450'); var timer = setInterval(function(){ if (popup.closed) { alert('popup closed!'); clearInterval(timer); } }, 500); } I've tested it on Chrome 4

Qt - Pop up menu

廉价感情. 提交于 2019-12-21 12:33:55
问题 I have added a label as an image(icon) to a widget in Qt. I want to display a pop-up menu when the user clicks (left or right click) on the label. How can I achieve this ? Please help... 回答1: You'll want to set the ContextMenuPolicy of the widget, then connect the customContextMenuRequested event to some slot which will display the menu. See: Qt and context menu 回答2: If you want to display a context menu whenever the label is clicked (with any mouse button), I guess you'll have to implement