Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » PocketPC: size of Dialog
PocketPC: size of Dialog [message #446750] Thu, 02 December 2004 10:57 Go to next message
Stefan Pietsch is currently offline Stefan PietschFriend
Messages: 68
Registered: July 2009
Member
I created a little drawing application on my pocket pc. If the menuitem
"new" is pressed I open a dialog with some drawing templates.

How can I set the size of this dialog to full screen like a dialog-based
application?

My dialog was displayed inside the drawing application. It does not matter
if the dialogs parent is my application-shell or null.
Re: PocketPC: size of Dialog [message #446802 is a reply to message #446750] Thu, 02 December 2004 15:14 Go to previous messageGo to next message
Christophe Cornu is currently offline Christophe CornuFriend
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 Go to previous messageGo to next message
Stefan Pietsch is currently offline Stefan PietschFriend
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();
> }
> }
> }
>
>
Re: PocketPC: size of Dialog [message #446831 is a reply to message #446827] Fri, 03 December 2004 14:48 Go to previous message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Yes - you will only frequently use
new Shell(display)
new Shell(display, SWT.CLOSE)
new Shell(display, SWT.RESIZE)
on that platform.

SWT.RESIZE resizes with the SIP - look for it in
http://www.eclipse.org/articles/Article-small-cup-of-swt/poc ket-PC.html

Cheers,
Chris
Previous Topic:Import the classes from a jar which is in another jar file, using plugin extn pt
Next Topic:ResizeEvent handler for Application. Currently using Display.addFilter().
Goto Forum:
  


Current Time: Wed Oct 28 11:22:52 GMT 2020

Powered by FUDForum. Page generated in 0.02006 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top