File Settings.lua
Functions
Settings:_devSettingsView (itemKey, bindTo, spec, returnViewItems) | Present Develop settings "editor/chooser" view. |
Settings:_init (_parentKey, _items, bindTo, force) | Initialize spec data in bind-to object at root key, and initialize lookup for future reference. |
Settings:childKey (parentKey, childName) | Get new key from parent key and child name. |
Settings:getDevelopSettingsViewItems (parentKey, bindTo, viewType) | Get develop settings view items, value key, and function for commiting values after view items presented to user. |
Settings:getKey (rootKeyOrName, ...) | Translate key names, into usable form (internal format). |
Settings:getNameForKey (key) | Get simple name for (usually absolute) key - works for relative keys too. |
Settings:getValue (_key, bindTo, options) | Get value of setting specified by key, in bind-to property table (could be prefs or ad-hoc props) |
Settings:getViewItems (params, viewData, bindTo) | Get generic array of view items based on data description table. |
Settings:getViewItemsAndLookup (call) | Get settings root view items and lookup. |
Settings:new (t) | Constructs a new preference manager. |
Settings:newClass (t) | Constructor for extending class. |
Functions
- Settings:_devSettingsView (itemKey, bindTo, spec, returnViewItems)
-
Present Develop settings "editor/chooser" view.
Parameters:
-
itemKey
: -
bindTo
: -
spec
: -
returnViewItems
:
Usage:
presently only supports multi-item selection (checkboxes), but could be modified to support
single item view (radio-buttons).not wrapped (so wrap in calling context as warranted).
-
- Settings:_init (_parentKey, _items, bindTo, force)
-
Initialize spec data in bind-to object at root key, and initialize lookup for future reference.
Parameters:
-
_parentKey
: -
_items
: -
bindTo
: -
force
:
-
- Settings:childKey (parentKey, childName)
-
Get new key from parent key and child name.
Parameters:
-
parentKey
: -
childName
:
-
- Settings:getDevelopSettingsViewItems (parentKey, bindTo, viewType)
-
Get develop settings view items, value key, and function for commiting values after view items presented to user.
Parameters:
-
parentKey
: -
bindTo
: -
viewType
:
Usage:
this is a special purpose function in case develop settings are to be included inline (instead of in response to event).
-
- Settings:getKey (rootKeyOrName, ...)
-
Translate key names, into usable form (internal format).
Parameters:
-
rootKeyOrName
: (string) may already be in internal format - it's ok. -
...
: (strings) if var-args present, root-key-or-name is prepended to far-args, otherwise root-key-or-name is considered relative to current (root) settings key.
Usage:
Internal format is a string with double-underscore to delimit/separate.
-
- Settings:getNameForKey (key)
-
Get simple name for (usually absolute) key - works for relative keys too.
Parameters:
-
key
:
Usage:
under normal circumstances, this method is not needed. I've used it for testing and such.
-
- Settings:getValue (_key, bindTo, options)
-
Get value of setting specified by key, in bind-to property table (could be prefs or ad-hoc props)
Parameters:
-
_key
: (string, required) relative or absolute key specifying data value in property table. -
bindTo
: (property table, default=prefs) property table. -
options
: (table, optional) e.g. 'whole' for whole array, instead of array element.
Usage:
depends on item having been pre-initialized, since item data descriptor must be consulted to format value.
*** throws error if key not registered. this way one can make distinction between value is nil, and value is invalid.
Return values:
- value (any, required) typed/formated value.
- rawValue (string, number, boolean; required) raw value as read from property table.
-
- Settings:getViewItems (params, viewData, bindTo)
-
Get generic array of view items based on data description table.
Parameters:
-
params
: -
viewData
: (table, required) array of data descriptors.table element:
-
bindTo
: ( property table, required )
-
- Settings:getViewItemsAndLookup (call)
-
Get settings root view items and lookup.
Parameters:
-
call
:
-
- Settings:new (t)
-
Constructs a new preference manager.
Installation procedure is going to have to be smart enough to deal with pre-existing directory upgrade.
This object manages named preference sets. Exclude and you just have the reglar set of unnamed (un-prefixed) prefs...
Param Table In:
- name(id): set name. if missing, then default set.
- file-essential boolean.Object Table Out:
- friendlyName: same as name/id except for default.
- file (path)
- prefs (name-val table)Parameters:
-
t
: input parameter table.
Usage:
Subdirectory for supplemental files is 'Settings' in plugin directory.
See app class pref methods for more info.
Return value:
- Preference manager object.
-
- Settings:newClass (t)
-
Constructor for extending class.
Parameters:
-
t
:
-