×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    10

    Smile How to stop the browser from resizing itself in eclipse eswt screen

    I am developing a midlet using eswt. It has a image at the top, browser at the middle and the footer image at the bottom

    My code is

    Code:
    demoShell = new Shell(SWT.MAX);
           
            demoShell.setText("Browser");
            demoShell.setLayout(new RowLayout(SWT.HORIZONTAL));
           
    
            demoShell.setSize(240,320);
            demoShell.layout();
    
            closeCommand = new Command(demoShell, Command.EXIT, 0);
            closeCommand.setText("Close");
            closeCommand.addSelectionListener(this);
    
            InputStream is = getClass().getResourceAsStream("/footer.gif");
            angryImage = new Image(demoShell.getDisplay(), is);
            img = new Label(demoShell, SWT.TOP);
            img.setImage(angryImage);
    
            backCommand = new Command(demoShell, Command.BACK, 0);
            backCommand.setText("Back");
            backCommand.addSelectionListener(this);
    
            forwardCommand = new Command(demoShell, Command.OK, 0);
            forwardCommand.setText("Forward");
            forwardCommand.addSelectionListener(this);
    
            goToWebPageCommand = new Command(demoShell, Command.OK, 0);
            goToWebPageCommand.setText("Go To Web Page");
            goToWebPageCommand.addSelectionListener(this);
    
            //create the browser
            browser = new Browser(demoShell, SWT.NONE);
            //browser.setSize(260, 240);
            browser.setBounds(5, 75, 240, 100);
            
            browser.pack(false);
    
            img = new Label(demoShell, SWT.BOTTOM);
            img.setImage(angryImage);
    
            demoShell.open();
            demoShell.setActive();
    
            //browse to nokia.com
            browser.setUrl("http://forumnokia.mobi");
    When I start the application the layout shows correctly with 2 images with the browser. After few seconds the browser stretches itself in such a way, the image below the browser hides itself. Is there any way to stop resizing the browser? or is there any other way to render the browser with the 2 images correctly?

    Thanks in advance,
    Girish

  2. #2
    Nokia Developer Expert
    Join Date
    Nov 2008
    Posts
    72

    Re: How to stop the browser from resizing itself in eclipse eswt screen

    The preferred size of the Browser on S60 is screen size so the next time layout manager (in your case RowLayout) tries to layout it resizes the Browser. You can use the RowData to hint a preferred size for Browser to RowLayout. Or if you want a more scalable solution that does not depend on fixed size values. You can use GridLayout and GridData.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    10

    Re: How to stop the browser from resizing itself in eclipse eswt screen

    Thanks for the reply. I used RowData and the browser fits correctly without stretching itself.

    Thanks again,
    Girish

Similar Threads

  1. Custom window in ALL screen modes
    By PawelDefee in forum Symbian
    Replies: 11
    Last Post: 2009-02-11, 09:19
  2. Resizing CFbsBitGc?
    By Haktivex in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-04-19, 12:23
  3. UI: Full Screen Mode
    By GENERAL_INFO in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-11-22, 06:27

Posting Permissions

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