Mercurial > projects > mde
diff mde/gui/widget/Widget.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 |
line wrap: on
line diff
--- a/mde/gui/widget/Widget.d Thu Jan 15 16:52:46 2009 +0000 +++ b/mde/gui/widget/Widget.d Sat Jan 17 16:11:26 2009 +0000 @@ -82,8 +82,13 @@ //END Load and save //BEGIN Size and position - override bool isWSizable () { return false; } - override bool isHSizable () { return false; } + // default to not resizable + override bool isWSizable () { + return false; + } + override bool isHSizable () { + return false; + } /* Return minimal/fixed size. */ override wdim minWidth () { @@ -163,7 +168,7 @@ // Debug function to print size info. Intended to be correct not optimal. debug override void logWidgetSize () { - logger.trace ("Current size: {,4},{,4}; minimal: {,4},{,4} - {,-50} {}", w,h, this.minWidth, this.minHeight, this, id); + logger.trace ("Current size: {,4},{,4}; minimal: {,4},{,4}; sizable: {,5},{,5} - {,-50} {}", this.width, this.height, this.minWidth, this.minHeight, this.isWSizable, this.isHSizable, this, id); } protected: @@ -229,7 +234,7 @@ debug (mdeWidgets) logger.trace ("AParentWidget.setup"); bool c = false; foreach (w; subWidgets) { - debug assert (w); + debug assert (w, "AParentWidget: w is null"); c |= w.setup (n,flags); } return c; @@ -268,7 +273,7 @@ override bool setup (uint n, uint flags) { debug (mdeWidgets) logger.trace ("AParentSingleWidget.setup"); - debug assert (subWidget); + debug assert (subWidget, "AParentSingleWidget: subWidget is null"); return subWidget.setup (n,flags); } @@ -308,8 +313,12 @@ super (mgr, parent, id); } - override bool isWSizable () { return true; } - override bool isHSizable () { return true; } + override bool isWSizable () { + return true; + } + override bool isHSizable () { + return true; + } } /** For pressable buttons.