Mercurial > projects > mde
comparison mde/gui/widget/miscWidgets.d @ 80:ea58f277f487
Gui reorganization and changes; partial implementation of floating widgets.
Moved contents of mde/gui/WidgetData.d elsewhere; new gui/WidgetDataSet.d and gui/types.d modules.
Changes to widget/createWidget.d
Partially implemented FloatingAreaWidget to provide an area for floating "window" widgets.
New DebugWidget and some uses of it (e.g. bad widget data).
Decoupled OptionChanges from Options.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Thu, 07 Aug 2008 11:25:27 +0100 |
parents | 3dfd934100f7 |
children | 4d5d53e4f881 |
comparison
equal
deleted
inserted
replaced
79:61ea26abe4dd | 80:ea58f277f487 |
---|---|
51 | 51 |
52 mgr.renderer.drawBlank (x,y, w,h); | 52 mgr.renderer.drawBlank (x,y, w,h); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 /// A debug widget. Essentially as SizableBlankWidget but doesn't mind any amount of data and prints it. | |
57 class DebugWidget : SizableWidget | |
58 { | |
59 this (IWidgetManager mgr, WidgetData data) { | |
60 super (mgr, data); | |
61 | |
62 Stdout ("Debug widget - parameters: int: ["); | |
63 foreach (x; data.ints) | |
64 Stdout (" ")(x); | |
65 Stdout (" ], char[]: ["); | |
66 foreach (x; data.strings) | |
67 Stdout (" \"")(x)('"'); | |
68 Stdout (" ]").newline; | |
69 } | |
70 | |
71 void draw () { | |
72 super.draw; | |
73 | |
74 mgr.renderer.drawBlank (x,y, w,h); | |
75 } | |
76 } | |
77 | |
56 /// First interactible widget | 78 /// First interactible widget |
57 class ButtonWidget : FixedWidget | 79 class ButtonWidget : FixedWidget |
58 { | 80 { |
59 bool pushed = false; // true if button is pushed in (visually) | 81 bool pushed = false; // true if button is pushed in (visually) |
60 // 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. |