TE Edit Control Win32 / Win64 Help
Product page

TerEditList

Create or edit a list table item.

int TerEditList(hWnd, NewList, ListId, PropDialog, ListName, nested, flags)
HWND hWnd;The handle of the window to be accessed
BOOL 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.
BOOL 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.
LPBYTE ListNme;Name of the list
BOOL 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= TerEditList(hWnd, TRUE, 0, FALSE, "MyFirstList",TRUE, 0); // create a new multi-level list

TerEditListLevel(hWnd, TRUE,ListId, 0,1, LIST_DEC, LISTAFT_TAB, "(~1~)", 0, 0); // print the first level in (1), (2), (3)…format.

TerEditListLevel(hWnd, TRIE,ListId, 1,1, LIST_LWR_ALPHA, LISTAFT_TAB, "~1~.~2~", 0, 0); // print the second level in 1.a, 1.b. 1.c … format.

ListOrId=TerEditListOr(hWnd, TRUE, 0, FALSE, ListId, 0, 0); // create a list-override id for our list

SetTerCursorPos(hWnd, 10,0,TRUE); // position at line number 10

TerSetParaList(hWnd,FALSE,-1, ListOrId, 0, TRUE); // apply top level numbering to this line

SetTerCursorPos(hWnd, 11,0,TRUE); // position at line number 11

TerSetParaList(hWnd,FALSE,-1, ListOrId, 1, TRUE); // apply second level numbering to this line