Mercurial > projects > mde
comparison mde/gui/widget/miscWidgets.d @ 91:4d5d53e4f881
Shared alignment for dynamic content lists - finally implemented! Lots of smaller changes too.
Some debugging improvements.
When multiple .mtt files are read for merging, files with invalid headers are ignored and no error is thrown so long as at least one file os valid.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Thu, 16 Oct 2008 17:43:48 +0100 |
parents | ea58f277f487 |
children | 2a364c7d82c9 |
comparison
equal
deleted
inserted
replaced
90:b525ff28774b | 91:4d5d53e4f881 |
---|---|
24 | 24 |
25 | 25 |
26 /// A fixed-size blank widget. | 26 /// A fixed-size blank widget. |
27 class FixedBlankWidget : FixedWidget | 27 class FixedBlankWidget : FixedWidget |
28 { | 28 { |
29 this (IWidgetManager mgr, WidgetData data) { | 29 this (IWidgetManager mgr, widgetID id, WidgetData data) { |
30 WDCheck (data, 3); | 30 WDCheck (data, 3); |
31 super (mgr, data); | 31 super (mgr, id, data); |
32 } | 32 } |
33 | 33 |
34 void draw () { | 34 void draw () { |
35 super.draw; | 35 super.draw; |
36 | 36 |
39 } | 39 } |
40 | 40 |
41 /// A completely resizable blank widget (initial size zero). | 41 /// A completely resizable blank widget (initial size zero). |
42 class SizableBlankWidget : SizableWidget | 42 class SizableBlankWidget : SizableWidget |
43 { | 43 { |
44 this (IWidgetManager mgr, WidgetData data) { | 44 this (IWidgetManager mgr, widgetID id, WidgetData data) { |
45 WDCheck (data, 1); | 45 WDCheck (data, 1); |
46 super (mgr, data); | 46 super (mgr, id, data); |
47 } | 47 } |
48 | 48 |
49 void draw () { | 49 void draw () { |
50 super.draw; | 50 super.draw; |
51 | 51 |
54 } | 54 } |
55 | 55 |
56 /// A debug widget. Essentially as SizableBlankWidget but doesn't mind any amount of data and prints it. | 56 /// A debug widget. Essentially as SizableBlankWidget but doesn't mind any amount of data and prints it. |
57 class DebugWidget : SizableWidget | 57 class DebugWidget : SizableWidget |
58 { | 58 { |
59 this (IWidgetManager mgr, WidgetData data) { | 59 this (IWidgetManager mgr, widgetID id, WidgetData data) { |
60 super (mgr, data); | 60 super (mgr, id, data); |
61 | 61 |
62 Stdout ("Debug widget - parameters: int: ["); | 62 Stdout ("Debug widget - parameters: int: ["); |
63 foreach (x; data.ints) | 63 foreach (x; data.ints) |
64 Stdout (" ")(x); | 64 Stdout (" ")(x); |
65 Stdout (" ], char[]: ["); | 65 Stdout (" ], char[]: ["); |
80 { | 80 { |
81 bool pushed = false; // true if button is pushed in (visually) | 81 bool pushed = false; // true if button is pushed in (visually) |
82 // pushed is not the same as the button being clicked but not yet released. | 82 // pushed is not the same as the button being clicked but not yet released. |
83 // it is whether the mouse is over the button after being clicked. | 83 // it is whether the mouse is over the button after being clicked. |
84 | 84 |
85 this (IWidgetManager mgr, WidgetData data) { | 85 this (IWidgetManager mgr, widgetID id, WidgetData data) { |
86 WDCheck (data, 3); | 86 WDCheck (data, 3); |
87 super (mgr, data); | 87 super (mgr, id, data); |
88 } | 88 } |
89 | 89 |
90 void draw () { | 90 void draw () { |
91 mgr.renderer.drawButton (x,y, w,h, pushed); | 91 mgr.renderer.drawButton (x,y, w,h, pushed); |
92 } | 92 } |