diff mde/gui/widget/Ifaces.d @ 91:4d5d53e4f881

Shared alignment for dynamic content lists - finally implemented! Lots of smaller changes too. Some debugging improvements. When multiple .mtt files are read for merging, files with invalid headers are ignored and no error is thrown so long as at least one file os valid.
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 16 Oct 2008 17:43:48 +0100
parents b525ff28774b
children 085f2ca31914
line wrap: on
line diff
--- a/mde/gui/widget/Ifaces.d	Wed Oct 01 23:37:51 2008 +0100
+++ b/mde/gui/widget/Ifaces.d	Thu Oct 16 17:43:48 2008 +0100
@@ -61,7 +61,8 @@
      */
     IChildWidget makeWidget (widgetID id, IContent content = null);
     
-    /** Record some changes, for saving. */
+    /** Record some changes, for saving. Should only be called from IWidget.saveChanges() to avoid
+     * multiple calls for instanced widgets of same id. */
     void setData (widgetID id, WidgetData);
     
     // Rendering:
@@ -145,6 +146,7 @@
      * 
      * If the widget has subwidgets, it should also be recursively called on these (passing their 
      * ids). */
+    // FIXME - no longer necessary to pass id!
     bool saveChanges (widgetID id);
     
     /** Called when the renderer is changed (at least when the changes affect dimensions).
@@ -164,23 +166,27 @@
 //END Load and save
     
 //BEGIN Size and position
-    /** is the width / height resizable?
+    /** Is the width / height resizable?
      *
-     * If not, the widget has fixed dimensions equal the output of getMinimalSize. */
+     * 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. */
     bool isWSizable ();
     bool isHSizable (); /// ditto
     
     /** The minimal size the widget could be shrunk to (or its fixed size).
      *
-     * Takes into account child-widgets and any other contents. */
+     * Takes into account child-widgets and any other contents.
+     * 
+     * Note: layout uses these calls to initialize it's alignment device. So, after creating a
+     * (layout) widget, minWidth should be the first function called on it! */
     wdim minWidth ();
     wdim minHeight ();	/// ditto
     
-    /** Get the current size of the widget.
-     * 
-     * Deprecated: is it needed now?
-     */
-    deprecated void getCurrentSize (out wdim w, out wdim h);
+    /** Get the current size of the widget. */
+    wdim width ();
+    wdim height();      /// ditto
     
     /** Used to adjust the size.
      *
@@ -191,10 +197,9 @@
      *  	  index as necessary), or +1 (resize from the lowest index, i.e. 0).
      *  	  Most widgets can simply ignore it.
      *
-     * If called with dimensions less than minWidth/minHeight return: the widget may set its size
-     * to either the dimension given or its minimal dimension (even though this is larger). If the
-     * larger size is set, events won't be received in the extra area. FIXME: sort out rendering.
-     * Otherwise, the dimensions should always be set exactly.
+     * A widget should never be resized smaller than it's minimal size (if it is, it should assume
+     * it's minimal size and print a warning when in debug mode).
+     * A "fixed" size widget should enlarge itself as requested.
      *
      * setPosition must be called after calling either setWidth or setHeight. */
     void setWidth (wdim nw, int dir);