"setSelection"
Selects and highlights a given part of a TextEdit text.
Synopsis
void setSelection(int fromPara, int fromPos, int toPara, int toPos, int selNum,
string color);
Parameter
Parameter | Description |
---|---|
fromPara | The first paragraph/row which is selected. |
fromPos | The first position in the row which is selected. |
toPara | The last paragraph/row which is selected. |
toPos | The last position in the last row that is selected. |
selNum |
selNum is >= 0, 0 is the default selection with a default color. An individual color can be used with setNum >= 1. |
color | The color that is used for the selection. |
Description
Selects and highlights a given part of a TextEdit text.
EXAMPLE
Selects and highlights a given part of a TextEdit text:
main()
{
int fromPara, fromPos,toPara,toPos, selNum;
fromPara = 0;
fromPos = 0;
toPara = 2;
toPos = 4;
selNum =1;
string color = "green";
TEXT_EDIT1.setSelection(fromPara,fromPos,toPara,toPos,selNum,color);
}
Assignment
TextEdit