Mercurial > projects > mde
diff mde/gui/widget/Ifaces.d @ 40:b28d7adc786b
Made GUI more robust to mutable data changes and improved much of GridLayoutWidget's code.
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Thu, 08 May 2008 16:05:51 +0100 |
parents | 5132301e9ed7 |
children | b3a6ca4516b4 |
line wrap: on
line diff
--- a/mde/gui/widget/Ifaces.d Wed May 07 13:07:03 2008 +0100 +++ b/mde/gui/widget/Ifaces.d Thu May 08 16:05:51 2008 +0100 @@ -75,17 +75,27 @@ //BEGIN Load and save /** Called after creating widgets to adjust size & other mutable attributes from saved data. * + * As for setSize, setPosition should be called afterwards. + * * Each widget should call adjust on each of its sub-widgets in turn with data, each time * replacing data by the return value of the call. It should then take its own mutable data * from the beginning of the array and return the remainder of the array. * - * Throws: on error, throw a MutableDataException. */ + * Adjust should handle errors gracefully by reverting to default values and not throwing. + * This is because the creation data and the user's mutable data may be stored separately and + * become out-of-sync during an update. */ int[] adjust (int[] data); - /** Output data suitible for recreating the widget (data to be passed to this()). */ + /** Output data suitible for recreating the widget (data to be passed to this()). + * + * Creation data is data only changed when the gui is edited. */ int[] getCreationData (); /** Output data containing the widget's current adjustments (data to be passed to adjust()). + * + * Mutable data is data which can be changed during normal gui use, such as the size of + * resizible widgets or current tab of a tab widget. + * * Should be a concatenation of each sub-widget's mutable data and the widget's own. */ int[] getMutableData (); //END Load and save