Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328984 - fullscreen problems with WM6 and VKB
Summary: fullscreen problems with WM6 and VKB
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: ERCP (show other bugs)
Version: unspecified   Edit
Hardware: Other Windows Mobile 5.0
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: ercp.eswt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-28 17:00 EDT by Wolfgang Röckelein CLA
Modified: 2021-07-15 12:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Röckelein CLA 2010-10-28 17:00:55 EDT
There are numerous problems with fullscreen on WM6 with the VKB resizing.
Álso org.eclipse.swt.custom.ScrolledComposite.setShowFocusedControl(true) does not work.
The following code works without fullscreen but on fullscreen all hell breaks loose:

import org.eclipse.ercp.swt.mobile.Command;
import org.eclipse.ercp.swt.mobile.MobileDevice;
import org.eclipse.ercp.swt.mobile.MobileShell;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.Platform;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class Start {

	private static final Display display = new Display();
	private static MobileShell shell;
	private static Shell shell2;
	private static ScrolledComposite sc;
	private static Composite c;

	public static void main(String args[]) {
		MobileDevice.getMobileDevice().setVKStatus(MobileDevice.VK_NORMAL);
		shell = new MobileShell(display, SWT.CLOSE);
		shell.addListener(SWT.Close, new Listener() { public void handleEvent(Event event) {
			exit();
		}});
		shell.setBounds(display.getBounds());
		shell.setFullScreenMode(false, false);

		shell2 = (Platform.isWindowMobile())?new Shell(shell, SWT.NONE):shell;
		shell2.setLayout(new FillLayout());

		sc = new ScrolledComposite(shell2, SWT.V_SCROLL );
		sc.setExpandHorizontal(true);
		sc.setShowFocusedControl(true);
		c = new Composite(sc, SWT.NONE);
		sc.setContent(c);
		c.setLayout(new GridLayout());
		
		final Button button = new Button(c,SWT.PUSH);
		button.setLayoutData(new GridData(SWT.FILL,SWT.DEFAULT,true,false));
		button.setText("Close");
		button.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) {
			exit();
		}});

		for (int i = 0; i < 29; i++) {
			final Text text = new Text(c,SWT.BORDER|SWT.SINGLE);
			text.setText("example" + i);
			text.setLayoutData(new GridData(SWT.FILL,SWT.DEFAULT,true,false));
			new Label(c,SWT.SEPARATOR|SWT.HORIZONTAL).setLayoutData(new GridData(SWT.FILL,SWT.DEFAULT,true,false));
		}
		final Text text = new Text(c,SWT.BORDER|SWT.SINGLE);
		text.setText("example with command");
		text.setLayoutData(new GridData(SWT.FILL,SWT.DEFAULT,true,false));
		new Command(text,Command.GENERAL, 1).setText("Command");

		shell.addListener(SWT.Resize, new Listener() { public void handleEvent(Event event) {
			adjustSize();
		}});
		sc.addListener(SWT.Resize, new Listener() { public void handleEvent(Event event) {
			adjustSize();
		}});
		adjustSize();
		shell2.setVisible(true);
		shell.open();
		text.setFocus();
		while (!shell.isDisposed())  {
			if (!shell.getDisplay().readAndDispatch()) {
				shell.getDisplay().sleep();
			}
		}
	}
	
	public static void exit() {
		shell.setVisible(false);
		shell.dispose();
		Start.display.dispose();
		System.exit(0);
	}

	public static void adjustSize() {
		if (Platform.isWindowMobile()) {
			final Rectangle rect = shell.getBounds();
			shell2.setBounds(rect.x + 1, rect.y + 1, rect.width - 1, rect.height -1);
		} else
			shell.layout(true);
		sc.setMinSize(shell2.getClientArea().width-sc.getVerticalBar().getSize().x, SWT.DEFAULT);
		c.setSize(c.computeSize(SWT.DEFAULT, SWT.DEFAULT));
		c.layout();
	}
}
Comment 1 Conrad Groth CLA 2016-06-05 04:42:32 EDT
Project ERCP was archived.