comparison mde/gui/widget/contentFunctions.d @ 132:264028f4115a

Cleaned up mde.imde and a couple of widget functions. New mde.menus module to add default menus. The input singleton is now created in mde.input.Input instead of mde.imde.
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 23 Jan 2009 14:59:05 +0000
parents 9cff74f68b84
children 9f035cd139c6
comparison
equal deleted inserted replaced
131:9cff74f68b84 132:264028f4115a
63 // generic uneditable option 63 // generic uneditable option
64 return new DisplayContentWidget(mgr,parent,id,data,c); 64 return new DisplayContentWidget(mgr,parent,id,data,c);
65 } 65 }
66 66
67 /****************************************************************************** 67 /******************************************************************************
68 * A function which returns a ContentListWidget or MenuButtonContentWidget. 68 * PopupMenuContent will create a popup for any content. This function more
69 * conservatively only creates a popup for a ContentList, and otherwise returns
70 * the same as editContent.
69 *****************************************************************************/ 71 *****************************************************************************/
70 IChildWidget flatMenuContent (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data, IContent c) { 72 IChildWidget popupListContent (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data, IContent c) {
71 if (c is null) throw new ContentException;
72 if (cast(IContentList) c)
73 return new ContentListWidget(mgr,parent,id,data,c);
74 if (cast(EventContent) c)
75 return new ButtonContentWidget(mgr,parent,id,data,c);
76 // generic uneditable option
77 return new DisplayContentWidget(mgr,parent,id,data,c);
78 }
79
80 /******************************************************************************
81 * A function which returns a PopupMenuWidget or MenuButtonContentWidget.
82 *****************************************************************************/
83 IChildWidget subMenuContent (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data, IContent c) {
84 if (c is null) throw new ContentException; 73 if (c is null) throw new ContentException;
85 if (cast(IContentList) c) 74 if (cast(IContentList) c)
86 return new PopupMenuWidget(mgr,parent,id,data,c); 75 return new PopupMenuWidget(mgr,parent,id,data,c);
87 if (cast(EventContent) c) 76 else return editContent (mgr, parent, id, data, c);
88 return new ButtonContentWidget(mgr,parent,id,data,c);
89 // generic uneditable option
90 return new DisplayContentWidget(mgr,parent,id,data,c);
91 } 77 }