comparison 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
comparison
equal deleted inserted replaced
125:3e648bc53bde 126:c9843fbaac88
56 throw new GuiException ("Infite recursion of "~a); 56 throw new GuiException ("Infite recursion of "~a);
57 parent.recursionCheck (a); 57 parent.recursionCheck (a);
58 } 58 }
59 59
60 // Parent widgets need to implement this. 60 // Parent widgets need to implement this.
61 override void minSizeChange (IChildWidget widget, wdim mw, wdim mh) {} 61 override void minWChange (IChildWidget widget, wdim mw) {}
62 override void minHChange (IChildWidget widget, wdim mh) {}
62 //END IParentWidget methods 63 //END IParentWidget methods
63 64
64 //BEGIN Load and save 65 //BEGIN Load and save
65 // Base this() for child Widgets. 66 // Base this() for child Widgets.
66 protected this (IWidgetManager mgr, IParentWidget parent, widgetID id) { 67 protected this (IWidgetManager mgr, IParentWidget parent, widgetID id) {
234 foreach (w; subWidgets) 235 foreach (w; subWidgets)
235 c |= w.saveChanges; 236 c |= w.saveChanges;
236 return c; 237 return c;
237 } 238 }
238 239
240 size_t getWidgetIndex (IChildWidget widg) {
241 foreach (i,w; subWidgets)
242 if (w is widg)
243 return i;
244
245 throw new GuiException ("getWidgetIndex: widget not found (code error)");
246 }
247
239 protected: 248 protected:
240 IChildWidget[] subWidgets; 249 IChildWidget[] subWidgets;
241 } 250 }
242 /** ditto */ 251 /** ditto */
243 abstract class AParentSingleWidget : AWidget 252 abstract class AParentSingleWidget : AWidget