|
Re: PocketPC: size of Dialog [message #446802 is a reply to message #446750] |
Thu, 02 December 2004 15:14 |
Christophe Cornu Messages: 304 Registered: July 2009 |
Senior Member |
|
|
Hi Stefan,
Try the code below. By default, the Shell is full size and Shell.setBounds
is rarely used on the Pocket PC (only for small dialogs that are not very
common).
Chris
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
public class PR {
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
shell.setText("PR");
Menu bar = new Menu(shell, SWT.BAR);
shell.setMenuBar(bar);
MenuItem fileItem = new MenuItem (bar, SWT.CASCADE);
fileItem.setText ("File");
Menu submenu = new Menu (shell, SWT.DROP_DOWN);
fileItem.setMenu (submenu);
MenuItem item = new MenuItem (submenu, SWT.PUSH);
item.addListener (SWT.Selection, new Listener () {
public void handleEvent (Event e) {
Shell dialog = new Shell(shell, SWT.CLOSE);
Menu bar = new Menu(dialog, SWT.BAR);
dialog.setMenuBar(bar);
dialog.setLayout(new FillLayout());
Label l = new Label(dialog, SWT.SIMPLE);
l.setText("I am in a new dialog");
dialog.open();
}
});
item.setText ("new");
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
|
|
|
Re: PocketPC: size of Dialog [message #446827 is a reply to message #446802] |
Fri, 03 December 2004 09:18 |
Stefan Pietsch Messages: 68 Registered: July 2009 |
Member |
|
|
Hi Chris,
I tried SWT.CLOSE before. But for all that your mail helped me. I review
SWT-styles.
Up to now I used
SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE
Now I use
SWT.CLOSE | SWT.BORDER | SWT.APPLICATION_MODAL | SWT.RESIZE
because SWT.DIALOG_TRIM includes SWT.TITLE and this is the problem. Without
this style everything works fine.
Tanks
Stefan
"Christophe Cornu" <christophe_cornu@ca.ibm.com> schrieb im Newsbeitrag
news:conbgo$hst$1@www.eclipse.org...
> Hi Stefan,
>
> Try the code below. By default, the Shell is full size and Shell.setBounds
> is rarely used on the Pocket PC (only for small dialogs that are not very
> common).
>
> Chris
>
> import org.eclipse.swt.*;
> import org.eclipse.swt.widgets.*;
> import org.eclipse.swt.layout.*;
>
> public class PR {
>
> public static void main(String[] args) {
> Display display = new Display();
> final Shell shell = new Shell(display);
> shell.setText("PR");
> Menu bar = new Menu(shell, SWT.BAR);
> shell.setMenuBar(bar);
>
> MenuItem fileItem = new MenuItem (bar, SWT.CASCADE);
> fileItem.setText ("File");
> Menu submenu = new Menu (shell, SWT.DROP_DOWN);
> fileItem.setMenu (submenu);
> MenuItem item = new MenuItem (submenu, SWT.PUSH);
> item.addListener (SWT.Selection, new Listener () {
> public void handleEvent (Event e) {
> Shell dialog = new Shell(shell, SWT.CLOSE);
> Menu bar = new Menu(dialog, SWT.BAR);
> dialog.setMenuBar(bar);
> dialog.setLayout(new FillLayout());
> Label l = new Label(dialog, SWT.SIMPLE);
> l.setText("I am in a new dialog");
> dialog.open();
> }
> });
> item.setText ("new");
>
> shell.open();
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> }
> }
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03403 seconds