diff mde/gui/widget/layout.d @ 131:9cff74f68b84

Major revisions to popup handling. Buttons can close menus now, plus some smaller impovements. Removed Widget module. Moved Widget.AWidget to AChildWidget.AChildWidget and Widget.AParentWidget to AParentWidget.AParentWidget. Removed ASingleParentWidget to improve code sharing. AChildWidget doesn't implement IParentWidget like AWidget did. New IPopupParentWidget extending IParentWidget for the WM and some widgets to handle popups. Cut old popup management code. New underMouse() function replacing highlight(); called on all widgets. Separate menu-popup and button widgets aren't needed for menus now. Functions returning content widgets have been moved to their own module. Cleaned up jobs.txt. Switched to 80 line length for Ddoc.
author Diggory Hardy <diggory.hardy@gmail.com>
date Wed, 21 Jan 2009 13:01:40 +0000
parents c5c38eaadb64
children 9fd705793568
line wrap: on
line diff
--- a/mde/gui/widget/layout.d	Sat Jan 17 16:11:26 2009 +0000
+++ b/mde/gui/widget/layout.d	Wed Jan 21 13:01:40 2009 +0000
@@ -16,7 +16,7 @@
 /// Gui layout widgets.
 module mde.gui.widget.layout;
 
-import mde.gui.widget.Widget;
+import mde.gui.widget.AParentWidget;
 import mde.gui.exception;
 
 import mde.content.miscContent;
@@ -35,11 +35,7 @@
  * Encapsulates a grid of Widgets.
  *
  * Currently there is no support for changing number of cells, sub-widgets or sub-widget properties
- * (namely isW/HSizable and minimal size) after this() has run.
- *
- * Since a grid with either dimension zero is not useful, there must be at least one sub-widget.
- *
- * The grid has no border but has spacing between widgets.
+ * (namely isW/HSizable) after this() has run.
  *************************************************************************************************/
 class GridLayoutWidget : GridWidget
 {
@@ -48,9 +44,9 @@
      * Widget uses the initialisation data:
      * ---
      * ints = [widget_type, align_flags, rows, cols]
-     * // or with column widths and row heights:
-     * ints = [widget_type, align_flags, rows, cols, col1width, ..., colCwidth, row1height, ..., rowRheight]
      * strings = [w11, w12, ..., w1C, ..., wR1, ..., wRC]
+     * // dimData may be:
+     * dimData = [col1width, ..., colCwidth, row1height, ..., rowRheight]
      * ---
      * where R and C are the number of rows and columns, and wij is the ID (from parent Window's
      * list) for the widget in row i and column j. The number of parameters must be r*c + 3.
@@ -136,11 +132,19 @@
  * Backend for grid-based (includes column/row) layout widgets.
  *
  * A deriving class must at least do some work in it's constructor (see Ddoc for this() below)
- * and provide an implementation of getCreationData() (unless Widget's version is sufficient).
+ * and provide an implementation of saveChanges() (unless Widget's version is sufficient).
  *
  * Since a grid with either dimension zero is not useful, there must be at least one sub-widget.
  *
- * The grid has no border but has spacing between widgets.
+ * The grid has no border but optionally has spacing between widgets.
+ * 
+ * Several flags are tested against ints[1]:
+ * $(TABLE
+ * $(TR $(TD 1) $(TD Column alignment is shared against other instances of thes widget id))
+ * $(TR $(TD 2) $(TD Row alignment is shared against other instances of thes widget id))
+ * $(TR $(TD 4) $(TD Spacing is inserted between elements; the renderer may draw this))
+ * $(TR $(TD 8) $(TD For ContentListWidget only, list is horizontal instead of vertical))
+ * )
  *************************************************************************************************/
 // Note: mw, mh inherited from AWidget are not used; use col.mw, row.mw instead.
 abstract class GridWidget : AParentWidget
@@ -851,8 +855,8 @@
         instances = new HashMap!(widgetID,AlignColumns);
     }
     
-    alias IChildWidget.SIZABILITY SIZABILITY;
-    alias IChildWidget.SIZABILITY_ENUM SIZABILITY_ENUM;
+    alias IParentWidget.SIZABILITY SIZABILITY;
+    alias IParentWidget.SIZABILITY_ENUM SIZABILITY_ENUM;
     
     debug invariant()
     {