diff mde/gui/widget/Ifaces.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/Ifaces.d	Thu Jan 15 16:52:46 2009 +0000
+++ b/mde/gui/widget/Ifaces.d	Sat Jan 17 16:11:26 2009 +0000
@@ -15,6 +15,9 @@
 
 /*************************************************************************************************
  * Widget interfaces.
+ * 
+ * This module contains the primary documentation for the declared methods; also the Widget module
+ * has some brief comments and basic implementations.
  *
  * Widgets are connected as the nodes of a tree. Widgets know their parent as a IParentWidget
  * class and their children as IChildWidget classes. The gui manager is a special widget only
@@ -55,6 +58,24 @@
      *	mh	= New minimal height */
     void minWChange (IChildWidget widget, wdim mw);
     void minHChange (IChildWidget widget, wdim mh);	/// ditto
+    
+    /** Governor of parent widget resizability, where this is determined by sub-widgets
+     * (e.g. this doesn't apply to FloatingAreaWidget).
+     *
+     * NEVER and ALWAYS often don't result in usable GUIs, and aren't expected to be used except
+     * for debugging.
+     * 
+     * NOTE: ANY_SUBWIDGETS can cause problems like enlarging a menu bar containing a resizable
+     * blank instead of the main part of a window. */
+    enum SIZABILITY_ENUM {
+        NEVER		= 0,	/// Parents are never resizable
+        ALL_SUBWIDGETS	= 3,	/// Parents are only resizable if all sub-widgets are
+        ANY_SUBWIDGETS	= 2,	/// Parents are resizable if any sub-widgets are
+        ALWAYS		= 1,	/// Parents are always resizable
+        START_TRUE	= 1,	/// Flag set by ALWAYS and ALL_SUBWIDGETS
+        SUBWIDGETS	= 2,	/// Flag set by ALL_SUBWIDGETS and ANY_SUBWIDGETS
+    }
+    static const SIZABILITY = SIZABILITY_ENUM.ALL_SUBWIDGETS;	/// ditto
 }
 
 
@@ -212,10 +233,11 @@
 //BEGIN Size and position
     /** Is the width / height resizable?
      *
-     * This really means does the widget benifit from being enlarged? Any widget should occupy
-     * additional area when expanded.
-     *
-     * If not, the widget has fixed dimensions equal to it's minimal size. */
+     * Normally, this means does the widget benifit from being enlarged? If not, the widget has
+     * "fixed" dimensions equal to it's minimal size; however it $(I may) still be enlarged.
+     * 
+     * Parents normally take their resizability from sub-widgets; see SIZABILITY for how they do
+     * this. */
     bool isWSizable ();
     bool isHSizable (); /// ditto