Programmer Guide/Macro Library/CTemplates: Difference between revisions
From STX Wiki
Jump to navigationJump to search
No edit summary |
|||
Line 8: | Line 8: | ||
;Usage: | ;Usage: | ||
:<code>ctemplates [ <var>type</var> ]</code> | :<code>ctemplates [ <var>type</var> ]</code> | ||
:<code>cobj new ctemplates [ <var> | :<code>cobj new ctemplates [ <var>type</var> ]</code> | ||
:;<var>type</var>: selects the type of templates to be managed (default: '''ASegTemplate''') | :;<var>type</var>: selects the type of templates to be managed (default: '''ASegTemplate''') | ||
;Result: an initialized instance | ;Result: an initialized instance |
Revision as of 11:34, 7 March 2018
- File: Classes.STX, linked to library STX.LIB
- Parent class: CObj
A class to manage templates (e.g. of type DialogTemplate, ASegTemplate or attrTemplate)
Contents
Create Instance
- Usage
ctemplates [ type ]
cobj new ctemplates [ type ]
- type
- selects the type of templates to be managed (default: ASegTemplate)
- Result
- an initialized instance
Delete Instance
- Usage
instance destroy
- Result
- none (void)
GetTable
- Usage
instance gettable
- Result
- an extended table containing the id's of the available templates of the selected type (one per entry, field id)
GetList
- Usage
instance getlist
- Result
- a semi-colon separated list of the id's of the available templates of the selected type
GetAttributeList
- Usage
instance getattributelist id
- id
- the id of the template
- Result
- an blank separated list of attributes defined in the selected template
GetValueListForAttribute
- Usage
instance getvaluelistforattribute type ; id ; attr
- type
- selects type of result
- table: return a simple table containing on value per line; the default value is stored in the first line
- list: return a blank separated list of values
- id
- the id of the template
- attr
- the name of the attribute
- Result
- an blank separated list of defined values or a simple table containing one value per line (see argument type)
GetDefaultValueForAttribute
- Usage
instance getdefaultvalueforattribute id ; attr
- id
- the id of the template
- attr
- the name of the attribute
- Result
- the default value
GetFlags
- Usage
instance getflags id ; attr
- id
- the id of the template
- attr
- the name of the attribute
- Result
- get the dialog flags defined for the attribute
CheckFlag
- Usage
instance checkflag id ; attr ; flag
- id
- the id of the template
- attr
- the name of the attribute
- flag
- the flag to be tested
- Result
- 1 if the flag is set, 0 otherwise
Manage
- Usage
instance manage
- Result
- none (void)
- Description
- Display the template management dialog. This dialog implements functions to view, edit (using a text editor), rename and delete templates.
GetVars
- Usage
instance getvars id
- id
- the id of the template
- Result
- An extended table contains all definitions of all variables of the selected template. The returns table has the string fields Type, Name, Default, Values and Flags.