From 56b135cbebebd237d0b10588153be294ef7490fc Mon Sep 17 00:00:00 2001 From: Jouni Koivuviita Date: Mon, 7 Apr 2008 07:40:21 +0000 Subject: [PATCH] IWindow now sizes itself respective to its content if no size is explicitly specified. Use "-1" to clear any previous size settings. svn changeset:4132/svn branch:trunk --- .../terminal/gwt/client/ui/IWindow.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java index c8dd06824f..63ab0477be 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java @@ -33,10 +33,6 @@ import com.itmill.toolkit.terminal.gwt.client.Util; */ public class IWindow extends PopupPanel implements Paintable, ScrollListener { - private static final int DEFAULT_HEIGHT = 300; - - private static final int DEFAULT_WIDTH = 400; - private static final int MIN_HEIGHT = 60; private static final int MIN_WIDTH = 80; @@ -184,10 +180,6 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { DOM.setElementProperty(getElement(), "className", CLASSNAME); setWidget(contentPanel); - - // set default size - setWidth(DEFAULT_WIDTH + "px"); - setHeight(DEFAULT_HEIGHT + "px"); } public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { @@ -245,7 +237,7 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { int childIndex = 0; UIDL childUidl = uidl.getChildUIDL(childIndex++); while ("open".equals(childUidl.getTag())) { - // TODO multipe opens with the same target will in practice just + // TODO multiple opens with the same target will in practice just // open the last one - should we fix that somehow? final String parsedUri = client.translateToolkitUri(childUidl .getStringAttribute("src")); @@ -301,13 +293,13 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { final String parsedUri = client .translateToolkitUri(notification .getStringAttribute("icon")); - html += ""; + html += ""; } if (notification.hasAttribute("caption")) { - html += "

" + html += "

" + notification .getStringAttribute("caption") - + "

"; + + ""; } if (notification.hasAttribute("message")) { html += "

" @@ -443,8 +435,7 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { resizing = true; startX = DOM.eventGetScreenX(event); startY = DOM.eventGetScreenY(event); - origW = DOM.getIntStyleAttribute(getElement(), "width") - - BORDER_WIDTH_HORIZONTAL; + origW = getWidget().getOffsetWidth(); origH = getWidget().getOffsetHeight(); DOM.setCapture(getElement()); break; -- 2.39.5