Mercurial > projects > mde
diff mde/gui/widget/contentFunctions.d @ 167:620d4ea30228
Context menus: added a clipboard (functions accessible from main menu rather than context menu).
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 27 Jun 2009 11:57:26 +0200 |
parents | bb2f1a76346d |
children | e45226d3deae |
line wrap: on
line diff
--- a/mde/gui/widget/contentFunctions.d Sun Jun 21 12:19:18 2009 +0200 +++ b/mde/gui/widget/contentFunctions.d Sat Jun 27 11:57:26 2009 +0200 @@ -48,6 +48,9 @@ IChildWidget editContent (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data, IContent c) { // Note: SAFE_RECURSION enabled if (c is null) throw new ContentException; + // Normally only EventContents are used for buttons, but any Content can be: + if (cast(IEventContent) c) + return new ButtonContentWidget(mgr,parent,id,data,c); if (cast(AStringContent) c) { if (cast(EnumContent) c) // can be PopupMenuWidget or ContentListWidget return new PopupMenuWidget(mgr,parent,id,data,c); @@ -57,9 +60,6 @@ } if (cast(IContentList) c) return new ContentListWidget(mgr,parent,id,data,c); - // Normally only EventContents are used for buttons, but any Content can be: - if (cast(EventContent) c) - return new ButtonContentWidget(mgr,parent,id,data,c); // generic uneditable option return new DisplayContentWidget(mgr,parent,id,data,c); }