Changes between Version 1 and Version 2 of code/doc/ConfigValueIncludes
- Timestamp:
- Oct 8, 2008, 12:59:24 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/doc/ConfigValueIncludes
v1 v2 13 13 === SetConfigValue === 14 14 15 '''SetConfigValue('''''varname ''''', '''''defvalue''''')''' defines a new config-value with a default value. ''varname'' must be a member-variable of a class. ''defvalue'' is the default value that will be initially used until the user configuers another value.15 '''SetConfigValue('''''varname, defvalue''''')''' defines a new config-value with a default value. ''varname'' must be a member-variable of a class. ''defvalue'' is the default value that will be initially used until the user configures another value. The type of the value can be everything supportet by [wiki:MultiType]. 16 16 17 17 '''Important''': SetConfigValue '''must''' be used within setConfigValues(). This is a function that gets called to assign the configured values to an object. Additionally setConfigValues() '''must''' be called within the constructor of the class. … … 22 22 23 23 You can set a callback function that gets called as soon as the config-value changes by adding '''.callback('''''this, &classname::functionname''''')''' at the end of the macro. 24 25 26 === SetConfigValueVector === 27 '''SetConfigValueVector('''''varname, defvalue''''')''' defines a new configurable vector with a default value. Value and default value must be a std::vector<type> where type can be everything supportet by [wiki:MultiType]. 28 29 Otherwise SetConfigValueVector is just like SetConfigValue; the same features, the same restrictions. 30 31 In the config-file a vector is slightly different to a simple config-value. The vector entries are named "varname[index]" where ''index'' goes from zero until the vectors size. If the user adds a new entry with ''index > vector.size()'' the numbers between are added too but without a value. 24 32 25 33 === ResetConfigValue === … … 37 45 * '''set''', ''index'', ''value'': Does the same like '''set''' for simple config-values but only for a given element of the vector 38 46 * '''tset''', ''index'', ''value'': Does the same like '''tset''' for simple config-values but only for a given element of the vector 39 * '''add''', ''value'': Adds a new element with a given value to the vector47 * '''add''', ''value'': Adds a new element with a given value to the end of the vector 40 48 * '''remove''', ''index'': Removes a given element from the vector 41 49