diff mde/gui/Gui.d @ 45:0fd51d2c6c8a

Several changes to resising windows and layout widgets. This commit still has some bugs. Moved the implementable widgets from mde.gui.widget.Widget to miscWidgets, leaving base widgets in Widget. Rewrote some of GridLayoutWidget's implementation. Made many operations general to work for either columns or rows. Some optimisations were intended but ended up being removed due to problems. Allowed layout's to resize from either direction (only with window resizes). committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 22 May 2008 11:34:09 +0100
parents 1530d9c04d4d
children e0839643ff52
line wrap: on
line diff
--- a/mde/gui/Gui.d	Fri May 16 12:22:10 2008 +0100
+++ b/mde/gui/Gui.d	Thu May 22 11:34:09 2008 +0100
@@ -63,26 +63,20 @@
         }
         
         IReader reader;
-        try {
-            reader = confDir.makeMTReader (fileName, PRIORITY.HIGH_LOW, null, true);
-            reader.dataSecCreator = delegate mt.IDataSection(mt.ID id) {
-                return new Window (id);
-            };
-            reader.read;
-        } catch (mt.MTException e) {
-            logger.error ("Loading GUI aborted:");
-            logger.error (e.msg);
-            
-            return;
-        }
+        reader = confDir.makeMTReader (fileName, PRIORITY.HIGH_LOW, null, true);
+        reader.dataSecCreator = delegate mt.IDataSection(mt.ID id) {
+            return new Window (id);
+        };
+        reader.read;
         
         // Get the renderer
         char[]* p = RENDERER in reader.dataset.header.Arg!(char[]).Arg;
         if (p is null || *p is null) {
-            logger.error ("Loading GUI aborted: no renderer specified");
-            return;
+            logger.warn ("no renderer specified: defaulting to Simple");
+            rendName = "Simple";
         }
-        rendName = *p;
+        else
+            rendName = *p;
         
         // get list
         windows.length = reader.dataset.sec.length; // pre-allocate
@@ -94,8 +88,8 @@
                 continue;
             }
             try {
-                w.finalise (this);
-                windows ~= w;       // only add if load successful
+                w.finalise (this);	// if this fails, the window (but nothing else) won't work
+                windows ~= w;		// only add if load successful
             } catch (Exception e) {
                 logger.error ("Window failed to load: " ~ e.msg);
             }