comparison mde/gui/widget/miscContent.d @ 137:9f035cd139c6

BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed. Content restrutured a lot: New IContent module, Content module includes more functionality. New ContentLoader module to manage content loading/saving/translation. Translation module moved to content dir and cut down to reflect current usage. File format unchanged except renames: FontOptions -> Font, VideoOptions -> Screen. Font render mode and LCD filter options are now enums. GUI loading needs to create content (and set type for enums), but doesn't save/load value. Some setup of mainSchedule moved to mde.mainLoop. Content callbacks are called on content change now. ContentLists are set up implicitly from content symbols. Not as fast but much easier! Bug-fix in the new MTTagReader. Renamed MT *Reader maker functions to avoid confusion in paths.d. New mde.setup.logger module to allow logger setup before any other module's static this().
author Diggory Hardy <diggory.hardy@gmail.com>
date Sat, 07 Feb 2009 12:46:03 +0000
parents 9cff74f68b84
children c94ec5594449
comparison
equal deleted inserted replaced
136:4084f07f2c7a 137:9f035cd139c6
20 20
21 import mde.gui.widget.AParentWidget; 21 import mde.gui.widget.AParentWidget;
22 import mde.gui.exception; 22 import mde.gui.exception;
23 23
24 import mde.content.AStringContent; 24 import mde.content.AStringContent;
25 import mde.content.miscContent;
26 25
27 debug { 26 debug {
28 import tango.util.log.Log : Log, Logger; 27 import tango.util.log.Log : Log, Logger;
29 private Logger logger; 28 private Logger logger;
30 static this () { 29 static this () {
58 57
59 /// A button connected to an EventContent 58 /// A button connected to an EventContent
60 class ButtonContentWidget : AButtonWidget 59 class ButtonContentWidget : AButtonWidget
61 { 60 {
62 this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData, IContent c) { 61 this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData, IContent c) {
63 content = cast(EventContent) c; 62 content = cast(Content) c;
64 if (content is null) throw new ContentException (this); 63 if (content is null) throw new ContentException (this);
65 adapter = mgr.renderer.getAdapter (); 64 adapter = mgr.renderer.getAdapter ();
66 super (mgr, parent, id); 65 super (mgr, parent, id);
67 } 66 }
68 67
86 content.endEvent; 85 content.endEvent;
87 } 86 }
88 87
89 protected: 88 protected:
90 IRenderer.TextAdapter adapter; 89 IRenderer.TextAdapter adapter;
91 EventContent content; 90 Content content;
92 int index; 91 int index;
93 } 92 }
94 93
95 /** A "tab" widget: it doesn't display the tabs, but shows one of a number of widgets dependant on 94 /** A "tab" widget: it doesn't display the tabs, but shows one of a number of widgets dependant on
96 * an EnumContent. 95 * an EnumContent.