dialog

DialogFragment callback on orientation change

☆樱花仙子☆ 提交于 2019-12-31 10:35:35
问题 I'm migrating my dialogs, currently using Activity.showDialog(DIALOG_ID); , to use the DialogFragment system as discussed in the android reference. There's a question that arose during my development when using callbacks to deliver some event back to the activity/fragment that opened the dialog: Here's some example code of a simple dialog: public class DialogTest extends DialogFragment { public interface DialogTestListener { public void onDialogPositiveClick(DialogFragment dialog); } // Use

Where to find a clear explanation about swift alert (UIAlertController)?

偶尔善良 提交于 2019-12-31 08:47:27
问题 Couldn't find a clear and informative explanation for this. 回答1: After searching a while on a subject I didn't find a clear explanation , even in it's class reference UIAlertController Reference It is ok, but not clear enough for me. So after collecting some peaces I decided to make my own explanation (Hope it helps) So here it goes: UIAlertView is deprecated as pointed out : UIAlertView in Swift UIAlertController should be used in iOS8+ so to create one first we need to instantiate it, the

Where to find a clear explanation about swift alert (UIAlertController)?

南楼画角 提交于 2019-12-31 08:47:26
问题 Couldn't find a clear and informative explanation for this. 回答1: After searching a while on a subject I didn't find a clear explanation , even in it's class reference UIAlertController Reference It is ok, but not clear enough for me. So after collecting some peaces I decided to make my own explanation (Hope it helps) So here it goes: UIAlertView is deprecated as pointed out : UIAlertView in Swift UIAlertController should be used in iOS8+ so to create one first we need to instantiate it, the

How to change position of an OPENFILENAME dialog in Windows?

你离开我真会死。 提交于 2019-12-31 07:09:14
问题 This is my attempt using a hook function to get the dialog window handle. Both SetWindowPos() and GetLastError() return correct values, but the dialog window is unaffected and shown at position 0,0 . #include <windows.h> #include <iostream> static UINT_PTR CALLBACK OFNHookProc (HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) { using namespace std; switch (uiMsg) { case WM_INITDIALOG: { // SetWindowPos returns 1 cout << SetWindowPos(hdlg, HWND_TOPMOST, 200, 200, 0, 0, SWP_NOSIZE ) << endl

Add multiple choice to Dialog and make it functioning

蹲街弑〆低调 提交于 2019-12-31 06:08:14
问题 What I want is to add a question with 3-4 options to the JDialog import java.awt.*; import java.awt.event.*; import javax.swing.*; public class VocabHelper { private JFrame mainFrame; private JPanel mainPanel; private JPanel animalPanel; public JDialog animalDialog; private JLabel titleLbl; private JLabel subtitle; //Call main GUI public VocabHelper() { mainGUI(); } //Main Method public static void main(String[] args) { VocabHelper vocabHelper = new VocabHelper(); vocabHelper.showActionEvents

Add multiple choice to Dialog and make it functioning

一曲冷凌霜 提交于 2019-12-31 06:08:11
问题 What I want is to add a question with 3-4 options to the JDialog import java.awt.*; import java.awt.event.*; import javax.swing.*; public class VocabHelper { private JFrame mainFrame; private JPanel mainPanel; private JPanel animalPanel; public JDialog animalDialog; private JLabel titleLbl; private JLabel subtitle; //Call main GUI public VocabHelper() { mainGUI(); } //Main Method public static void main(String[] args) { VocabHelper vocabHelper = new VocabHelper(); vocabHelper.showActionEvents

Modal dialog functionality using AlertDialog

試著忘記壹切 提交于 2019-12-31 04:54:06
问题 I want to keep AlertDialog focused until a user presses any of the buttons on it. In other words, even if a user presses any other area (like it's parent area) or presses back button, dialog must still remain focused. Please let me know which Android 4.0 API method to use. Thanks much in advance. 回答1: use setCancelable(false); It will stop removing your AlertDialog from your screen. 来源: https://stackoverflow.com/questions/8920661/modal-dialog-functionality-using-alertdialog

How to hide print dialog box in Flex?

∥☆過路亽.° 提交于 2019-12-31 04:41:47
问题 Is it possible to hide the printing dialog in flex? I'm using the class FlexPrintJob. Here's my code: var print:FlexPrintJob = new FlexPrintJob(); print.printAsBitmap = true; if ( print.start() ) { print.addObject( img as UIComponent, FlexPrintJobScaleType.SHOW_ALL ); print.send(); } 回答1: you can use start2() from the printjobs class import flash.printing.PrintJob; import flash.printing.PrintUIOptions; var myPrintJob:PrintJob = new PrintJob(); var uiOpt:PrintUIOptions = new PrintUIOptions();

JavaFX (8) Alert: different button sizes

旧街凉风 提交于 2019-12-31 04:17:13
问题 Consider a JavaFX (8) Alert dialog with two buttons: Alert alert = new Alert(AlertType.CONFIRMATION); ButtonType bttYes = new ButtonType("Yes"); ButtonType bttNo = new ButtonType("No, continue without restart"); alert.getButtonTypes().clear(); alert.getButtonTypes().addAll(bttYes, bttNo); alert.showAndWait(); The resulting dialog has two buttons, both same width which looks quite silly. Is there a way to adjust both buttons to the actual text length? 回答1: An Alert , which extends Dialog ,

CKEditor dialogs: referencing input fields by ID

天大地大妈咪最大 提交于 2019-12-31 03:55:09
问题 Each input field in the CKEditor dialogs are renamed with a unique number, but the number changes depending on what options are visible. I need to reference 'txtUrl' which has an id something like #35_textInput. So far I have discovered that something like this should work: alert(CKEDITOR.instances.myElement.document.$.body.getId('txtUrl')); But it doesn't. Please help. 回答1: @Rio, your solution was really close! This was the final solution: var dialog = CKEDITOR.dialog.getCurrent(); dialog