Hi.
I want to show a window just below text selection in ScaleRichView.
I don't know how to find the position of the selected text (even in tables) in Screen coordinates. I tried with GetItemClientCoords, GetSelectionRect and ClientToScreen API but no luck so far.
Can anyone help me, please...
Thank you in advance.
Get caret position of the selected text in screen
-
- Posts: 84
- Joined: Sun Dec 16, 2007 7:15 pm
-
- Posts: 84
- Joined: Sun Dec 16, 2007 7:15 pm
See also:
convertRVtoSRV(p : TPoint) : TPoint; - converting of coordinates RV in coordinates SRV.
p - position in RichView
Result - position in ScaleRichView
convertSRVtoRV(p : TPoint; var InArea, bInLeft : Boolean) : TPoint; - converting of coordinates SRV in coordinates RV.
InArea - to be inside of area of page or not. True - inside.
bInLeft - to be at the left or on the right, if InArea = True.
function GetCaretPosInUnits(Units: TRVUnits; var CaretPosX, CaretPosY : Extended) : Boolean;
Units - a unit of measure of coordinates in SRV.
CaretPosX, CaretPosY - a position of the caret.
function GetRVCaretPos(var PageNo : Integer) : TPoint;
returns a position of the caret in coordinates RV
PageNo - number of page in which is the caret.
property CaretPos : TPoint;
position of the caret in coordinates SRV
convertRVtoSRV(p : TPoint) : TPoint; - converting of coordinates RV in coordinates SRV.
p - position in RichView
Result - position in ScaleRichView
convertSRVtoRV(p : TPoint; var InArea, bInLeft : Boolean) : TPoint; - converting of coordinates SRV in coordinates RV.
InArea - to be inside of area of page or not. True - inside.
bInLeft - to be at the left or on the right, if InArea = True.
function GetCaretPosInUnits(Units: TRVUnits; var CaretPosX, CaretPosY : Extended) : Boolean;
Units - a unit of measure of coordinates in SRV.
CaretPosX, CaretPosY - a position of the caret.
function GetRVCaretPos(var PageNo : Integer) : TPoint;
returns a position of the caret in coordinates RV
PageNo - number of page in which is the caret.
property CaretPos : TPoint;
position of the caret in coordinates SRV