diff mde/gui/widget/miscContent.d @ 130:c5c38eaadb64

Changed how sizability is set for parents: can require all sub-widgets resizable or only one to set parent resizable. Ifaces.IParentWidget.SIZABILITY controlling parent sizability. TextWidget no longer vertically resizable (since multi-line editing is not supported).
author Diggory Hardy <diggory.hardy@gmail.com>
date Sat, 17 Jan 2009 16:11:26 +0000
parents ad91de8867a0
children 9cff74f68b84
line wrap: on
line diff
--- a/mde/gui/widget/miscContent.d	Thu Jan 15 16:52:46 2009 +0000
+++ b/mde/gui/widget/miscContent.d	Sat Jan 17 16:11:26 2009 +0000
@@ -147,11 +147,8 @@
             throw new ContentException (this);
         WDCheck (data, 1, subWidgets.length);
         
-        foreach (i,sc; content.list) {
+        foreach (i,sc; content.list)
             subWidgets[i] = mgr.makeWidget (this, data.strings[i], sc);
-            isWS |= subWidgets[i].isWSizable;
-            isHS |= subWidgets[i].isHSizable;
-        }
         currentW = subWidgets[content()];
         
         content.addCallback (&switchWidget);
@@ -164,6 +161,17 @@
             mh = currentW.minHeight;
             w = currentW.width;
             h = currentW.height;
+            static if (SIZABILITY & SIZABILITY_ENUM.START_TRUE)
+                    isWS = isHS = true;
+            foreach (i,sc; content.list) {
+                static if (SIZABILITY == SIZABILITY_ENUM.ANY_SUBWIDGETS) {
+                    isWS |= subWidgets[i].isWSizable;
+                    isHS |= subWidgets[i].isHSizable;
+                } else static if (SIZABILITY == SIZABILITY_ENUM.ALL_SUBWIDGETS) {
+                    isWS &= subWidgets[i].isWSizable;
+                    isHS &= subWidgets[i].isHSizable;
+                }
+            }
         }
         return r;
     }