Mercurial > projects > mde
diff mde/gui/widget/Ifaces.d @ 146:783969f4665c
Simple, inefficient context menus (displaying content description).
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Wed, 11 Feb 2009 12:00:12 +0000 |
parents | 66c58e5b0062 |
children | c67d074a7111 |
line wrap: on
line diff
--- a/mde/gui/widget/Ifaces.d Tue Feb 10 13:10:53 2009 +0000 +++ b/mde/gui/widget/Ifaces.d Wed Feb 11 12:00:12 2009 +0000 @@ -31,7 +31,7 @@ public import mde.gui.types; public import mde.gui.renderer.IRenderer; -import mde.content.IContent; +public import mde.content.IContent; /****************************************************************************** @@ -199,7 +199,7 @@ wdims dimData (widgetID id); /// ditto void dimData (widgetID id, wdims d); /// ditto - /** Position popup left or right of parent, or left or right of parent + /** Position popup below or above parent, or right or left of parent * (flags & 1 == 1). */ void positionPopup (IChildWidget parent, IChildWidget popup, int flags = 0); @@ -240,14 +240,13 @@ /****************************************************************************** * Interface for (child) widgets, i.e. all widgets other than the manager. * - * A widget is a region of a GUI window which handles rendering and user-interaction for itself - * and is able to communicate with its manager and child widgets as necessary. (Passing widgets - * a reference to their parent has not been found useful.) + * A widget is a region of a GUI window which handles rendering and user- + * interaction for itself and is able to communicate with its manager and other + * widgets as necessary. * - * If a widget is to be creatable by IWidgetManager.makeWidget, it must be listed in the - * createWidget module, and have a constructor of the following form. It should also update it's - * creation data if necessary, either when changed or when saveChanges() is called, using - * IWidgetManager.setData(). + * If a widget is to be creatable by IWidgetManager.makeWidget, it must be + * listed in the AWidgetManager WIDGET_TYPE enum and WIDGETS list, and have a + * constructor of the following form. * It should use Ddoc to explain what initialization data is used. * ---------------------------------- * /++ Constructor for a ... widget. @@ -255,17 +254,20 @@ * + Widget uses the initialisation data: * + [widgetID, x, y] * + where x is ... and y is ... +/ - * this (IWidgetManager mgr, widgetID id, WidgetData data); + * this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data); * * /// The CTOR may take an IContent reference: - * this (IWidgetManager mgr, widgetID id, WidgetData data, IContent content); + * this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData data, IContent content); * ---------------------------------- - * Where mgr is the widget manager, id is the _id passed to makeWidget() and data is - * initialisation data. The method should throw a WidgetDataException (created without - * parameters) if the data has wrong length or is otherwise invalid. + * Where mgr is the widget manager, parent is the widget's _parent (another + * child widget or the widget manager), id is the _id passed to makeWidget() + * and data is initialisation _data. The method should throw a + * WidgetDataException if the data is invalid, and throw other GuiExceptions on + * other errors. * - * All widgets should set their own size in this() or setup() (must be setup() if it could change), - * although some parents may set child-widgets' size during their creation. + * All widgets should set their own size in this() or setup() (must be setup() + * if it could change), although some parents may set child-widgets' size + * during their creation. *****************************************************************************/ //NOTE: add another this() without the data for default initialization, for the GUI editor? interface IChildWidget @@ -304,6 +306,8 @@ void childChanged (); +/ + /** Return the widget's content, or null. */ + IContent content (); //END Load and save //BEGIN Size and position