dardison
30 Apr 2008, 7:23 AM
Hi all,
I'm trying to refactor some code I have it working in 0.5.2 and I found that I don't have WidgetContainer class anymore in 1.0.
What I'm doing is porting a Desktop like app can manage other windows.
So I have a viewport and the viewport has a toolbar and use to have a WidgetContainer in 0.5.2. This container I have it only to determine the rectangle bounds I have left to render the windows.
So I have a DesktopView view with this code in 0.5.2:
WidgetContainer c = new WidgetContainer();
mViewport.add(c, new RowData(RowData.FILL_BOTH));
mViewport.layout();
mViewport.hideLoadingPanel("cargando");
Registry.register("viewport", mViewport);
Registry.register("desktop-container", c);
Then I have static methods in a Desktop class to get the bounds like:
public static Widget getContainer() {
return (Widget) Registry.get("desktop-container");
}
public static Rectangle getBounds() {
return MyDOM.getBounds(getContainer().getElement());
}
Then when I need to render I use:
final Rectangle desktopBounds = Desktop.getBounds();
If anyone knows how to replace this code in 1.0 I will appreciate.
Thanks.
Daniel
I'm trying to refactor some code I have it working in 0.5.2 and I found that I don't have WidgetContainer class anymore in 1.0.
What I'm doing is porting a Desktop like app can manage other windows.
So I have a viewport and the viewport has a toolbar and use to have a WidgetContainer in 0.5.2. This container I have it only to determine the rectangle bounds I have left to render the windows.
So I have a DesktopView view with this code in 0.5.2:
WidgetContainer c = new WidgetContainer();
mViewport.add(c, new RowData(RowData.FILL_BOTH));
mViewport.layout();
mViewport.hideLoadingPanel("cargando");
Registry.register("viewport", mViewport);
Registry.register("desktop-container", c);
Then I have static methods in a Desktop class to get the bounds like:
public static Widget getContainer() {
return (Widget) Registry.get("desktop-container");
}
public static Rectangle getBounds() {
return MyDOM.getBounds(getContainer().getElement());
}
Then when I need to render I use:
final Rectangle desktopBounds = Desktop.getBounds();
If anyone knows how to replace this code in 1.0 I will appreciate.
Thanks.
Daniel