This function sets the boundaries of the active text selection(s).
This function should be used after a texflow area is rendered by calling the txTextDraw function with its flags parameter set to instruct D-Type Unicode Text Module to generate text flows and frames.
Parameter | Description |
---|---|
text_doc |
Handle of the associated text document instance. |
first_char |
An input array of start positions of the selected character range(s). |
last_char |
An input array of end positions of the selected character range(s). |
array_len |
The number of selected character ranges, i.e. the size of the first_char and last_char arrays. If only a single selected character range (i.e. a single text selection) is needed, first_char and last_char should be single element arrays and array_len should be set to 1. If multiple (non-contiguous) or block (rectangular) text selections are needed, first_char and last_char should be multi-element arrays and array_len should be set accordingly. Additionally, the selected character ranges must not intersect each other. |
extent |
A pointer to the DT_RECT_SLONG structure that will receive a rectangle describing the smallest enclosing box of the screen area that needs to be repainted following the text selection operation. |
reserved |
Reserved for future use. Must be set to 0. |
If a portion of the screen area needs to be repainted, the return value is 1. If no portion of the screen area needs to be repainted, the return value is 2. In this case all members of the DT_RECT_SLONG structure will be set to 0.
If the function was not successful (e.g. invalid input parameters), the return value is 0.
In D-Type Unicode Text Module API, the cursor is a single text selection with equal start and end position (i.e. the length of the selected character range is zero).
The extent returned by this function is a rectangle that describes the smallest enclosing box of the screen area that needs to be repainted following a text selection operation. After that, the txTextDraw function can be called again in order to repaint the area defined by extent.