Index

C/C++ Functions

txTextSetSelect

DT_SWORD txTextSetSelect(DT_TXDOC text_doc, const DT_SLONG first_char[], const DT_SLONG last_char[], DT_SLONG array_len, DT_RECT_SLONG* extent, DT_SLONG reserved)

Short Description: Set text selection(s)

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.

Parameters

ParameterDescription

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.

If you do not wish to receive this rectangle, you may set extent to DV_NULL.

reserved

Reserved for future use. Must be set to 0.

Return Value

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.

Note

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).

Comments

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.

Related Functions

txTextGetSelect

 

Index