DialogClosedListener on the dialog class?

I tried the DialogClosedListener on a class of configuration dialog box, but it doesn't seem to work. I wonder if it is still possible?

class that implements the DialogCloseListener

    //Create a class that implement the DialogClosedListener Interface
    static final class myDialogListener implements DialogClosedListener {
        myDialogListener(){
            System.out.println("Made it here");
        }
        public void dialogClosed(Dialog dialog, int choice){
            System.out.println("Output Choice: " + choice);
            switch (choice) {
                case Dialog.DELETE : Status.show("Delete msg"); break;
                case Dialog.OK : Status.show("OK msg"); break;
                case Dialog.CANCEL : Status.show("Cancel msg"); break;
            }
        }
    }

Class of dialog box that creates a popup message with no button

    public final class PopDialog extends Dialog {
        PopDialog(String lockMessage){
            super(lockMessage, null, null, 0, Bitmap.getPredefinedBitmap(Bitmap.INFORMATION), Dialog.GLOBAL_STATUS);
        }
    }

Code used call popup and set the listener

PopDialog pd = new PopDialog(_defaultPhoneMessage);
pd.setDialogClosedListener(new myDialogListener());
pd.doModal();

I get no error or something like that, but the listener never gets called when I close the pop-up window. I use the ESC key to close the pop-up window.

Y at - it something I'm doing wrong here?

Yes - the following line of code (after the push) is running.

Tags: BlackBerry Developers

