Index

C/C++ Functions

txTextCommand

DT_SWORD txTextCommand(DT_TXDOC text_doc, DT_ID_SWORD command, DT_RECT_SLONG* extent, DT_SLONG reserved)

Short Description: Process text commands

This function processes a text command (e.g. an operation on text performed by pressing a key on the keyboard or by choosing a text command from the menu). Depending on the command and current text selection state, this action may result in a new cursor position or updated boundaries of the text selection.

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.

command

Type of command. Can be one of the following:

TX_CMD_RESET                  -3   /* Deselect all text and remove cursor */ 
TX_CMD_SELECTFLOW             -1   /* Select the current text flow (obsolete) */ 
TX_CMD_SELECTFIRSTWORD        -4   /* Select first word (obsolete) */ 
TX_CMD_SELECTFIRSTLINE        -6   /* Select first line (obsolete) */ 
TX_CMD_SELECTFIRSTPARAGRAPH   -5   /* Select first paragraph (obsolete) */ 
TX_CMD_SELECTFIRSTAREA        -7   /* Select first text area (obsolete) */ 
TX_CMD_SELECTALL              -2   /* Same as TX_CMD_SELECTTEXT (obsolete) */ 
TX_CMD_SELECTWORD             -8   /* Select entire word */ 
TX_CMD_SELECTWORDS           -13   /* Select entire words (extend existing selections) */ 
TX_CMD_SELECTLINE             -9   /* Select entire line */ 
TX_CMD_SELECTPARAGRAPH       -10   /* Select entire paragraph */ 
TX_CMD_SELECTPARAGRAPHS      -14   /* Select entire paragraphs (extend existing selections) */ 
TX_CMD_SELECTAREA            -11   /* Select entire text area */ 
TX_CMD_SELECTTEXT            -12   /* Select all text */ 

TX_CMD_LEFT                    3   /* Go to previous visible character */ 
TX_CMD_RIGHT                   4   /* Go to next visible character */ 
TX_CMD_UP                      5   /* Go to previous row */ 
TX_CMD_DOWN                    6   /* Go to next row */ 
TX_CMD_SHIFT_LEFT              7   /* Shift + Go to previous visible character */ 
TX_CMD_SHIFT_RIGHT             8   /* Shift + Go to next visible character */ 
TX_CMD_SHIFT_UP                9   /* Shift + Go to previous row */ 
TX_CMD_SHIFT_DOWN             10   /* Shift + Go to next row */ 

TX_CMD_SET                    11   /* Set cursor to closest visible position */ 
TX_CMD_CURRCHAR               12   /* Go to current character */ 
TX_CMD_CURRTEXT               53   /* Same as TX_CMD_CURRCHAR but safer (checks bounds in case the text is changed externally) */ 

TX_CMD_PREVCHAR               13   /* Go to previous character */ 
TX_CMD_PREVWORD               14   /* Go to previous word */ 
TX_CMD_PREVLINE               15   /* Go to previous text line */ 
TX_CMD_PREVPARAGRAPH          16   /* Go to previous paragraph */ 
TX_CMD_PREVAREA               17   /* Go to previous text area */ 
TX_CMD_NEXTCHAR               18   /* Go to next character */ 
TX_CMD_NEXTWORD               19   /* Go to next word */ 
TX_CMD_NEXTLINE               20   /* Go to next text line */ 
TX_CMD_NEXTPARAGRAPH          21   /* Go to next paragraph */ 
TX_CMD_NEXTAREA               22   /* Go to next text area */ 

TX_CMD_SHIFT_PREVCHAR         23   /* Shift + Go to previous character */ 
TX_CMD_SHIFT_PREVWORD         24   /* Shift + Go to previous word */ 
TX_CMD_SHIFT_PREVLINE         25   /* Shift + Go to previous text line */ 
TX_CMD_SHIFT_PREVPARAGRAPH    26   /* Shift + Go to previous paragraph */ 
TX_CMD_SHIFT_PREVAREA         27   /* Shift + Go to previous text area */ 
TX_CMD_SHIFT_NEXTCHAR         28   /* Shift + Go to next character */ 
TX_CMD_SHIFT_NEXTWORD         29   /* Shift + Go to next word */ 
TX_CMD_SHIFT_NEXTLINE         30   /* Shift + Go to next text line */ 
TX_CMD_SHIFT_NEXTPARAGRAPH    31   /* Shift + Go to next paragraph */ 
TX_CMD_SHIFT_NEXTAREA         32   /* Shift + Go to next text area */ 

TX_CMD_STARTWORD              33   /* Go to start of word */ 
TX_CMD_STARTLINE              34   /* Go to start of text line */ 
TX_CMD_STARTPARAGRAPH         35   /* Go to start of paragraph */ 
TX_CMD_STARTAREA              36   /* Go to start of text area */ 
TX_CMD_STARTTEXT              37   /* Go to start of text */ 
TX_CMD_ENDWORD                38   /* Go to end of word */ 
TX_CMD_ENDLINE                39   /* Go to end of text line */ 
TX_CMD_ENDPARAGRAPH           40   /* Go to end of paragraph */ 
TX_CMD_ENDAREA                41   /* Go to end of text area */ 
TX_CMD_ENDTEXT                42   /* Go to end of text */ 

TX_CMD_SHIFT_STARTWORD        43   /* Shift + Go to start of word */ 
TX_CMD_SHIFT_STARTLINE        44   /* Shift + Go to start of text line */ 
TX_CMD_SHIFT_STARTPARAGRAPH   45   /* Shift + Go to start of paragraph */ 
TX_CMD_SHIFT_STARTAREA        46   /* Shift + Go to start of text area */ 
TX_CMD_SHIFT_STARTTEXT        47   /* Shift + Go to start of text */ 
TX_CMD_SHIFT_ENDWORD          48   /* Shift + Go to end of word */ 
TX_CMD_SHIFT_ENDLINE          49   /* Shift + Go to end of text line  */ 
TX_CMD_SHIFT_ENDPARAGRAPH     50   /* Shift + Go to end of paragraph */ 
TX_CMD_SHIFT_ENDAREA          51   /* Shift + Go to end of text area */ 
TX_CMD_SHIFT_ENDTEXT          52   /* Shift + Go to end of text */ 

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 a text selection action.

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.

Comments

This function can be called when the user presses a key on the keyboard or chooses a text command from the menu. When called, the function will interpret the command as required. This may result in a cursor movement, selection highlighting or any other text selection action that a text command can invoke. However, the developer does not need to know what operation, if any, was invoked.

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 action. After that, the txTextDraw function can be called again in order to repaint the area defined by extent.

 

Index