Mercurial > projects > mde
diff mde/lookup/Options.d @ 103:42e241e7be3e
ContentList content type; getting content items/lists from Options generically via content.Items, and a new addContent widget function. Several improvements to generic handling of content. New button-with-text widget.
Some tidy-up.
Some name changes, to increase uniformity.
Bug-fix: floating widgets of fixed size could previously be made larger than intended from config dimdata.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Tue, 25 Nov 2008 18:01:44 +0000 |
parents | ba035eba07b4 |
children | ee209602770d |
line wrap: on
line diff
--- a/mde/lookup/Options.d Sat Nov 22 20:59:36 2008 +0000 +++ b/mde/lookup/Options.d Tue Nov 25 18:01:44 2008 +0000 @@ -13,6 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +//FIXME: Ddoc is outdated /** This module handles stored options, currently all except input maps. * * The purpose of having all options centrally controlled is to allow generic handling by the GUI @@ -44,6 +45,7 @@ logger = Log.getLogger ("mde.lookup.Options"); } +//FIXME: Ddoc is outdated /** Base class for handling options. * * This class itself handles no options and should not be instantiated, but provides a sub-classable @@ -165,11 +167,16 @@ c.secName = i; subClasses[cast(ID) i] = c; } - - // Track all sections for saving/loading/other generic handling. - Options[ID] subClasses; - bool changed = false; // any changes at all, i.e. do we need to save? - + + /** Get the hash map of Options classes. */ + Options[ID] optionsClasses () { + return subClasses; + } + + // Track all sections for saving/loading/other generic handling. + private Options[ID] subClasses; + private bool changed = false; // any changes at all, i.e. do we need to save? + /* Load/save options from file. * * If the file doesn't exist, no reading is attempted (options are left at default values). @@ -246,6 +253,7 @@ } else const char[] setMixin = ``; }+/ + /+ /** Set option symbol of an Options sub-class to val. * * Due to the way options are handled generically, string IDs must be used to access the options @@ -264,7 +272,6 @@ logger.error ("Options.set: invalid symbol"); } }+/ - /+ /** Get option symbol of an Options sub-class. * * Using this method to read an option is not necessary, but allows for generic use. */ @@ -293,9 +300,13 @@ return opts; } - /// Variable validate function. This implementation does nothing. + /** Variable validate function, called when options are loaded from file. This implementation + * does nothing. */ void validate() {} + /** Boolean, telling whether translation strings have been loaded for the instance. */ + bool transLoaded; + protected { char[] secName; // name of this option setting; set null after translation is loaded OptionChanges optionChanges; // all changes to options (for saving)