diff mde/gui/widget/miscWidgets.d @ 116:5ee69b3ed9c9

Partial implementation of infinite widget recursion protection; some cleanup. Implemented recursion protection which only allowed unsafe widgets to be instantiated once; realised this was far too restrictive (multiple sibling instances are needed) and a check against parent widgets would be needed. Could be implemented by passing widgets a reference to parents. Removed ButtonWidget aka First interactible widget.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sun, 21 Dec 2008 12:03:50 +0000
parents b16a534f5302
children 5b37d0400732
line wrap: on
line diff
--- a/mde/gui/widget/miscWidgets.d	Sat Dec 20 17:57:05 2008 +0000
+++ b/mde/gui/widget/miscWidgets.d	Sun Dec 21 12:03:50 2008 +0000
@@ -20,7 +20,12 @@
 import mde.gui.exception;
 import mde.gui.renderer.IRenderer;
 
-import tango.io.Stdout;
+import tango.util.log.Log : Log, Logger;
+
+private Logger logger;
+static this () {
+    logger = Log.getLogger ("mde.gui.widget.miscWidgets");
+}
 
 
 /// A fixed-size blank widget.
@@ -58,14 +63,7 @@
 {
     this (IWidgetManager mgr, widgetID id, WidgetData data) {
         super (mgr, id, data);
-        
-        Stdout ("Debug widget - parameters: int: [");
-        foreach (x; data.ints)
-            Stdout (" ")(x);
-        Stdout (" ], char[]: [");
-        foreach (x; data.strings)
-            Stdout (" \"")(x)('"');
-        Stdout (" ]").newline;
+        logger.warn ("Debug widget - parameters: ints = {}, strings = {}", data.ints, data.strings);
     }
     
     override void draw () {
@@ -74,18 +72,3 @@
         mgr.renderer.drawBlank (x,y, w,h);
     }
 }
-
-/// First interactible widget
-class ButtonWidget : AButtonWidget
-{
-    this (IWidgetManager mgr, widgetID id, WidgetData data) {
-        WDCheck (data, 3);
-        w = mw = cast(wdim) data.ints[1];
-        h = mh = cast(wdim) data.ints[2];
-        super (mgr, id, data);
-    }
-    
-    override void activated () {
-        Stdout ("Button clicked!").newline;
-    }
-}