×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    52

    Smile screen orientation problem with device

    hello friends

    my first question is:

    [1]i have developing ListBox in Mobileshell when user clicking on the ListBox item i have opening some other shell, i am showing TimedMessageBox when user clicking item of ListBox at that time when i change Nokia N97 screen orientation application going to be a crash this things is not happening in the Nokia N97 Emulator , but only happening in the device in that specific shell , but this issues is not happening in the other shell when i doing that.

    please help me to find out solution or give some code link for screen orientation handling

    and my second question is :

    [2]can we put SWT progress-bar on SWT MobilezShell with effect of same as like TimedMessageBox in Nokia N97

    hello friend please help me it is really urgent , i have wasting 3 days in this issues ,please give me some proper solution for that

    my code is below
    my problem is:-when i test my application in simulator for that specific shell operation there is not any problem but in


    public void widgetDefaultSelected(SelectionEvent se) {

    listBox.removeSelectionListener(this);



    nextAction(se);

    showDialog("Please Wait!", SWT.ICON_INFORMATION);

    }

    private void showDialog(String msg, int icon) {
    TimedMessageBox messageBox = new TimedMessageBox(currentShell, icon);
    messageBox.setMessage(msg);
    messageBox.open();
    }

    public void nexaction(SelectionEvent se1){

    .
    ..
    ..
    ...
    opening other shell at here




    }

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    8

    Re: screen orientation problem with device

    Hi,

    I was not able to reproduce the problem you describe.

    Here is what I tried:

    Code:
    import javax.microedition.midlet.*;
    import org.eclipse.ercp.swt.mobile.Command;
    import org.eclipse.ercp.swt.mobile.ListBox;
    import org.eclipse.ercp.swt.mobile.ListBoxItem;
    import org.eclipse.ercp.swt.mobile.MobileShell;
    import org.eclipse.ercp.swt.mobile.TimedMessageBox;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.events.SelectionEvent;
    import org.eclipse.swt.events.SelectionListener;
    import org.eclipse.swt.layout.FillLayout;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;
    
    public class Template extends MIDlet implements Runnable {
    
        private Thread UIThread;
        private Display display;
        private Shell shell;
    
        public void startApp() {
            if (UIThread == null) {
                UIThread = new Thread(this);
                UIThread.start();
            }
        }
    
        public void pauseApp() {
        }
    
        public void destroyApp(boolean unconditional) {
            shell.dispose();
        }
    
        public void run() {
            display = new Display();
            shell = new MobileShell(display, 0, MobileShell.SMALL_STATUS_PANE);
            shell.setText("MobileShell");
            shell.setLayout(new FillLayout(SWT.VERTICAL));
            
            final ListBox list = new ListBox(shell, SWT.V_SCROLL, ListBox.LB_STYLE_2LINE_ITEM);
            ListBoxItem[] items = new ListBoxItem[100];
            for (int i = 0; i < items.length; i++) {
                items[i] = new ListBoxItem(i + " item", null, i + " item", null);
            }
            list.setDataModel(items);
            
            list.addSelectionListener(new SelectionListener(){
                public void widgetDefaultSelected(SelectionEvent arg0) {
                    list.removeSelectionListener(this);
                    
                    Shell s = new Shell(shell);
                    s.open();
                    
                    TimedMessageBox dlg = new TimedMessageBox(shell, SWT.ICON_WORKING);
                    dlg.setMessage("Please wait");
                    dlg.open();
                }
                public void widgetSelected(SelectionEvent arg0) {
                }});
            
            Command cmd = new Command(shell, Command.EXIT, 0);
            cmd.setText("Exit");
            cmd.addSelectionListener(new SelectionListener(){
                public void widgetDefaultSelected(SelectionEvent arg0) {
                }
                public void widgetSelected(SelectionEvent arg0) {
                    shell.dispose();
                }});
            
            shell.layout();
            shell.open();
    
            while (!shell.isDisposed()) {
                if (!display.readAndDispatch()) {
                    display.sleep();
                }
            }
    
            display.dispose();
            notifyDestroyed();
        }
    }

  3. #3
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    52

    Re: screen orientation problem with device

    first of thank you Petru.Motrescu for your reply

    OK i will try to describe problem with simple scenario

    step by step:
    i think you get my point is that i use ListBox and using its selectionlistner method

    i open other shell when i click on the item of ListBox (i have see your code , i think you get my point)

    now i am testing application in Nokia N97 Device ok
    when user click on ListBox (you and me both are showing TimedMessageBox) item at the same time if suddenly i changing mobile screen orientation until the new shell is not opening ---in you code this line "s.open();" is not still executing--(in Nokia N97 Device -i change portrait to Landscape or Landscape to portrait mode) at the same time my application is going directly to crash without any message or alert

    now i think you get my point sir,


    thank you










    Quote Originally Posted by Petru.Motrescu View Post
    Hi,

    I was not able to reproduce the problem you describe.

    Here is what I tried:

    Code:
    import javax.microedition.midlet.*;
    import org.eclipse.ercp.swt.mobile.Command;
    import org.eclipse.ercp.swt.mobile.ListBox;
    import org.eclipse.ercp.swt.mobile.ListBoxItem;
    import org.eclipse.ercp.swt.mobile.MobileShell;
    import org.eclipse.ercp.swt.mobile.TimedMessageBox;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.events.SelectionEvent;
    import org.eclipse.swt.events.SelectionListener;
    import org.eclipse.swt.layout.FillLayout;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;
    
    public class Template extends MIDlet implements Runnable {
    
        private Thread UIThread;
        private Display display;
        private Shell shell;
    
        public void startApp() {
            if (UIThread == null) {
                UIThread = new Thread(this);
                UIThread.start();
            }
        }
    
        public void pauseApp() {
        }
    
        public void destroyApp(boolean unconditional) {
            shell.dispose();
        }
    
        public void run() {
            display = new Display();
            shell = new MobileShell(display, 0, MobileShell.SMALL_STATUS_PANE);
            shell.setText("MobileShell");
            shell.setLayout(new FillLayout(SWT.VERTICAL));
            
            final ListBox list = new ListBox(shell, SWT.V_SCROLL, ListBox.LB_STYLE_2LINE_ITEM);
            ListBoxItem[] items = new ListBoxItem[100];
            for (int i = 0; i < items.length; i++) {
                items[i] = new ListBoxItem(i + " item", null, i + " item", null);
            }
            list.setDataModel(items);
            
            list.addSelectionListener(new SelectionListener(){
                public void widgetDefaultSelected(SelectionEvent arg0) {
                    list.removeSelectionListener(this);
                    
                    Shell s = new Shell(shell);
                    s.open();
                    
                    TimedMessageBox dlg = new TimedMessageBox(shell, SWT.ICON_WORKING);
                    dlg.setMessage("Please wait");
                    dlg.open();
                }
                public void widgetSelected(SelectionEvent arg0) {
                }});
            
            Command cmd = new Command(shell, Command.EXIT, 0);
            cmd.setText("Exit");
            cmd.addSelectionListener(new SelectionListener(){
                public void widgetDefaultSelected(SelectionEvent arg0) {
                }
                public void widgetSelected(SelectionEvent arg0) {
                    shell.dispose();
                }});
            
            shell.layout();
            shell.open();
    
            while (!shell.isDisposed()) {
                if (!display.readAndDispatch()) {
                    display.sleep();
                }
            }
    
            display.dispose();
            notifyDestroyed();
        }
    }

Similar Threads

  1. Problem with change screen orientation
    By svopex in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-11-10, 12:19
  2. Problem with E90 and secondary screen
    By Tatanka.nbr1 in forum Symbian
    Replies: 5
    Last Post: 2008-06-27, 10:01
  3. Replies: 2
    Last Post: 2008-01-15, 11:53
  4. Replies: 1
    Last Post: 2006-08-18, 10:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×