diff mde/gui/widget/contentFunctions.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 264028f4115a
children 3468e9bfded1
line wrap: on
line diff
--- a/mde/gui/widget/contentFunctions.d	Sun Feb 01 12:36:21 2009 +0000
+++ b/mde/gui/widget/contentFunctions.d	Sat Feb 07 12:46:03 2009 +0000
@@ -26,8 +26,6 @@
 import mde.gui.widget.miscContent;
 
 import mde.content.AStringContent;
-import mde.content.miscContent;
-import Items = mde.content.Items;
 
 /******************************************************************************
  * A function which uses Items.get (data.strings[0]) to get a content and
@@ -36,7 +34,7 @@
  *****************************************************************************/
 IChildWidget addContent (IWidgetManager mgr, IParentWidget parent, widgetID, WidgetData data, IContent) {
     if (data.strings.length != 2) throw new WidgetDataException;
-    return mgr.makeWidget (parent, data.strings[1], Items.get (data.strings[0]));
+    return mgr.makeWidget (parent, data.strings[1], Content.get (data.strings[0]));
 }
 
 /******************************************************************************
@@ -58,7 +56,8 @@
     }
     if (cast(IContentList) c)
         return new ContentListWidget(mgr,parent,id,data,c);
-    if (cast(EventContent) c)
+    // Normally only EventContents are used for buttons, but any Content can be:
+    if (cast(Content) c)
         return new ButtonContentWidget(mgr,parent,id,data,c);
     // generic uneditable option
     return new DisplayContentWidget(mgr,parent,id,data,c);