2004/01/17 07:30:31
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:44:43 +0000 (07:44 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:44:43 +0000 (07:44 +0000)
darcs-hash:20040130074443-2ba56-1941f7e723992e020907dfac5dcb228091a80a0d.gz

src/org/xwt/Box.java
src/org/xwt/Surface.java
src/org/xwt/plat/AWT.java

index 9bb8645..e00ecf7 100644 (file)
@@ -509,8 +509,12 @@ public final class Box extends JSScope implements Scheduler.Task {
         case "height": put("maxheight", value); put("minheight", value); MARK_RESIZE;
         case "maxwidth": setMaxWidth(value);
         case "minwidth": CHECKSET_INT(minwidth); MARK_RESIZE;
+                         if (parent == null && getSurface() != null)
+                             getSurface().setMinimumSize(minwidth, minheight, minwidth != maxwidth || minheight != maxheight);
         case "maxheight": setMaxHeight(value);
         case "minheight": CHECKSET_INT(minheight); MARK_RESIZE;
+                         if (parent == null && getSurface() != null)
+                             getSurface().setMinimumSize(minwidth, minheight, minwidth != maxwidth || minheight != maxheight);
         case "colspan": CHECKSET_SHORT(colspan); MARK_REPACK_parent;
         case "rowspan": CHECKSET_SHORT(rowspan); MARK_REPACK_parent;
         case "rows": CHECKSET_SHORT(rows); if (rows==0){set(FIXED, COLS);if(cols==0)cols=1;} else set(FIXED, ROWS); MARK_REPACK;
index 99533f6..79a6194 100644 (file)
@@ -79,6 +79,7 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task {
     public abstract void setTitleBarText(String s);    ///< Sets the surface's title bar text, if applicable
     public abstract void setIcon(Picture i);           ///< Sets the surface's title bar text, if applicable
     public abstract void _dispose();                   ///< Destroy the surface
+    public void setMinimumSize(int minx, int miny, boolean resizable) { }
 
     protected void setSize(int w, int h) {
         if (w == actualWidth && h == actualHeight) return;
index 6a0ed9b..7c775bb 100644 (file)
@@ -296,6 +296,8 @@ public class AWT extends JVM {
 
         class InnerFrame extends Frame {
             public InnerFrame() throws java.lang.UnsupportedOperationException { }
+            public Dimension getMinimumSize() {
+                return new Dimension(root == null ? 0 : root.minwidth, root == null ? 0 : root.minheight); }
             public void update(Graphics gr) { paint(gr); }
             public void paint(Graphics gr) {
                 Rectangle r = gr.getClipBounds();
@@ -313,6 +315,8 @@ public class AWT extends JVM {
 
         class InnerWindow extends Window {
             public InnerWindow() throws java.lang.UnsupportedOperationException { super(new Frame()); }
+            public Dimension getMinimumSize() {
+                return new Dimension(root == null ? 0 : root.minwidth, root == null ? 0 : root.minheight); }
             public void update(Graphics gr) { paint(gr); }
             public void paint(Graphics gr) {
                 Rectangle r = gr.getClipBounds();
@@ -320,6 +324,8 @@ public class AWT extends JVM {
             }
         }
 
+        public void setMinimumSize(int minx, int miny, boolean resizable) { if (frame != null) frame.setResizable(resizable); }
+
         public void render() {
             // useful optimizatin;
             window.setBackground((root.fillcolor & 0xFF000000) == 0 ?