pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh R <tripano...@gmail.com>
Subject Re: Dialog opened from menu loses focus
Date Thu, 23 Aug 2012 15:32:44 GMT
> Download the contrib jar from the above link(I just add it to
> external-jars on my eclipse build-path). Add this code in your
> Main.java
>
>
>                 //dialog.setModal(false);
>                 //dialog.open(Main.this);
>
>                 Dialog d = new Dialog("my-dialog", true);
>                 BlockingDialog bd = new BlockingDialog();
>                 bd.setContent(d);
>                 bd.open(Main.this.getDisplay());
>
>

Once you get the above working then try this:

Add the following in Main.java

	public class MyForm {
		Form form;
		TextInput ti1;
		Form.Section section;

		public MyForm() {
			form = new Form();
			ti1 = new TextInput();
			section = new Form.Section();
			section.add(ti1);
			section.add(new Label()); /* to create empty space */
			form.getSections().add(section);
			Form.setFlag(ti1, "{messageType:'info', message:'Enter chars only.'}");
		}
	}

.....
                //dialog.setModal(false);
                //dialog.open(Main.this);

                Dialog d = new Dialog("my-dialog", true);
                BlockingDialog bd = new BlockingDialog();
                MyForm ahf = new MyForm();
                d.setContent(ahf.form);
                bd.setContent(d);
                bd.open(Main.this.getDisplay());

Run the app, click the button and then point the mouse at the
text-field and watch the tool-tip pop-up .... Pivot's awesome, isn't
it ;) ?


thanks

Mime
View raw message