econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Fri Jul 21, 2006 8:40 pm Post subject: |
|
|
To convert line/col to position in text buffer use TSyntaxMemo.CaretPosToStrPos(col, line).
Another coordinate functions
function MouseToCaret(X, Y: integer): TPoint;
Returns caret position (column, line) at the window coordinates.
function CaretToMouse(cX, cY: integer): TPoint;
Returns top-left corner of the caharacter position in window coordinates.
function CaretPosToStrPos(const p: TPoint): integer;
Returns zero-based character position in text buffer at the specified caret position. If caret is out of text result points on the line break.
function StrPosToCaretPos(p: integer): TPoint;
Returns caret position (column, line) of the character at specified index in text buffer.
Michael. |
|