Mercurial > projects > mde
comparison 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 |
comparison
equal
deleted
inserted
replaced
120:46c63cb1c74f | 121:5b37d0400732 |
---|---|
29 | 29 |
30 | 30 |
31 /// A fixed-size blank widget. | 31 /// A fixed-size blank widget. |
32 class FixedBlankWidget : FixedWidget | 32 class FixedBlankWidget : FixedWidget |
33 { | 33 { |
34 this (IWidgetManager mgr, widgetID id, WidgetData data) { | 34 this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data) { |
35 WDCheck (data, 3); | 35 WDCheck (data, 3); |
36 super (mgr, id, data); | 36 super (mgr, parent, id, data); |
37 } | 37 } |
38 | 38 |
39 override void draw () { | 39 override void draw () { |
40 super.draw; | 40 super.draw; |
41 | 41 |
44 } | 44 } |
45 | 45 |
46 /// A completely resizable blank widget (initial size zero). | 46 /// A completely resizable blank widget (initial size zero). |
47 class SizableBlankWidget : SizableWidget | 47 class SizableBlankWidget : SizableWidget |
48 { | 48 { |
49 this (IWidgetManager mgr, widgetID id, WidgetData data) { | 49 this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData) { |
50 WDCheck (data, 1); | 50 super (mgr, parent, id); |
51 super (mgr, id, data); | |
52 } | 51 } |
53 | 52 |
54 override void draw () { | 53 override void draw () { |
55 super.draw; | 54 super.draw; |
56 | 55 |
59 } | 58 } |
60 | 59 |
61 /// A debug widget. Essentially as SizableBlankWidget but doesn't mind any amount of data and prints it. | 60 /// A debug widget. Essentially as SizableBlankWidget but doesn't mind any amount of data and prints it. |
62 class DebugWidget : SizableWidget | 61 class DebugWidget : SizableWidget |
63 { | 62 { |
64 this (IWidgetManager mgr, widgetID id, WidgetData data) { | 63 this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data) { |
65 super (mgr, id, data); | 64 super (mgr, parent, id); |
66 logger.warn ("Debug widget - parameters: ints = {}, strings = {}", data.ints, data.strings); | 65 logger.warn ("Debug widget ({}); parameters: ints = {}, strings = {}", id, data.ints, data.strings); |
67 } | 66 } |
68 | 67 |
69 override void draw () { | 68 override void draw () { |
70 super.draw; | 69 super.draw; |
71 | 70 |