diff mde/gui/widget/Widget.d @ 126:c9843fbaac88

Dynamic minimal size changing improved; works over layouts sharing alignment. EnumContent sub-contents use EnumValueContent instead of BoolContent; fixes a few small bugs. EnumContent substrings get translated (bug fixed). The widget manager no longer attempts to set widget sizes smaller than their minimals, even though some will not be shown. SwitchWidget: has fixed sizableness now.
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 08 Jan 2009 13:05:44 +0000
parents d3b2cefd46c9
children ad91de8867a0
line wrap: on
line diff
--- a/mde/gui/widget/Widget.d	Tue Jan 06 16:54:04 2009 +0000
+++ b/mde/gui/widget/Widget.d	Thu Jan 08 13:05:44 2009 +0000
@@ -58,7 +58,8 @@
     }
     
     // Parent widgets need to implement this.
-    override void minSizeChange (IChildWidget widget, wdim mw, wdim mh) {}
+    override void minWChange (IChildWidget widget, wdim mw) {}
+    override void minHChange (IChildWidget widget, wdim mh) {}
 //END IParentWidget methods
     
 //BEGIN Load and save
@@ -236,6 +237,14 @@
         return c;
     }
     
+    size_t getWidgetIndex (IChildWidget widg) {
+        foreach (i,w; subWidgets)
+            if (w is widg)
+                return i;
+        
+        throw new GuiException ("getWidgetIndex: widget not found (code error)");
+    }
+    
 protected:
     IChildWidget[] subWidgets;
 }