diff mde/gui/WidgetManager.d @ 129:ad91de8867a0

Added a widget size printing debug function. Fixed a bug in SwitchWidget.
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 15 Jan 2009 16:52:46 +0000
parents 41582439a42b
children 9cff74f68b84
line wrap: on
line diff
--- a/mde/gui/WidgetManager.d	Wed Jan 14 20:24:14 2009 +0000
+++ b/mde/gui/WidgetManager.d	Thu Jan 15 16:52:46 2009 +0000
@@ -29,6 +29,7 @@
 import mde.lookup.Options;	// miscOpts.L10n callback
 import mde.content.Content;
 import Items = mde.content.Items;	// loadTranslation
+debug import mde.content.miscContent;	// Debug menu
 
 import mde.file.mergetag.Reader;
 import mde.file.mergetag.Writer;
@@ -71,6 +72,12 @@
         
         clickCallbacks = new typeof(clickCallbacks);
         motionCallbacks = new typeof(motionCallbacks);
+        
+        debug {
+            auto lWS = new EventContent ("logWidgetSize");
+            lWS.addCallback (&logWidgetSize);
+            imde.menu.append (lWS);
+        }
     }
     
     /* Load the widgets' data from the file specified to the CTOR.
@@ -374,6 +381,11 @@
     }
     //END IWidgetManager methods
     
+    debug void logWidgetSize (Content) {
+        logger.trace ("Current size: {,4},{,4}; minimal: {,4},{,4} - WidgetManager", w,h, mw,mh);
+        child.logWidgetSize;
+    }
+    
 protected:
     /** Second stage of loading the widgets.
     *