Programmer Guide/Macro Library/CTemplates: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
m (Text replace - "S_TOOLS-STx" to "{{STX}}")
Line 4: Line 4:
A class to manage segment templates (<code>ASegTemplate</code>)<code><code>.</code></code>
A class to manage segment templates (<code>ASegTemplate</code>)<code><code>.</code></code>


You can retrieve a list of templates available in the S_TOOLS-STx INI file. You can display a dialog offering the user the option of importing from or exporting templates to disk. You can delete templates from the S_TOOLS-STx INI file.
You can retrieve a list of templates available in the {{STX}} INI file. You can display a dialog offering the user the option of importing from or exporting templates to disk. You can delete templates from the {{STX}} INI file.


====CASegTemplate construction====
====CASegTemplate construction====
Line 34: Line 34:
=====Result:=====
=====Result:=====


Depending on <var>rType</var>, a table or a list containing the ids of the segment templates in the current S_TOOLS-STx INI file.
Depending on <var>rType</var>, a table or a list containing the ids of the segment templates in the current {{STX}} INI file.


===Reload===
===Reload===


Reload the list of templates from the S_TOOLS-STx INI file.
Reload the list of templates from the {{STX}} INI file.


=====Usage:=====
=====Usage:=====
Line 62: Line 62:
===Import===
===Import===


Import a segment template from disk into the S_TOOLS-STx INI file. If no template path is specified, the user is asked to select one from disk.
Import a segment template from disk into the {{STX}} INI file. If no template path is specified, the user is asked to select one from disk.


=====Usage:=====
=====Usage:=====
Line 92: Line 92:
;<var>asegtemplate</var>
;<var>asegtemplate</var>


:The id of a segment template currently in the S_TOOLS-STx INI file.
:The id of a segment template currently in the {{STX}} INI file.


=====Result:=====
=====Result:=====
Line 100: Line 100:
===Remove===
===Remove===


Remove an existing segment template from the current S_TOOLS-STx INI file.
Remove an existing segment template from the current {{STX}} INI file.


=====Usage:=====
=====Usage:=====
Line 108: Line 108:
;<var>asegtemplate</var>
;<var>asegtemplate</var>


:The id of a segment template currently in the S_TOOLS-STx INI file.
:The id of a segment template currently in the {{STX}} INI file.


=====Result:=====
=====Result:=====
Line 124: Line 124:
;<var>asegtemplate</var>
;<var>asegtemplate</var>


:The id of a segment template currently in the S_TOOLS-STx INI file.
:The id of a segment template currently in the {{STX}} INI file.


=====Result:=====
=====Result:=====
Line 142: Line 142:
;<var>asegtemplate</var>
;<var>asegtemplate</var>


:The id of a segment template currently in the S_TOOLS-STx INI file.
:The id of a segment template currently in the {{STX}} INI file.

Revision as of 17:55, 5 April 2011

CASegTemplate : CObj

A class to manage segment templates (ASegTemplate).

You can retrieve a list of templates available in the STx INI file. You can display a dialog offering the user the option of importing from or exporting templates to disk. You can delete templates from the STx INI file.

CASegTemplate construction

The CASegTemplate constructor takes no parameters but still needs to be called.

CASegTemplate Member Functions

The CASegTemplate class has the following member functions. See CObj Member Functions for a list of functions implemented in the parent class.

List

List the available templates in either a table or a semi-colon separated list.

Usage:

inst List [ rType ]

Parameters:
rType
The type of list to return. Possible values are:
table - Return a simple table.
list - Return a semi-colon separated list.
Result:

Depending on rType, a table or a list containing the ids of the segment templates in the current STx INI file.

Reload

Reload the list of templates from the STx INI file.

Usage:

inst Reload

Result:

An empty string.

Manage

Show user a dialog asking user to select segment templates to import, export, delete or reload from file.

Usage:

inst Manage

Result:

An empty string.

Import

Import a segment template from disk into the STx INI file. If no template path is specified, the user is asked to select one from disk.

Usage:

inst Import [ path ] [ ; confirmReplace=1 ]

Parameters:
path
The path to the segment template to import. If this parameter is not specified, the user is asked to select a template from disk.
confirmReplace
1 if the user should be prompted when replacing existing templates. 0 otherwise. The default is 1.

Result:

The id of the valid segment template or an empty string

Export

Export an existing ASegTemplate to disk.

Usage:

inst Export asegtemplate

asegtemplate
The id of a segment template currently in the STx INI file.
Result:

An empty string.

Remove

Remove an existing segment template from the current STx INI file.

Usage:

inst Remove asegtemplate

asegtemplate
The id of a segment template currently in the STx INI file.
Result:

An empty string.

ReloadFromFile

Reload an existing segment template from file.

Usage:

inst Reload asegtemplate

asegtemplate
The id of a segment template currently in the STx INI file.
Result:

An empty string.

ViewTemplate

Display a dialog based on a segment template.

Usage:

inst ViewTemplate asegtemplate

Parameters:
asegtemplate
The id of a segment template currently in the STx INI file.

Navigation menu

Personal tools