More infos on ATSUCaret

From Apache OpenOffice Wiki
Revision as of 12:49, 7 June 2006 by Ericb (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Fields fX Represents the x-coordinate of the caret’s starting pen position relative to the position of the origin of the line in the current graphics port in which the hit occurred.

fY Represents the y-coordinate of the caret’s starting pen position relative to the position of the origin of the line in the current graphics port in which the hit occurred.

fDeltaX Represents the x-coordinate of the caret’s ending pen position relative to the position of the origin of the line in the current graphics port in which the hit occurred. This position takes into account line rotation. You do not have to rotate it yourself.

fDeltaY Represents the y-coordinate of the caret’s ending pen position relative to the position of the origin of the line in the current graphics port in which the hit occurred. This position takes into account line rotation. You do not have to rotate it yourself.

Discussion The function ATSUOffsetToPosition passes back two structures of type ATSUCaret to represent the caret position relative to the origin of the line in the current graphics port, corresponding to a specified edge offset. If the edge offset is at a line boundary, the structure passed back in oMainCaret contains the starting and ending pen locations of the high caret, while oSecondCaret contains the low caret. If the offset is not at a line boundary, both parameters contain the same structure. This structure contains the starting and ending pen locations of the main caret.

You can use the information in this structure to draw a caret by calling the MoveTo and LineTo functions. For example.

MoveTo (fX, fY); LineTo (fDeltaX, fDeltaY);

Personal tools