comparison mde/gui/widget/Ifaces.d @ 92:085f2ca31914

Shared alignments supported in more complex cases.
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 21 Oct 2008 09:57:19 +0100
parents 4d5d53e4f881
children 08a4ae11454b
comparison
equal deleted inserted replaced
91:4d5d53e4f881 92:085f2ca31914
133 * parameters) if the data has wrong length or is otherwise invalid. 133 * parameters) if the data has wrong length or is otherwise invalid.
134 * 134 *
135 * A parent widget is responsible for setting the size of its children widgets, however it must 135 * A parent widget is responsible for setting the size of its children widgets, however it must
136 * satisfy their minimal sizes as available from minWidth() and minHeight(). setWidth() and 136 * satisfy their minimal sizes as available from minWidth() and minHeight(). setWidth() and
137 * setHeight() are called on all widgets after creation. 137 * setHeight() are called on all widgets after creation.
138 *
139 * Also see finalize().
138 *************************************************************************************************/ 140 *************************************************************************************************/
139 //NOTE: add another this() without the data for default initialization, for the GUI editor? 141 //NOTE: add another this() without the data for default initialization, for the GUI editor?
140 interface IChildWidget : IWidget 142 interface IChildWidget : IWidget
141 { 143 {
142 //BEGIN Load and save 144 //BEGIN Load and save
145 // NOTE - change?
146 /** Called on all widgets after all widgets have been created in a deepest first order.
147 *
148 * Must be called before any other methods on the widget, which means this cannot call sub-
149 * widgets' methods, but finalize can. */
150 void prefinalize ();
151 void finalize (); /// ditto
152
153 /** Widget should return a list of all its children. */
154 IChildWidget[] children ();
155
143 /** When this is called, if the widget has any changed data to save it should call 156 /** When this is called, if the widget has any changed data to save it should call
144 * IWidgetManager.setData (id, data) to set it and return true. Otherwise it should return 157 * IWidgetManager.setData (id, data) to set it and return true. Otherwise it should return
145 * false. 158 * false.
146 * 159 *
147 * If the widget has subwidgets, it should also be recursively called on these (passing their 160 * If the widget has subwidgets, it should also be recursively called on these (passing their
175 bool isWSizable (); 188 bool isWSizable ();
176 bool isHSizable (); /// ditto 189 bool isHSizable (); /// ditto
177 190
178 /** The minimal size the widget could be shrunk to (or its fixed size). 191 /** The minimal size the widget could be shrunk to (or its fixed size).
179 * 192 *
180 * Takes into account child-widgets and any other contents. 193 * Takes into account child-widgets and any other contents. */
181 *
182 * Note: layout uses these calls to initialize it's alignment device. So, after creating a
183 * (layout) widget, minWidth should be the first function called on it! */
184 wdim minWidth (); 194 wdim minWidth ();
185 wdim minHeight (); /// ditto 195 wdim minHeight (); /// ditto
186 196
187 /** Get the current size of the widget. */ 197 /** Get the current size of the widget. */
188 wdim width (); 198 wdim width ();