Results 1 to 6 of 6

Thread: Window resolution problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    8
    Vote Rating
    0
      0  

    Default Unanswered: Window resolution problem

    Hello folks
    I have a problem when I try to add a new window on my desktop
    When I proceed to add it, no matter wether I do set height and width or not, the window has a fixed, small resolution and I'm not able to change it
    I do have this problem even if I just create a new Window, I manually set in place height and width and I call the show() method.
    Code:
    Desktop desktop = new Desktop();
    Window mywin = new Window();
    mywin.setHeight("400");
    mywin.setWidth("600");
    desktop.addWindow(mywin);

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    413
    Answers
    20
    Vote Rating
    21
      0  

    Default

    Just for kicks, try this:

    Code:
    Window w = new Window();
    w.setPixelSize(600,400);
    
    RootPanel.get().add(w);
    If this works, sizing-wise, I suspect it's an issue with Deskop and how it's being added to your root panel. Am I correct in assuming that you want the Desktop to take up the full height and width of the browser's viewport? If so, try putting it in a Viewport and then adding the Viewport to the RootPanel.

    A Viewport, by default, will take up all available height and width.

  3. #3
    Sencha User
    Join Date
    May 2011
    Posts
    11
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Yes, I try the code and the window respects the size, but how can I add this window to Desktop application with customizing the size? If I add the window directly to RootPanel I lose the management of the desktop toolbar.

  4. #4
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    413
    Answers
    20
    Vote Rating
    21
      0  

    Default

    Here, try this, it works for me:

    Code:
    public class DesktopTest implements EntryPoint
    {
       @Override
       public void onModuleLoad()
       {
          Desktop d = new Desktop();
    
          Window w = new Window();
          w.setHeadingText("My Window");
          w.setPixelSize(600, 400);
          d.addWindow(w);
          d.activate(w);
    
          Viewport vp = new Viewport();
          vp.setWidget(d);
    
          RootPanel.get().add(vp);
       }
    }

  5. #5
    Sencha User
    Join Date
    May 2011
    Posts
    11
    Answers
    1
    Vote Rating
    0
      0  

    Default

    I tried but still does not work. Any other ideas?
    I followed the following steps:
    1)I have created a jar file that contains the desktop application downloaded from sencha
    2)I put this jar in my project
    3)I have created this gxt.xml

    <module rename-to='desktop'>
    <inherits name='com.sencha.gxt.desktop.Desktop' />
    <inherits name="com.google.gwt.logging.Logging" />
    <inherits name='com.sencha.gxt.chart.Chart' />

    <set-property name="gxt.logging.enabled" value="false" />
    <set-property name="gwt.logging.logLevel" value="INFO" />
    <set-property name="gwt.logging.consoleHandler" value="ENABLED" />
    <set-property name="gwt.logging.popupHandler" value="DISABLED" />

    <inherits name ='com.sencha.gxt.legacy.Legacy'></inherits>

    <set-configuration-property name='CssResource.style' value='pretty' />
    <entry-point class='com.myProject.client.desktop.DesktopApp' />

    <source path='client' />
    <source path='shared' />
    <source path='server' />
    </module>

    EntryPoint:

    public class DesktopApp implements EntryPoint{

    private Desktop desktop = new Desktop();

    private TaskBar taskBar = null;



    @Override
    public void onModuleLoad() {



    taskBar = desktop.getTaskBar();

    desktop.layout(DesktopLayoutType.CENTER);



    Window win = new Window();
    win.setPixelSize(500,500)


    desktop.addWindow(win );




    RootPanel.get().add(desktop);
    }

    the htmlfile:
    <!doctype html>
    <!-- The DOCTYPE declaration above will set the -->
    <!-- browser's rendering engine into -->
    <!-- "Standards Mode". Replacing this declaration -->
    <!-- with a "Quirks Mode" doctype is not supported. -->

    <html>
    <head>
    <title>LAMOS</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="desktop/reset.css">


    <script type="text/javascript" language="javascript" src="desktop/desktop.nocache.js"></script>
    </head>

    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>

    <noscript>
    <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
    Your web browser must have JavaScript enabled
    in order for this application to display correctly.
    </div>
    </noscript>
    </body>
    </html>

  6. #6
    Sencha User
    Join Date
    May 2011
    Posts
    11
    Answers
    1
    Vote Rating
    0
      0  

    Default

    I have find the solution. I override the window method aftershow, and I set the required size.

Posting Permissions

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