diff mde/gui/widget/miscWidgets.d @ 121:5b37d0400732

Widgets now receive and store their parent (IParentWidget). Infinite widget recursion checks. WidgetManager code redistributed. WidgetManager code redistributed between classes; WMScreen class moved to WMScreen.d. addContent function now calls makeWidget with another id.
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 02 Jan 2009 18:07:10 +0000
parents 5ee69b3ed9c9
children 9cff74f68b84
line wrap: on
line diff
--- a/mde/gui/widget/miscWidgets.d	Thu Jan 01 15:16:00 2009 +0000
+++ b/mde/gui/widget/miscWidgets.d	Fri Jan 02 18:07:10 2009 +0000
@@ -31,9 +31,9 @@
 /// A fixed-size blank widget.
 class FixedBlankWidget : FixedWidget
 {
-    this (IWidgetManager mgr, widgetID id, WidgetData data) {
+    this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data) {
         WDCheck (data, 3);
-        super (mgr, id, data);
+        super (mgr, parent, id, data);
     }
     
     override void draw () {
@@ -46,9 +46,8 @@
 /// A completely resizable blank widget (initial size zero).
 class SizableBlankWidget : SizableWidget
 {
-    this (IWidgetManager mgr, widgetID id, WidgetData data) {
-        WDCheck (data, 1);
-        super (mgr, id, data);
+    this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData) {
+        super (mgr, parent, id);
     }
     
     override void draw () {
@@ -61,9 +60,9 @@
 /// A debug widget. Essentially as SizableBlankWidget but doesn't mind any amount of data and prints it.
 class DebugWidget : SizableWidget
 {
-    this (IWidgetManager mgr, widgetID id, WidgetData data) {
-        super (mgr, id, data);
-        logger.warn ("Debug widget - parameters: ints = {}, strings = {}", data.ints, data.strings);
+    this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data) {
+        super (mgr, parent, id);
+        logger.warn ("Debug widget ({}); parameters: ints = {}, strings = {}", id, data.ints, data.strings);
     }
     
     override void draw () {