Similar Questions

  • Retrieve the value of the dialog box

    Hello

    I have a class that extends the dialog box. A few Radiobuttns are added. I want to get the value of the RadioButton selected the actual class of the screen, call the dialog box by clicking the Dialog.OK button. The code I tried is as follows:

    My class of the screen:

                    XXXDialog clScrn = new XXXDialog ();
                    if (clScrn.doModal() == Dialog.OK) {
    
                        // I click Ok, but this is never shown
                        Dialog.alert("Closed & here");
                        Dialog.alert("Selected = " + clScrn.getSelectedItem());
                    }
                    clScrn = null;
    

    The dialog class-

      public XXXDialog() {
            super(Dialog.D_OK, "Select Item", Dialog.OK, null, VERTICAL_SCROLL | VERTICAL_SCROLLBAR | Field.USE_ALL_WIDTH | Field.USE_ALL_HEIGHT);
            rbg = new RadioButtonGroup();
            rb1 = new RadioButtonField("One", rbg, false, Field.USE_ALL_WIDTH);
            rb2 = new RadioButtonField("Two", rbg, false, Field.USE_ALL_WIDTH);
    
            rb1.setChangeListener(this);
            rb2.setChangeListener(this);
    
            add(rb1);
            add(rb2);
        }
    
        public void fieldChanged(Field f, int context) {
    /*
    Actually, I want to know which field was clicked RadioButton or Ok button. If it is Ok, then I want to hide and return back to screen.
    */
    
            try {
                    RadioButtonField fd = (RadioButtonField) f;
                    item = fd.getLabel();
                    System.out.println("Selected = " + item);
            } catch (Exception e) {
            }
    
            try{
                ButtonField fd = (ButtonField) f;
                System.out.println("********* Button PRESSED = " + f);
                this.close();
            } catch (Exception e) {
            }
    
            System.out.println("*********** Field Count = " + f.getManager().getFieldCount() + " Index = " + f.getIndex());
        }
    
        public String getSelectedItem() {
            return item;
        }
    

    The XXXDialog class is in a separate file of java.

    Can anyone help me on what to do and how to achieve the goal.

    Thank you

    I found my solution. What I did is: -.

    In my main screen, I call the as dialog box

    clScrn.doModal ();

    Dialog.Alert (Come Back here");   I see this alert as soon as the dialog box is closed.

    In my class of dialogue, I have only the Ok button, dialog can be closed using the ESC key as I implemetned the code-

    Dialog box does not close on ESC
    {} public boolean keyChar (key char, int status, int time)
    Boolean retVal = false;
    {Switch (Key)}
    case Characters.ESCAPE:
    break;
    }
    Return retVal;
    }

    So now, there is no other means to close the exception, Ok button dialog box and I make sure that when Ok is clicked, 1 radiobutton is selected.

    Thank you all for the time and effort.

  • Prevent the child class dependency when the conditional use disable to specify the class in the development environment

    Hello

    I develop an application that I want to run on the normal systems and in real time using LabVIEW Proffesional Development System 2012 SP1

    To control how the application interacts with the user, I created a class that defines the type of user interface behavior that should allow me to have nice dialog boxes when the system is running on a machine windows and no dialog box (or any other friendly code in non-real time) if they sail on a real-time target.

    The parent class is the code that suits the actual time and the class of the child is the one with dialog boxes.

    To control the class of which it is responsible, I have a structure conditional disable. It works fine when the application is built in an executable or executable file in real time, but the problem arises when I want to use the code during development on the target in real time.

    I think that with the application under a target in real time (RT PXI), the proper case of the conditional - disable is enabled for the parent class is used, but the child classes are also listed under dependencies - I pressume it's because they exist on the block diagram in the case of persons disabled conditional turn off the diagram.

    This means that I can't deploy the code on the target in real time as it is unhappy with the class of the child code - even if it will never run.

    To save the poster my real project, I created an example with a Parent and child class and a flag to disable conditional 'class' to illustrate the problem.

    If you run Test.vi, you will see that the child class always gets locked (i.e. is addictive) while running even if it is not called.

    So - basically my question is: is what I can do about it or will I enough to disable it with conditionals and simply put the constant to correct class on the block diagram in the tests?

    Thanks in advance

    John.

    I feel your pain.  I came across something similar some time back.

    Apparently official NOR position is that you have to put a conditional structure of Disable IN EVERY ONE OF YOUR CLASS live.  In the Windows screws, you simply have a case of empty disable conditional with the windows code in another case and vice versa on the RT.

    I also much prefer the method you describe...

  • A screen popup menu is opened after the closure of the dialog box

    Hello

    I have a test application with a screen containing a button.

    When I click on the button (pressing the button on my BlackBerry 9220 trackpad), it opens a dialog box.

    Then when I press ESC to my BlackBerry 9220, it closes the dialog box and I'm back on my screen.

    Now, if I add to my screen, a menu item, the changes in behavior:

    When I click on the button (pressing the button on my BlackBerry 9220 trackpad), it opens a dialog box.

    Then when I press ESC to my BlackBerry 9220, it closes the dialog box and opens a menu screen.

    So, I would add my item of menu but keeping the old behavior of my application after you close the dialog box.

    Any idea?

    Thank you.

    Best regards.

    Here is the code:

    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.ButtonField;
    Import net.rim.device.api.ui.component.Dialog;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.Field;
    Import net.rim.device.api.ui.FieldChangeListener;
    Import net.rim.device.api.ui.MenuItem;
    Import net.rim.device.api.util.StringProvider;
    SerializableAttribute public class TestApplication extends UiApplication
    {
    public TestApplication()
    {
    this.pushScreen (new TestScreen());
    }
    Public Shared Sub main (String [] args)
    {
    Application TestApplication = new TestApplication();
    application.enterEventDispatcher ();
    }
    }
    final TestScreen class extends FieldChangeListener implements screen
    {
    public TestScreen()
    {
    / * MyMenuItem MenuItem = new MenuItem (new StringProvider ("my menu item"), 0 x 230000, 0); * /
    ButtonField myButtonField = new ButtonField ("button my field");
    myButtonField.setChangeListener (this);
    This.Add (myButtonField);
    / * this.addMenuItem (myMenuItem); * /
    }
    ' Public Sub fieldChanged (field field, int context)
    {
    Dialog.Alert ("test");
    }
    }

    Here are a few screenshots:

    It comes from the popup menu. create the button with CONSUME_CLICK would be the simplest solution.

  • Problem with the dialog box displayed when the RadioButton is selected.

    It is an application with 3 buttons button1, radio 2 and output key that uses System.exit (0)
    The problem is with the dialogs first two buttons

    1. I open the application

    2 Select a radiobutton, I get a dialog box, I click 'ok', dialog will, that's fine.

    3. I choose an another radiobutton button1 or button2, I get the corresponding dialog, BUT know I have to click 'ok' twice to keep it alive.

    I don't know what could be the problem, here is the code:

    package com.thinkingblackberry;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.PasswordEditField;
    import net.rim.device.api.ui.component.RadioButtonField;
    import net.rim.device.api.ui.component.RadioButtonGroup;
    import net.rim.device.api.ui.component.RichTextField;
    import net.rim.device.api.ui.component.Status;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.component.PasswordEditField;
    
    public class HelloWorldScreen1 extends MainScreen implements FieldChangeListener, DrawStyle {
    
        protected static final int RED = 0;
        MButtons fullscreen;
        //protected RadioButtonGroup rbGroup= new RadioButtonGroup();
        public HelloWorldScreen1() {
    
            final RadioButtonGroup rbGroup=new RadioButtonGroup();
    
            setTitle("Application");
    
            RadioButtonField rbField= new RadioButtonField("RadioB1"){
    
                protected void paint(Graphics g){
                    g.setColor(Color.ROSYBROWN);
                    super.paint(g);
                }
            };
            RadioButtonField rbField2= new RadioButtonField("RadioB2"){
                protected void paint(Graphics g){
                    g.setColor(Color.SIENNA);
                    super.paint(g);
                }
            };
            RadioButtonField rbExit=new RadioButtonField("Exit"){
                protected void paint(Graphics g){
                    g.setColor(Color.DARKSLATEBLUE);
                    super.paint(g);
                }
            };;
            rbGroup.add(rbField);
            rbGroup.add(rbField2);
            rbGroup.add(rbExit);
            add(rbField);
            add(rbField2);
            add(rbExit);
    
            rbGroup.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
                if (rbGroup.getSelectedIndex() == 0) {
                    Dialog.inform( ""+rbGroup.getSelectedIndex());
    
                }
                else if (rbGroup.getSelectedIndex() == 1) {
                    Dialog.inform( ""+rbGroup.getSelectedIndex());
                }
                else if(rbGroup.getSelectedIndex()==2){
    
                    System.exit(0);
                }
    
                }
            });
    
        }
    
        public HelloWorldScreen1(long arg0) {
            super(arg0);
        }
    
        public void fieldChanged(Field field, int context) {
    
        }
    
    }
    

    I guess the event changed field is called twice, once deselection button1 and once to select button2. you pay your processing logic to account for this.

  • Push a PasswordpopupScreen of the screen class

    Is it possible to grow a passwordPopUp screen in the form of class.
    The thing is that I have the option buttons in the screen class and when the user selects one, I want to display a passwordpopupscreen
    but I can not use the pushScreen(), it marks error.
    I tried to find like a dialog box where the user can insert text or smt, but I can't find.
    Any ideas?

    Thank you!

    You can give it a reference to the screen or just do: UiApplication.getUiApplication () .pushScreen (screen)

  • Doubts in the dialog box

    Hello

    I have my doubts about dialogue box, I have the dialogue box, with edtfield in it, if I enter anything in the box of dialogue, even if I press cancel it just passes values

    what I want, that is, if I press ok, button must pass, if I press Cancel, it must cancel and close the dialog box, which is command must I use for it

    public final class CustomDialog extends Dialog
    {
        EditField entryField;
        SeparatorField s,s1;
        Font ft;
    
        public CustomDialog()
        {
          //super(Dialog.D_OK, "Custom Dialog", 1,Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.FOCUSABLE);
          super(Dialog.D_OK_CANCEL,"Medication Settings",1,Bitmap.getPredefinedBitmap(Bitmap.INFORMATION),Manager.FOCUSABLE);
          s=new SeparatorField();
          add(s);
          entryField = new EditField("Enter Medication type: ", "", 50, EditField.EDITABLE|EditField.NO_NEWLINE);
          ft=this.getFont().derive(FontFamily.SCALABLE_FONT, 18);
          entryField.setFont(ft);
          add(entryField);
          s1=new SeparatorField();
          add(s1);
    
        }
    
       public String getText()
       {
          return entryField.getText();
       //    return "code";
       }
    

    This is the dialog box, I use

    Anh help on this year.

    Concerning

    Rakesh Shankar.P

    Try how to handle the OK and CANCEL button click

    CustomDialog dialog = new CustomDialog();int result = dialog.doModal();if (result == Dialog.OK){// do your on OK processString text = dialog.getText();}else if (result == Dialog.CANCEL){dialog.close();}
    
  • NEW SDK IDE PROBLEM - the editor class could not be instantiated.

    The error is:

    Could not open the Editor: the editor class could not be instantiated. This usually indicates a manufacturer no. - arg missing or that the name of the editor class was misspelled in plugin.xml.

    When I click on details, this is the output:

    java.lang.IllegalStateException: Duplicate item in map: MapID: ModelInfoLoader.resolvedSlotIDMap, Key:setScale
        at com.rim.tad.tools.qml.core.internal.util.TypeUtil.mapPutIfNotExist(TypeUtil.java:67)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.resolveSuperInfoList(ModelInfoLoader.java:576)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.parseComponent(ModelInfoLoader.java:385)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.assureParseComponent(ModelInfoLoader.java:428)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.parseComponent(ModelInfoLoader.java:335)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.assureParseComponent(ModelInfoLoader.java:428)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.parseComponent(ModelInfoLoader.java:335)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.assureParseComponent(ModelInfoLoader.java:428)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.parseComponent(ModelInfoLoader.java:335)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.create(ModelInfoLoader.java:257)
        at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.createModelInfoFromBuiltInFile(ModelInfoLoader.java:186)
        at com.rim.tad.tools.qml.core.internal.editor.QMLEditor.(QMLEditor.java:53)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)
        at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
        at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
        at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
        at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:260)
        at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:235)
        at org.eclipse.ui.internal.EditorManager.createPart(EditorManager.java:875)
        at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:609)
        at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
        at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
        at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
        at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
        at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
        at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
        at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
        at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
        at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
        at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)
        at org.eclipse.ui.internal.PartStack.add(PartStack.java:493)
        at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
        at org.eclipse.ui.internal.PartStack.add(PartStack.java:479)
        at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
        at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
        at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
        at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
        at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
        at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
        at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
        at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
        at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
        at com.rim.tad.tools.qml.project.internal.wizard.QMLNewProjectWizard$2$1.run(QMLNewProjectWizard.java:221)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
        at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
        at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1029)
        at com.rim.tad.tools.qml.project.internal.wizard.QMLNewProjectWizard.performFinish(QMLNewProjectWizard.java:248)
        at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
        at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
        at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
        at org.eclipse.jface.window.Window.open(Window.java:801)
        at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:135)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    

    Any idea on how to solve this error?

    Thank you.

    A few of us have had this problem, the solution for me was to uninstall the kit development software and the remains of previous versions and reinstall.

  • Application that shows only the dialog boxes

    Hello

    I would like to write an application that typically runs in the background, but in certain conditions will need to display a dialog box. The dialog box is modal and on a separate thread.

    My question is whether it is possible to have this application that does not show a display main but just the dialog boxes when necessary.

    Is UiApplication the right approach? Can I have this app slot with invisible main screen or no screen at all but still be able to display dialogs?

    Best regards

    Orlin

    Apologies, one thing I forgot to say.  When you use GlobalScreens, you will notice that you can't push a Modal screen.  If you want to get feedback from the user and act accordingly, you will have to manage this feature using a DialogClosedListener.

  • How to freeze my application until the dialog box is closed?

    Hi everyone, I wonder how to freeze my application until the dialog box is closed.

    Please look at my code first:

    inputDialog=new InputReadMessageNumberDialog(selectedGroup.getName(),msg,numPost,choices,values);
    UiApplication.getUiApplication().invokeLater(new Runnable()
    {
      public void run()
      {
       inputDialog.show();
       if(inputDialog.doModal()==Dialog.OK){
       System.out.println("FROM: " + inputDialog.getFrom()+" TO:"+inputDialog.getTo());
       }
      }
    });
    

    As I throw the runtime exception, then I tried to do this:

    inputDialog=new InputReadMessageNumberDialog(selectedGroup.getName(),msg,numPost,choices,values);
    UiApplication.getUiApplication().invokeLater(new Runnable()
    {
      public void run()
      {
       inputDialog.show();
    
      }
    });while(true){  synchronized(this){    if(inputDialog.isClosed) break;    else wait(500);  }}if(inputDialog.doModal()==Dialog.OK){
    System.out.println("FROM: " + inputDialog.getFrom()+" TO:"+inputDialog.getTo());
    }
    

    She also throws an exception too. Now I don't know how to solve this problem.

    Any ideas?

    Thank you!

    Steve

    While I have deep religious convictions against the complicity of an author of the modal dialog box,

    I can say that this code seems to work and these dialog box classes are easy to use. If you

    Look at the API these altneratives will be pretty obvious.

    but there are two usages mixed with a be commented (both

    Work as much as I KNOW).

    String [] ch = new String() {"ACCEPT", "REJECT"};
    int [] vx is new int [] {Dialog.YES, Dialog.NO};.
    D = new dialog box dialog (m_tc, ch, vx, vx [0], new Bitmap (1,1));
           
    D = new dialog box dialog box (Dialog.D_YES_NO, m_tc, Dialog.NO, Bitmap (1,1), 0) new;
    F = d.getFont (police);
    d.setFont (f.derive (Font.PLAIN, f.getHeight () - 1));
    int x = d.doModal ();

    This will block your thread until there is something to "xx."

    However, I must reiterate that you evaluate the options before deciding that you need

    to lock all the other options. This is especially true in this environment where things

    might take some time and resources are limited.

    If you want to hang your entire application, no doubt you

    can define a volatile indicator around the doModal call and have other threads check it.

  • Close the dialog of Eventhandler

    Hello, I want to close a my custom eventhandler dialog box but I can't reach IDialog (nil). How can I do this?

    My code:

    Class MyTreeNodeEH: public CEventHandler

    {

    .....

    bool16 MyTreeNodeEH::ButtonDblClk (faces * e)

    {

    .....

    InterfacePtr < IDialog > iDialog panelData-> QueryInterface (IID_IDIALOG) ((IDialog*));

    iDialog-> Close();

    bool16 retval;

    InterfacePtr < IEventHandler > delegate (this, IID_MYTREENODEEH);

    retval = delegate-> ButtonDblClk (e);

    Return retval;

    }

    Try this in your method,

    InterfacePtr myParent (this, UseDefaultIID());

    InterfacePtr ((IDialog*) myParent-> QueryParentFor (IID_IDIALOG)); dialog

    If the dialog box (dialogue)-> Close();

  • Change the subject of the size of a StaticText (or any other) do so via the ScriptUIGraphics class?

    Hi all

    I am trying to create a dialog box for a custom Photoshop Script, what I did with success.

    However, I want now to basically add a StaticText element to a panel that contains a small note/warning to the user. I want this note for a font size smaller than the other labels/elements in the dialog box, but I can't find how to change the objects ScriptUIGraphics and ScriptUIFont of the StaticText element...

    Can someone show me the syntax to apply a new font size to a StaticText element, I need apparently to do through the onDraw() callback function please?

    Thank you!

    EDITORIAL: Adobe should really get their! @$# ! together and provide a reference to language ExtendScript which operates the same as the language and components Reference ActionScript3.0... with examples and all... instead of LITERALLY a half dozen PDFs with disjointed and hodgepodge documentation on objects and Classes.

    createDialog = function ( ) {
       var dlg = new Window( 'dialog', 'Font size example' );
       dlg.stExample = dlg.add( 'statictext', undefined, 'Example' );
       dlg.stExample.graphics.font = ScriptUI.newFont("Arial","REGULAR",9);
       dlg.btnPnl = dlg.add( 'panel', undefined );
       dlg.btnPnl.orientation = "row";
       dlg.btnPnl.alignment = "right";
       dlg.btnPnl.preferredSize [ 80, 80 ]
       dlg.btnPnl.okBtn = dlg.btnPnl.add( 'button', undefined, 'Ok', { name:'ok' });
       dlg.btnPnl.cancelBtn = dlg.btnPnl.add( 'button', undefined, 'Cancel', { name:'cancel' });
       return dlg;
    };
    initializeDialog = function( w ) {
       // Set up initial control states
    
        with ( w.btnPnl ) {
             // The Ok and Cancel buttons close this dialog
             okBtn.onClick = function ( ) { this.parent.parent.close( 1 ); };
             cancelBtn.onClick = function ( ) { this.parent.parent.close( 2 ); };
          }
     }
    
    runDialog = function( w ) {
       return w.show( );
    };
    var win = createDialog();
    initializeDialog(win);
    runDialog(win)
    
  • game focusing on the sprite class

    Hi, I'm tryin to set global focus to a specific class that already exists on the scene, after that I deleted a contextual dialog box on the screen. I pass the name of the class that was on the scene before the pop-up dialog box is displayed in the string to the popup class.

    If public void PopupMenu(pClass:String)

    Once I removed the pop-up dialog box, I want to restore developed in the previous class, so it can accept events key again.

    How would I set the focus to an instance of an object on the stage. Currently, I have something like this:

    Main.mainStage.focus = (InteractiveObject) (getDefinitionByName (prevClass));

    but he returned this error: TypeError: Error #1034: Type coercion failed: cannot convert com.cox::IdleScreen$ in flash.display.InteractiveObject.

    My IdleScreen class extends sprite, which is definitely on a higher level than InteractiveObject in the diagram to display objects. How can I set focus to this class on the stage?

    I know it can be focused because I can do Main.mainStage.focus = this inside of the class and it works...

    Mount the DisplayObject to InteractiveObject.

    Main.mainStage.focus = Main.mainStage.getChildAt (2) as InteractiveObject;

  • Go to the dialog box

    How to load a flash image using the Browse dialog box.

    package {}
    import flash.display.Sprite;
    import flash.events. *;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.net.URLRequest;

    SerializableAttribute public class FileReferenceExample extends Sprite {}
    private var uploadURL:URLRequest;
    private var file:FileReference;

    public void FileReferenceExample() {}
    uploadURL = new URLRequest();
    " uploadURL.url = ' http://localhost/ ";
    file = new FileReference();
    configureListeners (file);
    leader. Browse (getTypes ());
    }

    private void configureListeners(dispatcher:IEventDispatcher):void {}

    dispatcher.addEventListener (Event.SELECT, selectHandler);

    }

    private void getTypes (): Array {}
    var allTypes:Array = new Array (getImageTypeFilter ());
    return allTypes;
    }

    private void getImageTypeFilter (): FileFilter {
    return new FileFilter ("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.JPEG; *.gif, *.png");
    }
    private void selectHandler(event:Event):void {}
    var file:FileReference=FileReference(event.target);
    trace ("selectHandler: name =" + file.name + "URL =" + uploadURL.url);
    file.upload (uploadURL);
    }
    }
    }


    using this code, I choose image but to load it into flash back alone not the full path name

    In my limited knowledge, an image can be uploaded to a server using flash and a side script server.

    The Filereference class help find us the image switch to a side script server, this wiil upload the image that the user has selected to download. The path of the

    folder where the images to be uploaded are defined by us and the record have permission to download the files it contains.

    Using the path and the name of the image, we are able to load the picture in our film using the Loader class.

  • Creation of MsgTextInput on the Page of the dialog box

    Hello

    I have a requirement to create a msgtxtinput on the Page of the dialog box.
    I'm not sure that we do...
    If anyone has an idea please share.


    thanxs

    Pranav

    Hello

    create a new zone of battery... provision under which create the textinput desired...
    then assign a custom class controller controller.

    import from the region.

    Now make dialogue Page use the

    OADialogPage.setHeaderNestedRegionRefName () method to access this area.

    Thank you
    Gerard

Maybe you are looking for

  • CLIQ XT: Adding contact

    Is it possible to add a number of my recent calls list in my contact list? How? -

  • Device not detected in MAX

    I have a device connected to ethernet I can ping in CMD window but NEITHER MAX indicates that it is not present... How can I get NI MAX to detect this device as a gift? Thank you What Miss me? Thank you

  • The fingerprint sensor does not work

    Hello, I have reset windows on my laptop and the fingerprint sensor does not work, windows recognize the sensor, but in the Device Manager, windows says there is a problem with the sensor, "this device does not work properly because Windows cannot lo

  • install the version of net framework 2.2.50727.

    I am trying to install a program for a class of keyboard online.

  • Remote Desktop assistance or assistance

    The instructions to connect to the remote desktop do not meet the problem.  There must be a big step in lack.  Can someone tell me step by step to use these services. Thank you!