[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: How to exit from maximize tables?

Showing a shell with a native close decoration requires that its title bar
be visible, but there's no way to stop a user from double-clicking the title
bar and restoring the shell's size.  So you need a full-screen shell that
provides some other means of being closed.  The 3.4 stream has API
Shell.setFullScreen() which is the best way to create a full screen shell
without decorations.  A full-screen-sized NO_TRIM shell is a workaround that
should be okay if you're using an eclipse/swt version prior to 3.4.

Double-click events should work in both of these cases, and the small
snippet (below) works for me on win2000.  If you have a case where you are
not receiving double-click events then please log a bug with swt (
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform&component=SWT )
and provide a snippet that shows it happening.

public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display, SWT.NO_TRIM);
    shell.setBounds(10,10,400,400);
    shell.setLayout(new GridLayout());
    shell.open();
    //shell.setFullScreen(true);
    shell.addListener(SWT.MouseDoubleClick, new Listener() {
        public void handleEvent(Event event) {
            System.out.println("double click");
            shell.dispose();
        }
    });
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
}

Grant


"Robert B" <oh1226@xxxxxxxxxxx> wrote in message
news:fr817j$25a$1@xxxxxxxxxxxxxxxxxxxx
> I am making a popup shell that fills entire screen as system modal,
> showing a table. If I use trim, when they doubleclick title bar,
> it becomes normal size. I cannot find a way to prevent this.
> Trims have only the close button. I diabled everything except
> this double cliking the title bar.
>
> The other approach I am trying is NO_TRIM option. In this case,
> double click is a standard exit method. However double click
> events are not generated. So no exit method other than ESC key.
>
> R.
>
>
>