popup

Show a PopupWindow centralized

蹲街弑〆低调 提交于 2019-11-27 05:31:34
问题 I have some popups on my app, it's fullscreen and the following code: content.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); content.measure(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); int screenWidth = windowManager.getDefaultDisplay().getWidth(); int screenHeight = windowManager.getDefaultDisplay().getHeight(); int x = screenWidth / 2 - content.getMeasuredWidth() / 2; int y = screenHeight / 2 - content.getMeasuredHeight() / 2; window

How to handle ESC keydown on javascript popup window

一个人想着一个人 提交于 2019-11-27 05:15:06
问题 I have a javascript window.open popup, and I want the popup to close itself when the user presses the ESC key. I can't figure out how to hook the keydown event (and on what object?) so that I can catch the ESC key. I'm using jQuery. 回答1: Try something like this: $(document).keydown(function(e) { // ESCAPE key pressed if (e.keyCode == 27) { window.close(); } }); 回答2: It is possible to achieve with JS Without using jQuery. window.onkeydown = function( event ) { if ( event.keyCode == 27 ) {

How to create a system tray popup message with python? (Windows)

杀马特。学长 韩版系。学妹 提交于 2019-11-27 05:12:44
问题 I'd like to know how to create a system tray popup message with python. I have seen those in lots of softaware, but yet difficult to find resources to do it easily with any language. Anyone knows some library for doing this in Python? 回答1: With the help of the pywin32 library you can use the following example code I found here: from win32api import * from win32gui import * import win32con import sys, os import struct import time class WindowsBalloonTip: def __init__(self, title, msg): message

JComboBox change drop-down popup

不问归期 提交于 2019-11-27 04:43:35
问题 basically is popup for a JComboBox displayed below its derived JTextField, how can change direction from bellowed orientations for JComboBox's popup and display JComboBox's popup on the top/over that EDIT: code example for basic JComboBox import java.awt.Dimension; import javax.swing.*; import javax.swing.plaf.basic.BasicComboBoxRenderer; public class HighRowCombo { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new

Input fields hold previous values only if validation failed

五迷三道 提交于 2019-11-27 04:07:21
I came up with a strange problem. I tried to isolate the problem so following is my simplified code. public class MyBean { private List<Data> dataList; Data selectedData; public MyBean() { dataList = new ArrayList<Data>(); dataList.add(new Data("John", 16)); dataList.add(new Data("William", 25)); } public List<Data> getDataList() { return dataList; } public void edit(Data data) { selectedData = data; } public void newData() { selectedData = new Data(null, null); } public Data getSelectedData() { return selectedData; } public class Data { String name; Integer age; Data(String name, Integer age)

popup window in Chrome extension

社会主义新天地 提交于 2019-11-27 03:58:29
问题 I am writing a Chrome extension, and I want a login window to be popped up when users click on the context menu so that user can input username and password. In Chrome extension, I only found chrome.pageAction.setPopup and chrome.browserAction.setPopup can be used to show popup windows, but they show popups only when the page action's icon or browser action's icon is clicked, not the context menu. Of course, I can use javascript prompt box to do this, but the problem is the password cannot be

IE8 losing session cookies in popup windows

…衆ロ難τιáo~ 提交于 2019-11-27 03:18:23
We have an ASP.NET application that uses Forms Auth. When users log in, a session ID cookie and a Forms Auth ticket (stored as a cookie) are generated. These are session cookies, not permanent cookies. It is intentional and desirable that when the browser closes, the user is effectively logged out. Once a user logs in, a new window is popped up using window.open('location here'); . The page that is opened is effectively the workspace the user works in throughout the rest of their session. From this page, other pop-ups are also used. Lately, we've had a number of customers (all using latest

Android setError(“error”) not working in Textview

南楼画角 提交于 2019-11-27 03:03:36
问题 We can set error in Edittext successfully but failed to set in textview. is there any problem?? i tried ((TextView) findViewById(R.id.df)).requestFocus(); ((TextView) findViewById(R.id.df)).setSelected(true); ((TextView) findViewById(R.id.df)).setError("akjshbd"); but i am not getting popup for error. 回答1: Actually , you can use the setError for the textView and show its popup . You just need to use the same style as of the EditText . Simply add the next attribute for the textView in the xml

How to open a WPF Popup when another control is clicked, using XAML markup only?

99封情书 提交于 2019-11-27 02:52:22
I've got two controls, a TextBlock and a PopUp. When the user clicks (MouseDown) on the textblock, I want to display the popup. I would think that I could do this with an EventTrigger on the Popup, but I can't use setters in an EventTrigger, I can only start storyboards. I want to do this strictly in XAML, because the two controls are in a template and I don't know how I'd find the popup in code. This is what conceptually I want to do, but can't because you can't put a setter in an EventTrigger (like you can with a DataTrigger): <TextBlock x:Name="CCD">Some text</TextBlock> <Popup> <Popup

Using JQuery to open a popup window and print

廉价感情. 提交于 2019-11-27 02:47:43
问题 A while back I created a lightbox plugin using jQuery that would load a url specified in a link into a lightbox. The code is really simple: $('.readmore').each(function(i){ $(this).popup(); }); and the link would look like this: <a class='readmore' href='view-details.php?Id=11'>TJ Kirchner</a> The plugin could also accept arguments for width, height, a different url, and more data to pass through. The problem I'm facing right now is printing the lightbox. I set it up so that the lightbox has