TerEditList
Create or edit a list table item.
int TerEditList( NewList, ListId, PropDialog, ListName, nested, flags)
boolean NewList; | Set to true to create a new list item. Set to false to modify an existing list item. |
int ListId; | The id of the list item to modify. This parameter is ignored when the 'NewList' parameter is set to true. |
boolean PropDialog; | Show a dialog box for the user to enter the list properties. When this parameter is set to true, the values for the remaining parameters are ignored. |
String ListNme; | Name of the list |
boolean nested; | Set to true to create a multi-level list. Set to false to create a single level list. A multi-level list can have up to 9 levels. |
DWORD flags; | The following flag bits are supported currently: |
| LISTFLAG_RESTART_SEC: | Restart the numbering at a section break. |
Description: This function allows you to create a list table item. Typically, the following steps are needed to uselistnumbering for a paragraph.
The first step is to use the TerEditList function to create a list table item.
The second step is to use the TerEditListOr function to create one or more overrides for the list.
Finally, you can use the TerSetParaList function with the list-override id and list-level parameters to assign list numbering for a paragraph. The list or list-override level properties can be modified using the TerEditListLevel function.
Return Value: When successful, this function returns a valid list id. A return value of -1 indicates an error condition.
Example:
int ListId, ListOrId;
ListId= tej.TerEditList( true, 0, false, "MyFirstList",true, 0); // create a new multi-level list
tej.TerEditListLevel( true,ListId, 0,1, tej.LIST_DEC, tej.LISTAFT_TAB, "(~1~)", 0, 0); // print the first level in (1), (2), (3)…format.
tej.TerEditListLevel( true,ListId, 1,1, tej.LIST_LWR_ALPHA, tej.LISTAFT_TAB, "~1~.~2~", 0, 0); // print the second level in 1.a, 1.b. 1.c … format.
ListOrId=tej.TerEditListOr( true, 0, false, ListId, false, 0); // create a list-override id for our list
tej.SetTerCursorPos( 10,0,true); // position at line number 10
tej.TerSetParaList(false,-1, ListOrId, 0, true); // apply top level numbering to this line
tej.SetTerCursorPos( 11,0,true); // position at line number 11
tej.TerSetParaList(false,-1, ListOrId, 1, true); // apply second level numbering to this line