Mercurial > projects > mde
comparison mde/gui/widget/Ifaces.d @ 130:c5c38eaadb64
Changed how sizability is set for parents: can require all sub-widgets resizable or only one to set parent resizable.
Ifaces.IParentWidget.SIZABILITY controlling parent sizability.
TextWidget no longer vertically resizable (since multi-line editing is not supported).
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 17 Jan 2009 16:11:26 +0000 |
parents | ad91de8867a0 |
children | 9cff74f68b84 |
comparison
equal
deleted
inserted
replaced
129:ad91de8867a0 | 130:c5c38eaadb64 |
---|---|
13 You should have received a copy of the GNU General Public License | 13 You should have received a copy of the GNU General Public License |
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
15 | 15 |
16 /************************************************************************************************* | 16 /************************************************************************************************* |
17 * Widget interfaces. | 17 * Widget interfaces. |
18 * | |
19 * This module contains the primary documentation for the declared methods; also the Widget module | |
20 * has some brief comments and basic implementations. | |
18 * | 21 * |
19 * Widgets are connected as the nodes of a tree. Widgets know their parent as a IParentWidget | 22 * Widgets are connected as the nodes of a tree. Widgets know their parent as a IParentWidget |
20 * class and their children as IChildWidget classes. The gui manager is a special widget only | 23 * class and their children as IChildWidget classes. The gui manager is a special widget only |
21 * implementing IParentWidget; all other widgets must implement IChildWidget and optionally | 24 * implementing IParentWidget; all other widgets must implement IChildWidget and optionally |
22 * IParentWidget. | 25 * IParentWidget. |
53 * widget = The child widget calling the function | 56 * widget = The child widget calling the function |
54 * mw = New minimal width | 57 * mw = New minimal width |
55 * mh = New minimal height */ | 58 * mh = New minimal height */ |
56 void minWChange (IChildWidget widget, wdim mw); | 59 void minWChange (IChildWidget widget, wdim mw); |
57 void minHChange (IChildWidget widget, wdim mh); /// ditto | 60 void minHChange (IChildWidget widget, wdim mh); /// ditto |
61 | |
62 /** Governor of parent widget resizability, where this is determined by sub-widgets | |
63 * (e.g. this doesn't apply to FloatingAreaWidget). | |
64 * | |
65 * NEVER and ALWAYS often don't result in usable GUIs, and aren't expected to be used except | |
66 * for debugging. | |
67 * | |
68 * NOTE: ANY_SUBWIDGETS can cause problems like enlarging a menu bar containing a resizable | |
69 * blank instead of the main part of a window. */ | |
70 enum SIZABILITY_ENUM { | |
71 NEVER = 0, /// Parents are never resizable | |
72 ALL_SUBWIDGETS = 3, /// Parents are only resizable if all sub-widgets are | |
73 ANY_SUBWIDGETS = 2, /// Parents are resizable if any sub-widgets are | |
74 ALWAYS = 1, /// Parents are always resizable | |
75 START_TRUE = 1, /// Flag set by ALWAYS and ALL_SUBWIDGETS | |
76 SUBWIDGETS = 2, /// Flag set by ALL_SUBWIDGETS and ANY_SUBWIDGETS | |
77 } | |
78 static const SIZABILITY = SIZABILITY_ENUM.ALL_SUBWIDGETS; /// ditto | |
58 } | 79 } |
59 | 80 |
60 | 81 |
61 /************************************************************************************************* | 82 /************************************************************************************************* |
62 * Interface for the widget manager. | 83 * Interface for the widget manager. |
210 //END Load and save | 231 //END Load and save |
211 | 232 |
212 //BEGIN Size and position | 233 //BEGIN Size and position |
213 /** Is the width / height resizable? | 234 /** Is the width / height resizable? |
214 * | 235 * |
215 * This really means does the widget benifit from being enlarged? Any widget should occupy | 236 * Normally, this means does the widget benifit from being enlarged? If not, the widget has |
216 * additional area when expanded. | 237 * "fixed" dimensions equal to it's minimal size; however it $(I may) still be enlarged. |
217 * | 238 * |
218 * If not, the widget has fixed dimensions equal to it's minimal size. */ | 239 * Parents normally take their resizability from sub-widgets; see SIZABILITY for how they do |
240 * this. */ | |
219 bool isWSizable (); | 241 bool isWSizable (); |
220 bool isHSizable (); /// ditto | 242 bool isHSizable (); /// ditto |
221 | 243 |
222 /** The minimal size the widget could be shrunk to (or its fixed size). | 244 /** The minimal size the widget could be shrunk to (or its fixed size). |
223 * | 245 * |