Mercurial > projects > mde
diff 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 |
line wrap: on
line diff
--- a/mde/gui/widget/miscWidgets.d Tue Aug 05 11:51:51 2008 +0100 +++ b/mde/gui/widget/miscWidgets.d Thu Aug 07 11:25:27 2008 +0100 @@ -53,6 +53,28 @@ } } +/// A debug widget. Essentially as SizableBlankWidget but doesn't mind any amount of data and prints it. +class DebugWidget : SizableWidget +{ + this (IWidgetManager mgr, WidgetData data) { + super (mgr, data); + + Stdout ("Debug widget - parameters: int: ["); + foreach (x; data.ints) + Stdout (" ")(x); + Stdout (" ], char[]: ["); + foreach (x; data.strings) + Stdout (" \"")(x)('"'); + Stdout (" ]").newline; + } + + void draw () { + super.draw; + + mgr.renderer.drawBlank (x,y, w,h); + } +} + /// First interactible widget class ButtonWidget : FixedWidget {