-
5 Mar 2013 11:55 AM #1
Unanswered: Window resolution problem
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);
-
5 Mar 2013 4:41 PM #2
Just for kicks, try this:
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.Code:Window w = new Window(); w.setPixelSize(600,400); RootPanel.get().add(w);
A Viewport, by default, will take up all available height and width.
-
6 Mar 2013 3:40 AM #3
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.
-
6 Mar 2013 8:22 AM #4
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); } }
-
6 Mar 2013 9:15 AM #5
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>
-
8 Mar 2013 1:45 AM #6
I have find the solution. I override the window method aftershow, and I set the required size.



Reply With Quote