TerCreateCellId
Create a cell id.
int TerCreateCellId(hWnd, NewRow, PrevCell, RowAlign, RowPos, RowMinHeight, CellWidth, shading, LeftWidth, RightWidth, TopWidth, BotWidth, RowSpan, ColSpan, flags)
HWND hWnd; | The handle of the window to be accessed |
BOOL NewRow; | Set to TRUE when creating the first cell of a new row. |
int PrevCell; | Set this value to 0 when creating the first cell id for first row of the table. Otherwise set it to the cell id of the previous cell in the table. |
int RowAlign; | LEFT,RIGHT, CENTER. (set to 0 for default). |
int RowPos; | Row position in twips (set to 0 for default). |
int RowMinHeight; | Minimum row height in twips (set to 0 for default). |
int CellWidth; | Cell width in twips. |
int shading; | Shading percentage (set to 0 for default) |
int LeftWidth; | The left border width (set to 0 for default). |
int RightWidth; | The right border width (set to 0 for default). |
int TopWidth; | The top border width (set to 0 for default). |
int BotWidth; | The bottom border width (set to 0 for default). |
int RowSpan; | Number of rows spanned by the cell (set to 1 for default). |
int ColSpan; | Number of columns spanned by the cell (set to 1 for default). |
int flags; | CFLAG_ constants defined in the ter.h file (set to 0 for default). |
Description: This function is used to create a new cell id. This function is useful for creating tables very efficiently.
The following example creates a 3 row by 2 column table:
PrevCell=0;
for (row=0;row<3;row++) {
for (col=0;col<2;col++) {
if (col==0) NewRow=TRUE;
else NewRow=FALSE;
CellId=TerCreateCellId(hWnd,NewRow,PrevCell,0,0,0,
2000,0,0,0,0,0,1,1,0);
string = "cell text" + chr$(CELL_CHAR); // append cell
delimiter to the cell text
TerAppendTextEx(hWnd,string,-1,-1,CellId,-1,FALSE);
PrevCell=CellId;
}
string = chr$(ROW_CHAR); // insert a row delimiter
TerAppendTextEx(hWnd,string,-1,-1,CellId,-1,FALSE);
}
Return Value: When successful, this function returns the id of the new cell. Otherwise it returns 0