Programmer Guide/Macro Library/CTemplates: Difference between revisions
From STX Wiki
Jump to navigationJump to search
Line 51: | Line 51: | ||
==CheckFlag== | ==CheckFlag== | ||
;Usage: <code><var>instance</var> | ;Usage: <code><var>instance</var> checkflag <var>id ; attr ; flag</var></code> | ||
:;<var>id</var>: the id of the template | :;<var>id</var>: the id of the template | ||
:;<var>attr</var>: the name of the attribute | :;<var>attr</var>: the name of the attribute |
Revision as of 11:32, 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 [ typetag ]
cobj new ctemplates [ typetag ]
- typetagselects 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 the definitions of all variables of the selected template. The returns table has the string fields Type, Name, Default, Values and Flags.